Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » ATL: Navigating between model elements
ATL: Navigating between model elements [message #17627] Wed, 21 February 2007 14:01 Go to next message
Eclipse UserFriend
Originally posted by: paul.gribben.gmail.com

Hello,

I'm using ATL2006 with Eclipse 3.2.1. Is it possible in ATL to navigate
from a model element to that element's parent. The element in question is
an EAttribute in an ecore metamodel, and I want a reference to its
containing EClass, but is has no direct reference to its parent.

I've read through the ATL User Guide and some ATL examples but didn't find
anything useful.

Thanks
Re: ATL: Navigating between model elements [message #17654 is a reply to message #17627] Wed, 21 February 2007 14:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: paul.gribben.gmail.com

I can answer my own question: The OclAny operation refImmediateComposite()
gives a ref to the immediate container
Re: ATL: Navigating between model elements [message #17667 is a reply to message #17654] Wed, 21 February 2007 18:51 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,

You can indeed use refImmediateComposite(), which returns the immediate
container of the element on which it is called.

Another possibility is to use a reference defined in the metamodel, when
it exists. In your case, this reference is eContainingClass, defined on
EStructuralFeature (EAttribute extends EStructuralFeature).

The following page has a visual representation of Ecore, in which you
can see the eContainingClass reference:
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. emf.doc/references/javadoc/org/eclipse/emf/ecore/package-sum mary.html


Regards,

Frédéric Jouault

Paul Gribben wrote:
> I can answer my own question: The OclAny operation
> refImmediateComposite() gives a ref to the immediate container
>
Re: ATL: Navigating between model elements [message #17705 is a reply to message #17667] Thu, 22 February 2007 16:30 Go to previous message
Eclipse UserFriend
Originally posted by: paul.gribben.gmail.com

Thanks for that additional information - very useful.
Previous Topic:[ATL] New ATL use case: Web Syndication Interoperability (RSS and Atom)
Next Topic:[ATL] Safety of Model Transformations
Goto Forum:
  


Current Time: Fri Mar 29 09:14:39 GMT 2024

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

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

Back to the top