How to validate correct specialization from Library Classes

Discussions about Domain Specific Language customizations

Moderator: Moderators

How to validate correct specialization from Library Classes

Postby Axel Scheithauer » 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
self.allParents()->includes(LibraryClass1)


There seem to be many problems:
- allParents() is not supported. I probably can replace this with
Code: Select all
generalization.general->asSet()
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
self.general->includes(Library1::LibraryClass1)
but is always false
- This works
Code: Select all
self.general.name->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.
You do not have the required permissions to view the files attached to this post.
Axel Scheithauer
Forum Beginner
Forum Beginner
 
Posts: 73
Posts Rating:0
Joined: Fri May 21, 2010 7:19 am
Location: Hamburg, Germany
Full name: Axel Scheithauer

Return to DSL

Who is online

Users browsing this forum: No registered users and 2 guests