Hi,
This issue is probably related to the following post:
http://www.eclipse.org/newsportal/article.php?id=186&group=eclipse.modeling.gmt.amw#186
When you set up the XMI:IDs, it takes the current value of the element C
in the output model. But, if the C element is not yet assigned to a
parent table, you can have an id similar to "//@columns.3". This value
changes when the parent table of the column is set up. However, the
"ref" has already the wrong value.
There are two alternatives:
- Split the transformation into 2 transformations. The first one only
produces A and C. The second one takes as input B and C and it creates
W. This is the most elegant solution, since you avoid reading values
from the output models.
- The "ref" value should be set up only when all the elements of the
output models are already produced.
Regards,
Marcos.
Brice Pajot wrote:
Hi,
I try to use ATL to perform such kind of transformation:
Input model : A
Output models : B, W, C
where B and C are "linked" by the weaving model (for further
information, B is a class metamodel with attribute elements, and C is
a table with column elements, W is linking attributes to elements).
Currently, I set the B.attributes and C.columns refs with target
__xmiID__. However, whereas it was working perfectly, it began to fail
when I modified the C meta-model (I just added a composite link on the
column element), and thus the ATL transformation respectively. Failure
is identified with broken links in the weaving navigator. When I look
at the file in text mode, the references are indeed not uniform
regarding the C elements (table columns).
To illustrate the problem, here are the links before the changing of
the C model:
<rightModel xsi:type="ModelRefXMI" name="Data Table"
ref="/FirstExample/SVF/Models/DataTable.ecore">
<ownedElementRef xsi:type="ElementRefXMI" ref="/0/@columns.0"/>
<ownedElementRef xsi:type="ElementRefXMI" ref="/0/@columns.1"/>
<ownedElementRef xsi:type="ElementRefXMI" ref="/0/@columns.2"/>
<ownedElementRef xsi:type="ElementRefXMI" ref="/0/@columns.3"/>
</rightModel>
and after:
<rightModel xsi:type="ModelRefXMI" name="Data Table"
ref="/FirstExample/SVF/Models/DataTable.ecore">
<ownedElementRef xsi:type="ElementRefXMI" ref="/0/@columns.0"/>
<ownedElementRef xsi:type="ElementRefXMI" ref="/0/@columns.1"/>
<ownedElementRef xsi:type="ElementRefXMI" ref="/0/@columns.2"/>
<ownedElementRef xsi:type="ElementRefXMI" ref="//@columns.3"/>
</rightModel>
I do not understand the problem. I also tried to set the __xmiID__: If
I set it manually (for example, by setting it with the related input
__xmiID__), the weaving model does work in the navigator. But this is
of course not a solution! I also tried to use the
setElementIDbyRefType, but without any success (maybe I do not use it
in the correct manner?).
Have someone any idea of the problem? I'm certainly doing something
wrong but I can't figure out the problem.
Brice.