2

I have a class in UML that looks like this (it's in German, but I think it doesn't matter):

enter image description here

The first method takes an array of 4 "Rohstoffkarte". That's an abstract class and I have 5 concrete sub-classes for it. Now I want to check (with OCL) that all 4 instances in the array are from the same sub-class.

Any idea how to do this? I'm working with MagicDraw.

Thanks.

Thomas Uhrig
  • 30,811
  • 12
  • 60
  • 80

1 Answers1

3

you can use

oclIsKindOf, oclIsTypeOf to check type conformance, and use oclType to get the type of an object.

See OMG Object Constraint Language Specification Version 2.3.1, p.22

http://www.omg.org/spec/OCL/2.3.1

gefei
  • 18,922
  • 9
  • 50
  • 67