Applying OCL on UML profiles [message #1754975] |
Fri, 24 February 2017 13:41  |
Eclipse User |
|
|
|
Hello there,
I am creating an UML profile at the moment, I use Stereotypes that extend Association to describe relationships between entities. I have provided a minimal example. In this example, I create Stereotypes Flowchart and Node that extend Class. I then created a Stereotype that extends Association named 'nodes' to describe the relationship between Flowchart and Node.
I then applied 3 OCL constraints on Stereotype 'nodes':
1. CheckEndTypes which checks that the end types are of type Flowchart and Node.
2. CheckAggregation which checks that it should be composition from Flowchart to Node.
3. CheckMultiplicity which checks that the multiplicity from Flowchart to Node should be 0..*
These constraints used to work on the example model that I provided this morning. But now the constraints 2 and 3 are violated. I have looked into the cause and it appears that the association memberEnds are of type Class (let's assume they are A and B, and A represents Stereotype Flowchart and B represents Stereotype Node), I found out that the memberEnd A (of type UML::Property) can refer to its class (by calling A.class). However, memberEnd B cannot refer to its class, when i tried B.class it returns null.
Could you please advise what could possibly go wrong?
Cheers,
Will
Attachment: example.zip
(Size: 10.01KB, Downloaded 116 times)
[Updated on: Fri, 24 February 2017 14:25] by Moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05489 seconds