[ATL] Using two input models [message #104829] |
Mon, 11 May 2009 05:50  |
Eclipse User |
|
|
|
Hello,
I am creating a model transformation that takes two input models of
different metamodels ('slco' and 'channels'). The model adhering to the
'channels' metamodel is nothing more than a list of elements occurring in
the other one. It is called 'channels_in'.
Now I have a helper (shown at the bottom of this post) that accesses this
'channels_in' model and collects all items in this model as an OrderedSet.
I checked he 'Allow inter-model references' checkbox.
This works fine. I get a Sequence (even though I asked for an OrderedSet
to remove duplicates) that looks as follows:
Sequence {IN!Ch1}
'IN' is the model adhering to the 'slco' metamodel.
I then copied this helper to another transformation with the same input
and output signature, because I also need it there.
Howerve, now It doesn't work the way I want it. The result looks as
follows:
Sequence {Channels_in!Ch1}
As you can see, I get the elements from the wrong model.
What can be the cause of this and how can I solve it such that the helper
returns the model elements from the right model? Any help is much
appreciated!
Regards,
Marcel
The common part of the transformations:
create OUT: slco, Channels_out: channels from IN: slco, Channels_in:
channels;
helper def: channelList : OrderedSet(slco!Channel) =
channels!ChannelList.allInstancesFrom('Channels_in')->collect(i|i.Channel)- >flatten();
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04769 seconds