Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Issue when helper does not match equivalent elements
Issue when helper does not match equivalent elements [message #1220705] Fri, 13 December 2013 03:30 Go to next message
Ronan B is currently offline Ronan B
Messages: 229
Registered: July 2009
Senior Member
Hi,
I have the following helper which is called from both lazy and matched rules. I have noticed that it always returns the empty OrderedSet{}. The elements returned by the getConstrainedElements() do have equivalents as getPoints() is called on every element in the model.

helper def : getPoints(element : UML!Element) : OrderedSet(UML!Constraint) =
if(thisModule.isDM())
then
OrderedSet{}
else
UML!Constraint.allInstances()->select(e|e.getConstrainedElements()->collect(f|f.getUniqueElementEncoding)->flatten()->includes(element.getUniqueElementEncoding) )
endif;

The UML API is fine but ATL does not match the elements as it thinks they are not the same. If I look at their XMI ID in ATL they also do not match as the element passed in has a unique ID every time instead of the one that it really has in the underlying .uml file. Is there a way of performing such matches correctly?

Regards,
Ronan
Re: Issue when helper does not match equivalent elements [message #1220769 is a reply to message #1220705] Fri, 13 December 2013 08:53 Go to previous messageGo to next message
Ronan B is currently offline Ronan B
Messages: 229
Registered: July 2009
Senior Member
Hi,
Sorry the code should be a bit simpler to reveal the issue...

helper def : getPoints(element : UML!Element) : OrderedSet(UML!Constraint) =
if(thisModule.isDM())
then
OrderedSet{}
else
UML!Constraint.allInstances()->select(e|e.getConstrainedElements()->includes(element))
endif;

The UML!Constraint.allInstances()->select(e|e.getConstrainedElements()->includes(element))
never finds a match.

Regards,
Ronan
Re: Issue when helper does not match equivalent elements [message #1227033 is a reply to message #1220769] Fri, 03 January 2014 05:42 Go to previous message
Ronan B is currently offline Ronan B
Messages: 229
Registered: July 2009
Senior Member
Hi,
Does anyone have any insights into this issue?
Regards,
Ronan
Previous Topic:Is there a way to stop a running ATL transformation {and, or} return something to the launcher?
Next Topic:How to create a UML!Type entity and access XSD elements inside WSDLfile
Goto Forum:
  


Current Time: Sat Apr 19 23:13:56 EDT 2014

Powered by FUDForum. Page generated in 0.01836 seconds