|Using OCL constraints in StateInvariant InteractionFragments? [message #1441219]
||Thu, 09 October 2014 12:10
| Klaas Gadeyne
Registered: July 2009
Hi all (and UML/OCL experts in particular |
In the attached papyrus project, I try to use an OCL expression [*] for specifying the constraint of a StateInvariant (InteractionFragment).
In casu, I want to express that the trace would be invalid if the class2 lifeline (of type 'Class2') was not in a particular state ('State1')
However, I noticed that, as soon as I specify that the 'context' of the IsOn Constraint is 'Class2' (necessary for being able to specify the OCL expression), the constraint is moved beneath 'Class2' instead (and the StateInvariant constraint is gone).
Looking at the UML spec (2.5 beta 2, figures 7.13 and 17.1), I think I might see the problem. Indeed:
- Figure 7.13 specifies the context of the constraint to be its (possible) owner
- Figure 17.1 specifies the StateInvariant to be its (possible) owner
Given the fact that (I think) an OCL constraint is useless without context, this would lead me to the thought that I _cannot use OCL constraints in StateInvariant InteractionFragments_, since that would imply 'double ownership'?
The other option of course is that this is a papyrus (or reasoning) problem after all, and that's why I wanted to check here first.
[*] The constraint's name is 'isOn', and can be found below 'Class2' in the model.
[Updated on: Thu, 09 October 2014 12:56]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01992 seconds