|Re: [ATL] Cross references [message #43023 is a reply to message #42988]
||Wed, 30 May 2007 07:40
| Dennis Wagelaar
Registered: July 2009
Cédric Vidal schreef:|
> I'm having a hard time getting an ATL transformation to work with a meta
> model which has cross references to another meta model. Is there an example
> illustrating that Use Case ? If not, could you please explain to me how to
> get the ATL transformation launcher to work with such a scenario or at least
> how to run it through the Java API ?
This problem has been addressed quite a while back for the EMF backend.
A typical example is that the UML2 meta-model references the Ecore
meta-model. When loading a meta-model, ATL traverses all meta-classes to
find external references, traverses those external references to find
more external references, etc. The result is the transitive closure of
referenced meta-classes from the main meta-model. The meta-models
containing those meta-classes are accessible from ATL.
This mechanism is hidden from the user in that only the starting
meta-model is specified. The user can just use the meta-classes from the
referenced meta-models. It is possible to specify packages when
referring to meta-classes, thus allowing the user to specify the exact
logical - not physical - location of a meta-class: e.g.
UML2!ecore::EAnnotation vs. UML2!uml::Element.
> Note that here, my problem is to get ATL to work with MM having cross
> references, but I'm equally interested in knowing how to get ATL to work
> with models which have cross references, both input and output models.
> Kind regards,
> Cédric Vidal
At the model level, things work differently. The user must have control
over the physical location of a model element. If a reference "type" of
a model element "attribute" is set to "ExternalType", which resides in
an external model, then that reference will be an inter-model reference.
However, if your model transformation transforms "ExternalType" into
"OutputType" for example, the "type" reference will point to
"OutputType" instead. Since the "OutputType" and "attribute" elements
are part of the same - output - model, the "type" reference will be a
normal, intra-model reference.
N.B. For inter-model references to work, you need to enable them in the
ATL launch configuration ("Run..." dialog).
|Re: [ATL] Cross references [message #45420 is a reply to message #43023]
||Sat, 09 June 2007 17:48
| CÃ©dric Vidal
Registered: July 2009
Thanx for your reply. I've managed to get MM cross references to work,
that's great. Now i'm trying to get model cross references to work :)
First of all, you mention that a model element "attribute" can be set to
"ExternalType", how do you do that ?
Secondly, I want my target model to reference elements from my input model,
how would I do that ? Since AMW is about model weaving and model cross
referencing, I had a look at the ATL2WTracer example where an ATL
transformation is enriched with tracing abilities, the trace enabled
transformation uses __xmiID__ to refer to input elements. Is it the only
way, isn't it possible to directly refer to input model elements so that
when I open the output model with for example the reflective model editor, I
can navigate to input model elements referenced by the output model elements
If I'm not clear, please tell, I'll try to be more specific, thanx for you
Powered by FUDForum
. Page generated in 0.02447 seconds