Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Using two input models
[ATL] Using two input models [message #104829] Mon, 11 May 2009 09:50 Go to next message
Marcel  is currently offline Marcel Friend
Messages: 54
Registered: July 2009
Member
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();
Re: [ATL] Using two input models - some more symptoms [message #104909 is a reply to message #104829] Mon, 11 May 2009 11:10 Go to previous messageGo to next message
Marcel  is currently offline Marcel Friend
Messages: 54
Registered: July 2009
Member
In the first transformation (the correctly working one), I use a hand-made
model 'channels_in'. In the second one, I use an ATL generated one.

When I look at these text files, there is a difference in the path to the
element:

First:
<Channel href="Test.slco#//@channels.0"/>
Second:
<Channel href="/SLCO Sync2ASync/Test_out.slco#//@channels.0"/>

When I manually remove the '/SLCO Sync2ASync/' part, the second
transformation also works.
Re: [ATL] Using two input models - some more symptoms [message #104979 is a reply to message #104909] Thu, 14 May 2009 07:13 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Marcel a écrit :
> In the first transformation (the correctly working one), I use a
> hand-made model 'channels_in'. In the second one, I use an ATL generated
> one.
>
> When I look at these text files, there is a difference in the path to
> the element:
>
> First:
> <Channel href="Test.slco#//@channels.0"/>
> Second:
> <Channel href="/SLCO Sync2ASync/Test_out.slco#//@channels.0"/>
>
> When I manually remove the '/SLCO Sync2ASync/' part, the second
> transformation also works.
>
>
>
>
>
may be the space between "SLCO" and "Sync" couild be the problem. Use
names with no space or special characters.

--
Cordialement

Vincent MAHÉ

Ingénieur Expert
IRISA-INRIA, Campus de Beaulieu, 35042 Rennes cedex, France
Tél: +33 (0) 2 99 84 71 00, Fax: +33 (0) 2 99 84 71 71
Re: [ATL] Using two input models - Solved [message #104982 is a reply to message #104979] Thu, 14 May 2009 12:53 Go to previous message
Marcel  is currently offline Marcel Friend
Messages: 54
Registered: July 2009
Member
The spaces were indeed the problem.
I removed them and everything works fine now.

Thanks a lot!
Previous Topic:[ATL] Multiple output models with the same metamodel, possible?
Next Topic:Match rule (assigning the default target element of another rule)
Goto Forum:
  


Current Time: Thu Dec 26 18:08:37 GMT 2024

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

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

Back to the top