Applying OCL on UML profiles [message #1754975] |
Fri, 24 February 2017 18:41 |
|
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 91 times)
Research Associate
Department of Computer Science
University of York
[Updated on: Fri, 24 February 2017 19:25] Report message to a moderator
|
|
|
|
|
|
|
Re: Applying OCL on UML profiles [message #1754995 is a reply to message #1754993] |
Sat, 25 February 2017 10:34 |
|
Hi Ed,
Thanks very much for your response. The new constraint is now working properly and I have rectified CheckMultiplicity with the same measure. Thanks again.
Cheers,
Will
Research Associate
Department of Computer Science
University of York
|
|
|
Powered by
FUDForum. Page generated in 0.04841 seconds