[ATL] Creating N copies of a model element and keeping references intact [message #498292] |
Mon, 16 November 2009 06:54 |
Eclipse User |
|
|
|
Consider the following metamodel:

The fact that C can be contained in both A and B is irrelevant for the question. Assume all C's are contained in B's.
I want to create multiple copies of B's.
When an element B is copied (with lazy rule copyB), all contained D's should be copied as well (with lazy rule copyD).
All contained C's should be copied as well (with unique lazy rule copyC).
Rule copyC is unique because it needs to be called twice, once from copyB to get the containment right and once from copyD to get the reference right.
The reference of the copied D should refer to the copied C.
This works fine with one copy.
For two (or more) copies of element B, this goes wrong.
The contained C's are copied only once.
This makes sense, since copyC is a unique lazy rule that is called with the same source model element.
This is not what I want.
Also the C's should be copied multiple times and the references to D should remain intact.
Does anybody have a suggestion on how to solve this?
|
|
|
Powered by
FUDForum. Page generated in 0.03464 seconds