Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » ATL question(Unable to get the desired file)
ATL question [message #1845030] Mon, 04 October 2021 02:50
Yanhong Dong is currently offline Yanhong DongFriend
Messages: 25
Registered: September 2021
Junior Member
This is my ATL
module S2A;
create OUT : A from IN : S;

helper def : pa : String = S!packagedElement.name;
helper context S!element def : isBlock() : Boolean =
if self.name = thisModule.pa
then true
else
false
endif;
rule S2A{
from
s : S!Model
to
t : A!Model(
b <- s.packagedElement.packagedElement -> select(e | e.name = thisModule.pa),
c <- s.packagedElement.packagedElement -> select(e | e.name <> thisModule.pa)
)
}
rule E2B{
from
s : S!element(s.name = thisModule.pa)
to
t : A!B(
name <- s.name
)
}
rule E2C{
from
s : S!element(s.name <> thisModule.pa)
to
t : A!C(
name <- s.name
)
}
I want to get this file
<A:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:A="http://A/1.0">
<b name="aaaa"/>
<c name="bbbb"/>
</A:Model>

but I get this file
<A:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:A="http://A/1.0">
<c name="aaaa"/>
<c name="bbbb"/>
</A:Model>

I don't know why and how to solve it

  • Attachment: S.ecore
    (Size: 1.76KB, Downloaded 50 times)
  • Attachment: A.ecore
    (Size: 1.03KB, Downloaded 52 times)
  • Attachment: Model1.xmi
    (Size: 0.51KB, Downloaded 52 times)
Previous Topic:ATL String handling issues
Next Topic:ATL question
Goto Forum:
  


Current Time: Thu Mar 28 16:43:40 GMT 2024

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

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

Back to the top