Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] get referencing objects to self
[Acceleo] get referencing objects to self [message #677392] Wed, 08 June 2011 11:42 Go to next message
the_ch40s is currently offline the_ch40sFriend
Messages: 14
Registered: April 2011
Junior Member
Hello,
i have the following problem:
In the model that is passed to me, there are two classes (just for this example):
"Implementation" and "Entity",
An implementation references to the entity it implements. On the other hand, the entity does not know its implementations.
My template generates for entities, but now i want to list all implementations of an entity. So my question is if there is a way to get all objects, that are referencing to an entity object. "Implementation" and "Entity" do not share a root, and changing the model is out of the question unfortunately.

Thanks for any help Smile

[Updated on: Wed, 08 June 2011 11:42]

Report message to a moderator

Re: [Acceleo] get referencing objects to self [message #677443 is a reply to message #677392] Wed, 08 June 2011 14:40 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

That is the role of the eInverse operation : [entity.eInverse()/] will print out all objects referencing 'entity'. [entity.eInverse(Implementation)/] will print out all objects of type "Implementation" referencing entity.

Laurent Goubet
Obeo
Re: [Acceleo] get referencing objects to self [message #677464 is a reply to message #677443] Wed, 08 June 2011 15:26 Go to previous message
the_ch40s is currently offline the_ch40sFriend
Messages: 14
Registered: April 2011
Junior Member
!!!!!!
OMG

Thanks a lot Smile
I feel so incredibly dumb not reading through the operations reference :\
I'm a total noob to java/eclipse/acceleo and i just ended up writing a class that iterates over a resource passed by an acceleo invoke, finding implementations referencing to entities and returning them Very Happy

I guess i deserve the punishment of having lost two hours^^ (although i learned quite a bit)


Again, thanks Smile

[Updated on: Wed, 08 June 2011 15:26]

Report message to a moderator

Previous Topic:[Acceleo] creating something similar to a JET custom tag with acceleo
Next Topic:[Acceleo] failed to convert MT to MTL project
Goto Forum:
  


Current Time: Thu Apr 25 11:22:03 GMT 2024

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

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

Back to the top