Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » OCL cannot find feature in link target constraint body
OCL cannot find feature in link target constraint body [message #540300] Tue, 15 June 2010 14:53 Go to next message
Robert Wloch is currently offline Robert WlochFriend
Messages: 109
Registered: July 2009
Senior Member
Hi

I need some help using OCL in a GMF target link constraint following this guide here.

In my case I have an EClass "Type" with an EAttribute "interface". Another EClass "Class" inherites "Type" and provides an additional containment EReference "superTypes" (0..*).

Now, specifying "self.interface" in the body of my link target constraint does work fine. However, using "self.superTypes->isEmpty()" I get this error:
Invalid expression body 'if oppositeEnd.interface then
  self.interface
else
  not self.interface and self.superTypes.size() < 1
endif'. Cause: Unrecognized variable: (superTypes)

As I said, as soon as I remove " and self.superTypes.size() < 1" it is working and yes, I checked that my "Class" has a feature "superTypes".

Can anybody help me here?

Cheers
Rob
Re: OCL cannot find feature in link target constraint body [message #540483 is a reply to message #540300] Wed, 16 June 2010 10:56 Go to previous message
Robert Wloch is currently offline Robert WlochFriend
Messages: 109
Registered: July 2009
Senior Member
This solves my issue:

self.oclAsType(Class).superTypes->size()

Previous Topic:several mappings for single ecore class
Next Topic:Memory leak - Graphical shapes
Goto Forum:
  


Current Time: Sat Jul 27 05:04:24 GMT 2024

Powered by FUDForum. Page generated in 0.03460 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top