Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Two input models with cross references into one output model
[ATL] Two input models with cross references into one output model [message #626283] Wed, 22 September 2010 13:15
Thomas is currently offline ThomasFriend
Messages: 151
Registered: July 2009
Senior Member
Hi everybody,

I have two input model referring to the same Metamodel (MM_A). One of the
models(M_A1) references an element from the other input model(M_A2) which
means I have an inter-model dependency here. Now I want to transform the
model M_A1 into an output model M_B1 referring to another meta model (MM_B).
All the references of M_A1 should be transformed to elements of MM_B. This
means I would end up with a model without inter model dependencies.

The problem now is that my matched rules are not called for the referenced
elements from M_A2. This is shown in the example below. In model M_A1 I have
Parent and Child elements which are all part of MM_A. One of the childs has
a Child which comes from M_A2. For those elements the rule
MM_A_Child2MM_B_Child is not called. The runtime tries to insert the element
directly to M_B1 which would lead to a inter model reference in the output
model. If I copy the rule MM_A_Child2MM_B_Child and turn it into a lazy rule
and call it directly on the elements of M_A2 everything works. Unfortunately
this leads to redundant code I do not want to have. Is there any solution
for that?

The same setup has been discussed here[1] already but with no reference to a
solution.

Thanks and regards,
Panajotes.

rule MM_A_Parent2MM_B_Parent {
from
i : MM_A!Parent
to
o : MM_B!Parent (
hasChild<- i.childs,
hasChild<- i.childs -> collect(c|c.childs) -- the childs here are
elements from M_A2 but also refer to MM_A!Child
)
}

rule MM_A_Child2MM_B_Child {
from
i : MM_A!Child
to
o : MM_B!Child ()
}

[1] http://www.eclipse.org/forums/index.php?t=msg&goto=42988 &
Previous Topic:[ATL] Lazy rules and multiple instantiations
Next Topic:[QVTo] How to correctly reference other qvto files in an import
Goto Forum:
  


Current Time: Tue Jun 25 23:36:19 GMT 2019

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

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

Back to the top