[ATL] one to one transformation mapping [message #479974] |
Thu, 13 August 2009 10:21 |
Eclipse User |
|
|
|
Originally posted by: crajiz3rc.gmail.com
Hi Everyone,
I am working on this simple transformation.
Source MetaModel: : SouMM
Entity 1: 'Participant'
Entity 2: 'Port'
Link :'services'
Port is contained in Participant through the services link
Target MetaModel: TarMM
Entity 1: 'Component'
Entity 2: 'Implentation'
Link :'implements'
Implementation is contained in Component through the implements link
I want to transform : Participant to Component, Port to Implementation,
services to implements
I wrote the following grammar rule:
module SouMMtoTarMM; -- Module Template
create OUT : TarMM from IN : SouMM;
rule Participant2Component{
from
p: SouMM!Participant
to
c: TarMM!Component (name<-p.name,implements<-p.services)
}
rule Port2Implementation{
from
s:SouMM!Port
to
i:TarMM!Implementation(name<-s.name)
}
but it is not working. Please can anyone tell me how this one to one
transformation can be done.
Thanking you very much
Best Regards,
Rajalaxmi
|
|
|
|
Re: [ATL] one to one transformation mapping [message #480053 is a reply to message #480006] |
Thu, 13 August 2009 15:21 |
Eclipse User |
|
|
|
Originally posted by: crajiz3rc.gmail.com
Hi Freddy,
Thank you very much for responding.
The output i get is,
the target model is created and it contains the Component Entity along
with the participant's name.
The Implementation Entity is not created.
I think there is a problem with the link.
In the console it says that the Component.Implements can not take the
value assigned.
When i change the rule to :
module SouMMtoTarMM; -- Module Template
create OUT : TarMM from IN : SouMM;
rule Participant2Component{
from p: SouMM!Participant
to
c: TarMM!Component (name<-p.name,implements<-t)
t: TarMM!Implementation (name<-p.name)
}
The target model contains Component along with Implementation. But both of
them have Participant's name as their name. I would like Implementation to
have the name of the Port found in the Source Model.
Please tell me what changes i have to do,
Thank you for helping me,
Best Regards
Rajalaxmi
|
|
|
Powered by
FUDForum. Page generated in 0.03130 seconds