|OCL Expression error in a constraint [message #522086]
||Fri, 19 March 2010 21:25
| Fernando Herrera
Registered: January 2010
Hi guys. I'm reading the book Eclipse Modeling Project of Gronback. In the gmfmap file, I add a constraint for one generalization link in the form of link constraint in the target end:|
(oppositeEnd <> self and not superclasses >includes(oppositeEnd) and
((oppositeEnd.oclIsTypeOf(dnc::Role) and self.oclIsTypeOf(dnc::Role))
(oppositeEnd.oclIsTypeOf(dnc::Party) and self.oclIsTypeOf(dnc::Party))
(oppositeEnd.oclIsTypeOf(dnc::Place) and self.oclIsTypeOf(dnc::Place))
(oppositeEnd.oclIsTypeOf(dnc::Thing) and self.oclIsTypeOf(dnc::Thing))
I dont' know much about OCL (I'm looking for a book now). When I try to create the genmodel one error appear and it show:"invalid expression" for this expression.
Role,Party,Place, Thing, Description are classes that inherits of Archetype. The book says: The Link Constraints provide some important functionality to our link and to the Practitioner's usability of our diagram. The first constraint allows only a generalization link to be drawn from an archetype that does not yet have a superclass. In this manner, we restrict the underlying metamodel to just one superclass. Also, we prohibit cyclic inheritance by applying a target end constraint that checks to see if the oppositeEnd of the link contains the source in its superclasses list. With that, we disallow generalization to one's self. Finally, we prevent generalization relationships between archetypes of different types. In this approach to domain modeling, generalization is rarely used, and it doesn't make
sense to inherit from one type of archetype to another.
Where is the mistake? Can somebody help me?. The ocl interpreter says
Unrecognized variable: (oppositeEnd)
the oppositeEnd has another name?
[Updated on: Fri, 19 March 2010 23:39]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.12226 seconds