|Re: [mdt-papyrus.dev] About OCL for specifying and calculating derivation rules in a UML profile|
It certainly should be possible.
(I'm slightly baffled by your example syntax preceding the "derive:"; I would expect to see some kind of context.)
In practice there are rules/invariants and values/initializers.
You could therefore express your requirement as a class invariant that checks that what you want is true. A derived property rule is really just a class invariant where the constrained functionality is all about a single property.
The above is declarative rather than constructive. So potentially better for tooling is a derived initializer that enables the required value to be computed rather than just checked. Unfortunately this enters the area where the OCL specification is too vague and the UML specification is missing. My suggestions that the Property default value can also be a derived value _expression_ has not met with a great deal of enthusiasm. I think it is what the PIvot OCL tries to do. I'm not sure how friendly the Papyrus UI is. I doubt that another UML implementation would support it.
On 01/12/2017 11:12, GERARD Sebastien wrote:
Back to the top