ATL : multiple target from one source object [message #1775154] |
Wed, 25 October 2017 09:07  |
Eclipse User |
|
|
|
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 #1776028 is a reply to message #1775967] |
Thu, 09 November 2017 08:25  |
Eclipse User |
|
|
|
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 08:42] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04298 seconds