|[mdt-papyrus.dev] About OCL for specifying and calculating derivation rules in a UML profile|
Does someone know if it possible to use (as explained here ), OCL in Papyrus profile definition to specify a derivation rule of a derived property of a stereotype ? And in that case, when applyng the profile embedding the OCL rules, will the derived property value calculated automatically ?
Here is an example of profile :
Here is the derivation rule specification for the commonMeaning property:
The commonMeaning attribute is a derived property subetting the meanings attribute. The derivation rule shall be the following: the value of the commonMeaning attribute is calculated as being the Definition model element (i.e., owned comments stereotyped with <<Definition>> and annotating the owner element, in that case the Term itself).
And here is an OCL rule, I tried to write to implement the derivation rule of the commonMeaning property:
self.commonMeaning: Definition derive:
self.base_Class.ownedComment-> select ( oc | oc.isStereotypeApplied(Definition) and oc.isCommon = true)
Thanks for helping,
Back to the top