Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Cross references
[ATL] Cross references [message #42988] Tue, 29 May 2007 18:43 Go to next message
Cédric Vidal is currently offline Cédric Vidal
Messages: 101
Registered: July 2009
Senior Member
Hello,

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 ?

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
Re: [ATL] Cross references [message #43023 is a reply to message #42988] Wed, 30 May 2007 03:40 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 147
Registered: July 2009
Senior Member
Cédric Vidal schreef:
> Hello,
>
> 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).

Kind regards,
Dennis
Re: [ATL] Cross references [message #45420 is a reply to message #43023] Sat, 09 June 2007 13:48 Go to previous messageGo to next message
Cédric Vidal is currently offline Cédric Vidal
Messages: 101
Registered: July 2009
Senior Member
Hi Dennis,

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
help.

Kind regards,

C
Re: [ATL] Cross references [message #45449 is a reply to message #45420] Sat, 09 June 2007 14:55 Go to previous message
Cédric Vidal is currently offline Cédric Vidal
Messages: 101
Registered: July 2009
Senior Member
OK, I managed to find out myself, somebody actually already asked the
question in this list ^^

The solution is described in Fr
Previous Topic:[ATL] New ATL use case: Verifying UML profiled models
Next Topic:[ATL] conflict between metamodel and MOF
Goto Forum:
  


Current Time: Thu Aug 21 22:15:01 EDT 2014

Powered by FUDForum. Page generated in 0.02762 seconds