Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Problem in Transformation ATL (Root Element)
[ATL] Problem in Transformation ATL (Root Element) [message #74258] Mon, 04 February 2008 20:44
Eclipse UserFriend
Originally posted by: analuisafdm.gmail.com

Hi,

I have in my project ATL this "helper context", that I have a tree
elements...and a initial xml file

But in my helper context i would like restricting that the tree only
return children that root (father element) is a um determinate element X,
for example. So, I donŽt know how I canŽt doing this. How can I do to
restrict this in my helper context?

-------------------------------

My helper context:

helper context AOVgraph!Component def : getAllChildren () :
OrderedSet(AOVgraph!Component) =
self.component->iterate( child ; components : OrderedSet(AOVgraph!Component)
=
OrderedSet{} |
if child.oclIsTypeOf(AOVgraph!Component) then
components.union(child.getAllChildren()) -- NODE : recursive call
else
components.append(child)
endif
);
-------------------------------
My XML is:

<?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="AOVgraph" name="aspect_oriented_model">
<Task name="Persistence" contribution_label="and">
<component xsi:type="Task" name="Persistence in [DB]"
contribution_label="and">
<component xsi:type="Task" name="Persistence in [Microsoft Access]2"
contribution_label="or" />
<component xsi:type="Task" name="Persistence in [Microsoft Access] 3"
contribution_label="or" />
<component xsi:type="Task" name="Persistence in [Microsoft Access] 3"
contribution_label="or" />
<component xsi:type="Goal" name="Persistence in [DB]2"
contribution_label="and">
<component xsi:type="Task" name="Persistence in [Microsoft Access]2"
contribution_label="or" />
<component xsi:type="Task" name="Persistence in [Microsoft Access] 3"
contribution_label="or" />
<component xsi:type="Task" name="Persistence in [Microsoft Access] 3"
contribution_label="or" />
</component>
</component>
</Task>
<CrosscuttingRel>
<source xsi:type="Task" name="TestComponente" />
<advice type="before">
---> <body xsi:type="Task" name="PORTA 1" />
---> <body xsi:type="Task" name="PORTA 3" />
</advice>
<advice type="before">
---> <body xsi:type="Task" name="PORTA 1" />
---> <body xsi:type="Task" name="PORTA 3" />
</advice>
</CrosscuttingRel>
<CrosscuttingRel>
<source xsi:type="Task" name="TestComponente 2" />
<advice type="before">
<body xsi:type="Task" name="PORTA 2" />
</advice>>
</CrosscuttingRel>
</xmi:XMI>
Previous Topic:[QVTO] Loading non-registered metamodels
Next Topic:[ATL] Problems using UML2 models
Goto Forum:
  


Current Time: Sun Apr 11 02:35:39 GMT 2021

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

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

Back to the top