OCL constraints on dependency Metaclass and enumeration issues [message #1772618] |
Wed, 13 September 2017 03:51  |
Eclipse User |
|
|
|
Dear all,
I'm trying to create a UML profile that consist of several stereotypes that extends the class Metaclass and other stereotypes that extends the dependency Metaclass.
I have several issues I couldn't solve since I'm new to OCL.
1- when I try to define a constrint on an enumeration literal value I get an error.
For example, one of my stereotypes has a property SS of type enumeration that can be eaither S1 or S2, when I use the following contraint "self.SS = SS::S1" or "self.SS = SS::S2" and I apply the profile to some model, I get this error
Severity Description Element Parent Type
Error The 'Constraint' invariant is violated on '«Hazard»RootElement::accident' <<Hazard>> <Class> accident null EMF Problem
Note that when the value should be S1/S2 it is S1/S2 in the model that I apply the profile to. Apparently, there is a problem in recognising the value of SS. Any idea how such thing can be solved?
2- the second problem, I need to define a constraint that checks if there is a specific dependency from a class to another one. In other words, if I have a class A and B, I need to know if there is a dependency relation of type X between them. And I think this should done from the class perspective
I have defined a constraint that limit the client and supplier of a dependency to specific classes but I wasn't able to do the same from the perspective of a class. Any ideas?
Best regards
|
|
|
|
Re: OCL constraints on dependency Metaclass and enumeration issues [message #1772625 is a reply to message #1772623] |
Wed, 13 September 2017 04:33   |
Eclipse User |
|
|
|
Hi Ed,
Thanks for the fast response. I'm using Luna SR 2 (4.4.2), but the same problem appears in Kepler, Neon, and Oxygen. Also I tried a Papyrus standalone platform. Anyway, as far as I understood, Luna is better than the rest that is why I'm using it.
I need to ask you, are you aware of a good documentation, manual, etc. that can help me with a bit complex OCL constraints. I was not able to find any so far.
Best regards
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04305 seconds