Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Getting value from a reference
Getting value from a reference [message #1598] Mon, 18 December 2006 20:44 Go to next message
Eclipse UserFriend
Originally posted by: dorazio.nicola.yahoo.it

Hi all,
I have this km3 classes:

class ServiceCall extends Activity {
reference calledService[0-1] : Service oppositeOf serviceCall;
}


class State {
attribute name[0-1] : String;
attribute refersTo: String;
}

now I need to modify this rule:

rule activity2state
{
from
astep: Klaper!Activity (astep.internalFailProb='0')
using{
list: Sequence(Klaper!Behavior) = astep.getSCBehaviorType();
}
to
state: DTMP!State (name<-astep.name,
refersTo<-'TEST',
dtmp<-thisModule.resolveTemp(astep.behavior,
'dtmp'),
}


because I want to write inside the refersTo variable the value of the
reference calledService. How can I do this?

Thanks to all

Best regard

Nicola D'Orazio
Re: [ATL] Getting value from a reference [message #4505 is a reply to message #1598] Fri, 29 December 2006 08:40 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,

Since your rule transforms an Activity and not a ServiceCall, you cannot
do astep.calledService. You should do this in a rule matching a ServiceCall.

If you use ATL 2006 (see http://wiki.eclipse.org/index.php/ATL_2006),
then you can use rule inheritance:

rule ServiceCAll2State extends activity2state {
from
astep : Klaper!ServiceCall
to
state: DTMP!State (
refersTo<- astep.calledService
)
}

If you do not want to use ATL 2006 or rule inheritance, then you will
have to modify your rule after having copied and pasted it if you want
to keep a rule matching activities.


Regards,

Frédéric Jouault

Nicola D'Orazio wrote:
> Hi all,
> I have this km3 classes:
>
> class ServiceCall extends Activity {
> reference calledService[0-1] : Service oppositeOf serviceCall;
> }
>
>
> class State {
> attribute name[0-1] : String;
> attribute refersTo: String;
> }
>
> now I need to modify this rule:
>
> rule activity2state
> {
> from
> astep: Klaper!Activity (astep.internalFailProb='0')
> using{
> list: Sequence(Klaper!Behavior) = astep.getSCBehaviorType();
> }
> to
> state: DTMP!State (name<-astep.name,
> refersTo<-'TEST',
> dtmp<-thisModule.resolveTemp(astep.behavior,
> 'dtmp'),
> }
>
>
> because I want to write inside the refersTo variable the value of the
> reference calledService. How can I do this?
>
> Thanks to all
>
> Best regard
>
> Nicola D'Orazio
Previous Topic:[ATL] problem at launching ATL
Next Topic:[ATL] multiple references to an unique target model element
Goto Forum:
  


Current Time: Mon Aug 19 02:11:27 GMT 2024

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

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

Back to the top