Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » ATL : multiple target from one source object
ATL : multiple target from one source object [message #1775154] Wed, 25 October 2017 13:07 Go to next message
zz lalou is currently offline zz lalouFriend
Messages: 17
Registered: April 2011
Junior Member
Hi,
I have some high-level actions that I must transform them to low-level ones (System calls).
One high-level action must be transformed into one or many system calls. For example, the high-level send must be transformed into the low levels system calls send, sendto end sendmsg.
Share is a system call, so, in my meta-model, it inherits from system call meta-classe.

rule Action2SystemCall{
from
Act : MM!Action
to
Sys : MM1!SystemCall()
}

rule Share2lowLevelSysCall {
from
Shr1 : MM!Share
to
Cnt1 : MM1!Sendto(),

Cnt2 :MM1!Send(),

Cnt3 :MM1!Sendmsg()
}


The problem is that the generated model is as follow :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:target="www.target.com">
<target:PolicySet id="1">
<policy id="1">
<effect/>
<systemcall/>
</policy>
</target:PolicySet>
<target:Sendto/>
<target:Send/>
<target:Sendmsg/>
</xmi:XMI>

although the generated model must be like this
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:target="www.target.com">
<target:PolicySet id="1">
<policy id="1">
<effect/>
<systemcall xsi:type="target:Send"/>
<systemcall xsi:type="target:Sendto"/>
<systemcall xsi:type="target:Sendmsg"/>
</policy>
</target:PolicySet>
</xmi:XMI>
can anyone help me ?
Re: ATL : multiple target from one source object [message #1775327 is a reply to message #1775154] Fri, 27 October 2017 16:30 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 555
Registered: July 2009
Senior Member
See the documentation
Re: ATL : multiple target from one source object [message #1775856 is a reply to message #1775327] Tue, 07 November 2017 10:17 Go to previous messageGo to next message
zz lalou is currently offline zz lalouFriend
Messages: 17
Registered: April 2011
Junior Member
Thank you for reply, but my problem still unsolved,
I don't understand how this function can help me.
Please help, I'm stuck-up
Re: ATL : multiple target from one source object [message #1775953 is a reply to message #1775856] Wed, 08 November 2017 14:42 Go to previous messageGo to next message
zz lalou is currently offline zz lalouFriend
Messages: 17
Registered: April 2011
Junior Member
I tried to do :

rule Policy2Policy {
from
Pol : MM!Policy
to
Poli : MM1!Policy (
systemcall <- Pol.action,
effect <- Pol.effect
)
}

rule Share2lowLevelSysCall {
from
Shr1 : MM!Share
to
Cnt1 : MM1!Sendto(),

Cnt2 :MM1!Send(),

Cnt3 :MM1!Sendmsg()
}

but only one system call is considered, the other are outside the policy tag

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:target="www.target.com">
<target:PolicySet id="1">
<policy id="1">
<effect effectValue="Allow"/>
<systemcall xsi:type="target:Send"/>
</policy>
</target:PolicySet>
<target:Sendto/>
<target:Sendmsg/>

knowing that I need that all system call are in the pilicy tag like this

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:target="www.target.com">
<target:PolicySet id="1">
<policy id="1">
<effect effectValue="Allow"/>
<systemcall xsi:type="target:Send"/>
<systemcall xsi:type="target:Sendto"/>
<systemcall xsi:type="target:Sendmsg"/>
</policy>
</target:PolicySet>

Can any one help me

[Updated on: Wed, 08 November 2017 14:43]

Report message to a moderator

Re: ATL : multiple target from one source object [message #1775967 is a reply to message #1775953] Wed, 08 November 2017 16:17 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 372
Registered: September 2012
Location: Belgium
Senior Member

Only the first output element is inserted by default. The other output elements must be retrieved via thisModule.resolveTemp() (see link to manual above). You can then assign a Sequence{} of the three output elements to the systemcall property.

Cheers,
Dennis
Re: ATL : multiple target from one source object [message #1776028 is a reply to message #1775967] Thu, 09 November 2017 13:25 Go to previous message
zz lalou is currently offline zz lalouFriend
Messages: 17
Registered: April 2011
Junior Member
Thank you Dennis, I tried the methode resolveTemp(). It works very well when my source model contains only one policy. The ATL code is in the following:
rule Policy2Policy {
from
Pol : MM!Policy
to
Poli : MM1!Policy (
systemcall <- MM!Action.allInstances()->collect(e | thisModule.resolveTemp(e,'Cnt1')),
systemcall <- MM!Action.allInstances()->collect(e | thisModule.resolveTemp(e,'Cnt2')),
systemcall <- MM!Action.allInstances()->collect(e | thisModule.resolveTemp(e,'Cnt3')),
effect <- Pol.effect
)
}

But when I tried to insert another policy, the new policy get all the system call (x2) and the first policy does not contain any system call :

<?xml version="1.0" encoding="ISO-8859-1"?>
<target:PolicySet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:target="www.target.com" id="1">
<policy id="1">
<effect effectValue="Allow"/>
</policy>
<policy id="3">
<effect effectValue="Allow"/>
<systemcall xsi:type="target:Send"/>
<systemcall xsi:type="target:Send"/>
<systemcall xsi:type="target:Sendto"/>
<systemcall xsi:type="target:Sendto"/>
<systemcall xsi:type="target:Sendmsg"/>
<systemcall xsi:type="target:Sendmsg"/>
</policy>
</target:PolicySet>

anyone have idea how to solve this problem

[Updated on: Thu, 09 November 2017 13:42]

Report message to a moderator

Previous Topic:Manage custome UML stereotypes out of Eclipse in ATL transformations
Next Topic:Need some suggestions about models to transform
Goto Forum:
  


Current Time: Fri Sep 21 16:22:05 GMT 2018

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

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

Back to the top