Page 1 of 1

How to validate correct specialization from Library Classes

PostPosted: Mon Feb 18, 2019 9:26 am
I created a Library and a Profile. Each Class in my user model, that has my Stereotype applied must also specialize my Library Class. I tried to specify a validation rule with OCL that checks this, but was not able to get it running. Do you have any recommendations? Attached is the example model.

My Validation Constraint:
Code: Select all

There seem to be many problems:
- allParents() is not supported. I probably can replace this with
Code: Select all
and some closure operation.
- LibraryClass1 is not recognized, even though I imported the Library into the validation suite. I had to use the qualified name.
- This compiles
Code: Select all
but is always false
- This works
Code: Select all>includes('LibraryClass1')
, but I would consider it a work around.

The next rule that I would like to check is, whether all Specializations of LibraryClass1 have the stereotype applied.