[ATL]missing elements in the output file [message #490118] |
Wed, 07 October 2009 12:41  |
Eclipse User |
|
|
|
Hi all,
I am browsing google and this forum for a few days but i cannot figure out how to tackle with my problem.
Seems like ATL engine only saves level 0 and 1 of my hierarchy: I have element A that contains B that contains C but my output file only shows A that contains B.
But when I debug my source with thisModule.debug('') in the atl file, I see in the console that before to be saved in the output file, my model is OK with A containing B containing C.
I am using ATL3.0, my metamodels are ecore files and i call programmatically my translation using the AtlEMFModelHandler class.
Did I do a newbie error? Did I miss some configuration?
Thanks for any help.
Arnaud Schach.
|
|
|
Re: [ATL]missing elements in the output file [message #490261 is a reply to message #490118] |
Thu, 08 October 2009 07:01   |
Eclipse User |
|
|
|
Hi again,
still do not have any idea to solve my problem.
I get the same result when launching directly my atl file.
Here are my files:
ATL:
====
module Marte2AADL; -- Module Template
create OUT : aadl2 from IN : mergedMarteModel;
helper context mergedMarteModel!Package def : getDefNameSet() : Set(String) =
self.packagedElement->collect(e|e.name).asSet();
rule modelTransfo {
from
s : mergedMarteModel!Package (
s.oclIsTypeOf(mergedMarteModel!Model)
)
to
t : aadl2!AadlPackage (
name <- s.name,
ownedPublicSection <- pblSec,
ownedPrivateSection <- prvSec
),
pblSec : aadl2!PublicPackageSection (
name <- 'public',
noAnnexes <- true,
ownedDeviceType <-s.packagedElement->collect(ss | thisModule.devices(ss))
),
prvSec : aadl2!PrivatePackageSection (
name <- 'private'
)
do {
thisModule.debug('step1');
for (i in t.ownedPublicSection.ownedDeviceType) {
thisModule.debug('step1.1 '+i.name);
for (j in i.ownedDataPort) {
thisModule.debug('step1.2 '+j.name);
}
}
}
}
lazy rule devices {
from
ss : mergedMarteModel!Component
to
tt : aadl2!DeviceType (
name <- ss.name,
ownedDataPort <-ss.packagedElement->collect(e | thisModule.devicesDataPorts(e))
)
do {
thisModule.debug('step2 '+ss.name);
}
}
lazy rule devicesDataPorts {
from
ss : mergedMarteModel!Component
to
tt : aadl2!DataPort (
name <- ss.name
)
do {
thisModule.debug('step3 '+ss.name);
}
}
The input file:
===============
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:hwMemory="hwMemory"
xmlns:hwDevice="hwDevice"
xmlns:swConcurrency="swConcurrency"
xmlns:uml="uml">
<uml:Model xmi:id="_D5Yrd7GFEd6ODMAg_VgbRQ" name="testPackage">
<packagedElement xmi:type="uml:Component" xmi:id="_XP07gLGFEd6ODMAg_VgbRQ" name="comp1">
<packagedElement xmi:type="uml:Component" xmi:id="_XP07gLGFEd6ODMAg_VgbR7" name="port1"/>
</packagedElement>
<packagedElement xmi:type="uml:Component" xmi:id="_XP07gLGFEd6ODMAg_VgbR7" name="comp2"/>
</uml:Model>
</xmi:XMI>
the output file:
================
<?xml version="1.0" encoding="ISO-8859-1"?>
<aadl2:AadlPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:aadl2="http:///AADL2" name="testPackage">
<ownedPublicSection name="public" noAnnexes="true"/>
<ownedPrivateSection name="private"/>
</aadl2:AadlPackage>
the console output:
===================
step3 port1: thisModule
step2 comp1: thisModule
step2 comp2: thisModule
step1: thisModule
step1.1 comp1: thisModule
step1.2 port1: thisModule
step1.1 comp2: thisModule
Thanks for any help,
Arnaud Schach.
|
|
|
Re: [ATL]missing elements in the output file [message #490293 is a reply to message #490261] |
Thu, 08 October 2009 09:20  |
Eclipse User |
|
|
|
Ok, I finally manage to solve my problem.
Does not come from the ATL rules but from the targeted metamodel.
The "ownedDeviceType" relation was transient in the ecore model. Setting it to false solve the problem.
Hope it could help somebody not becoming crazy
Arnaud Schach.
|
|
|
Powered by
FUDForum. Page generated in 0.04013 seconds