Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Difference ANT script <->Run configuration
[ATL] Difference ANT script <->Run configuration [message #36503] Wed, 09 May 2007 12:45
Eclipse UserFriend
Originally posted by: jean-pierre.bourey.ec-lille.fr

Hi everybody,

I'm currenly using ATL to transform Petri Nets to UMl Activity diagram.
the header of my transformation is :

module PN2UMLAD_V3; -- Module Template
create OUT : UML2 from IN : PetriNetMM;

I have defined a first transformation which works when I launch it with the
"Run As.." and define an appropriate configuration with the configuration
form.
It works well and the ".uml" file I obtain looks like:

<?xml version="1.0" encoding="ISO-8859-1"?>
<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
xmi:id="_mY13kP4iEduOt9Ue4m8tuQ" name="FirstPN">
<packagedElement xmi:type="uml:Activity" xmi:id="_mY13kf4iEduOt9Ue4m8tuQ"
name="PN_Example1">
<node xmi:type="uml:OpaqueAction" xmi:id="_mY13kv4iEduOt9Ue4m8tuQ"
name="P2" outgoing="_mY13mP4iEduOt9Ue4m8tuQ"
incoming="_mY13mv4iEduOt9Ue4m8tuQ"/>

.....and so on

I would like to execute the transformation from an ANT script. so I wrote
the following script (thanks to the very good
http://wiki.eclipse.org/index.php/AM3_Ant_Tasks ):

<project name="PN2UMLAD" default="transfo">
<!-- To Changeto use another Petri net model -->
<property name="model" value="MyFirstPetriNet"/>
<target name="loadMetaModels">
<!-- Load UML 2.0 metamodel-->
<am3.loadModel modelHandler="EMF" name="UML2MM" metamodel="MOF"
nsuri="http://www.eclipse.org/uml2/2.0.0/UML"/>
<!-- Load PN metamodel-->
<am3.loadModel modelHandler="EMF" name="PetriNetMM" metamodel="MOF"
path="/PN2UMLAD/MetaModels/PetriNetMM.ecore"/>
</target>
<target name="transfo" depends="loadMetaModels">
<am3.loadModel name="sourcePNModel" metamodel="PetriNetMM"
path="/PN2UMLAD/InputModels/${model}.ecore"/>
<am3.atl path="/PN2UMLAD/Transformations/PN2UMLAD_V3.asm">
<inModel name="IN" model="sourcePNModel"/>
<inModel name="UML2" model="UML2MM"/>
<inModel name="PetriNetMM" model="PetriNetMM"/>
<outModel name="OUT" model="targetUmlModel" metamodel="UML2MM"/>
</am3.atl>
<am3.saveModel model="targetUmlModel"
path="/PN2UMLAD/OutputModels/${model}.uml"/>
</target>
</project>

This script gives me the following result :

<?xml version="1.0" encoding="ISO-8859-1"?>
<uml:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML" name="FirstPN">
<packagedElement xsi:type="uml:Activity" name="PN_Example1">
<node xsi:type="uml:OpaqueAction" name="P2" outgoing="//PN_Example1/T2"
incoming="//PN_Example1/T1"/>
... and so on.

The problem is that I can't open this result with the UML tree editor.
Taking into account my weak knowledge on the subject, my questions are :

1) why are the results different (especially the xmi:version attribute and
the way the elements are referenced) ?
2) which step(s) did I miss and how to obtain the same result with an ANT
script.

Thanks in advance for any answer and help for solving this problem and
increasing my knowledge
best regards
jean-pierre
Previous Topic:[ATL] Model to text generation.. the case of BPEL and XSD
Next Topic:[ATL] Transformation BPEL - XPDL
Goto Forum:
  


Current Time: Tue Apr 16 16:02:41 GMT 2024

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

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

Back to the top