Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Question about using superimpose in Ant files
[ATL] Question about using superimpose in Ant files [message #499324] Fri, 20 November 2009 19:25 Go to next message
Lucas Schubert is currently offline Lucas SchubertFriend
Messages: 11
Registered: July 2009
Junior Member
Hey,

I have one question, I hope that some of you can help me! Smile
I'm trying to automate my ATL transformation using Ant. But it is not working!

The build file that I'm trying to execute is the following :
<?xml version="1.0" encoding="UTF-8"?>
<project name="Phase1" default="run" basedir=".">
<property name="atl.launcher" value="Regular VM (with debugger)"/>
<property name="sourcePath" value="../sourcemodel/MasterProject.uml" />
<property name="resultPath" value="../result/result.xmi" />

<property name="metricsCalcPath" value ="../transforms/metricsCalc.asm"/>
<property name="ignoreBadSmellsPath" value ="../transforms/ignoreBadSmells.asm"/>
<property name="functionsLibPath" value ="../transforms/functionsLib.asm"/>
<target name="run">
<atl.loadModel name="Source" metamodel="MOF" nsUri="http://www.eclipse.org/uml2/2.1.0/UML" />
<atl.loadModel name="QueryResult" metamodel="MOF" path="../metamodel/BSDMC_MM.ecore"/>
<atl.loadModel name="sample" metamodel="Source" path="${sourcePath}" />
<atl.launch path="../transforms/phase1.asm">
<inmodel model="sample" name="IN" />
<outmodel model="OutModel" name ="OUT" metamodel="QueryResult" />
<library name="functionsLib" path="${functionsLibPath}" />
<superimpose path="${metricsCalcPath}"/>
<superimpose path="${ignoreBadSmellsPath}"/>
</atl.launch>
<am3.saveModel model="OutModel" path="{resultPath}"/>
</target>
</project>

If I try to run it, it loads the 3 models correctly, then tries to execute the atl.lauch generating one error : java.lang.NullPointerException.

I think that it has something to do with the use of superimpose, if I remove the superimpose declarations, an error message is generated informing that a operation in my transformation is missing. (This operation is implemented in the removed superimpose file. Smile )
If I run it without Ant it works just fine! Very Happy

Do you known what I may be doing wrong? Smile

Thanks a lot in advance,

Lucas

P.S.: ATL Version : 3.0.1.v200909220532
The Public2Private build file works fine here!


Re: [ATL] Question about using superimpose in Ant files [message #499364 is a reply to message #499324] Sat, 21 November 2009 12:44 Go to previous messageGo to next message
Lucas Schubert is currently offline Lucas SchubertFriend
Messages: 11
Registered: July 2009
Junior Member
Hey again! Smile

If I remove the superimpose, and copy all content from the superimposed modules to the transformation file (phase1.asm) it works fine.
I've also changed <am3.saveModel model="OutModel" path="{resultPath}"/> by
<atl.saveModel model="OutModel" path="{resultPath}"/>

I would like to use superimpose. So I can divide all my rules by modules. Razz
I'm still trying to find out what is wrong here! If you have any idea I would be glad to here it!

Thanks again in advance!

Lucas
Re: [ATL] Question about using superimpose in Ant files [message #499521 is a reply to message #499364] Mon, 23 November 2009 08:20 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Lucas Schubert a écrit :
> Hey again! :)
>
> If I remove the superimpose, and copy all content from the superimposed
> modules to the transformation file (phase1.asm) it works fine.
> I've also changed <am3.saveModel model="OutModel"
> path="{resultPath}"/> by
> <atl.saveModel model="OutModel" path="{resultPath}"/>
>
> I would like to use superimpose. So I can divide all my rules by
> modules. :p
> I'm still trying to find out what is wrong here! If you have any idea I
> would be glad to here it!
> Thanks again in advance!
>
> Lucas

Have you try to use superimpose with hand launch first ?
The organisation of superimpose use is not trivial and you may first
learn about it before automating it.

Vincent
Re: [ATL] Question about using superimpose in Ant files [message #499604 is a reply to message #499521] Mon, 23 November 2009 14:21 Go to previous messageGo to next message
Lucas Schubert is currently offline Lucas SchubertFriend
Messages: 11
Registered: July 2009
Junior Member
Hey Vincent,

first of all thanks for the reply! Smile
Without using Ant (By hand), it works perfectly! Razz

Lucas
Re: [ATL] Question about using superimpose in Ant files [message #509169 is a reply to message #499604] Thu, 21 January 2010 15:05 Go to previous messageGo to next message
Dennis HendriksFriend
Messages: 74
Registered: January 2010
Location: The Netherlands
Member
I have a similar problem, trying to use the UML2Profiles example mentioned in the ATL User Guide. Using the launch configuration, it works. Using an ant build script:

<?xml version="1.0"?>
<project name="mod2core_controlvars" default="run" basedir=".">
    <property name="inpath" value="../models/JavaTypes.uml"/>
    <property name="outpath" value="../models/JavaTypes2b.uml"/>

    <property name="atl.launcher" value="Regular VM (with debugger)"/>

    <target name="run">
        <atl.loadModel metamodel="%EMF" name="UML2" path="../metamodels/UML2Profiles.ecore"/>
        <atl.loadModel metamodel="UML2" name="inmodel" path="${inpath}"/>
        <atl.loadModel metamodel="UML2" name="accessors" path="../profiles/Accessors.profile.uml"/>
        <atl.launch path="../UML2Copy.asm">
            <!--superimpose path="../UML2Profiles.asm"/-->
            <library name="UML2" path="../lib/UML2.asm"/> 
            <inmodel name="IN" model="inmodel"/>
            <inmodel name="ACCESSORS" model="accessors"/>
            <outmodel name="OUT" model="outmodel" metamodel="UML2"/>
        </atl.launch >
        <atl.saveModel model="outmodel" path="${outpath}"/>
    </target>
</project>


without superimposition (note the commented out superimpose) it works (although it is just a copy, as it uses only UML2Copy.asm).

When I enable the superimposition, I get:

BUILD FAILED
XXX/superimpose_test/launch/build.xml:12: java.lang.NullPointerException


Does anyone know how to fix this? As seen at http://soft.vub.ac.be/viewvc/UML2CaseStudies/uml2cs-instantm essenger-model/outmodels/common/build.xml?view=markup&pa threv=5633 it should work (assuming that the example worked for someone). But they use am3 tasks, and not atl tasks. Also, I couldn't find how to check out that entire example repository, so I donwloaded just the files I needed and created my own ant build script, inspired by the example.

Seeing as the original poster got the same error, I wonder if anyone knows what we both did wrong? Any help would be greatly appreciated!

Dennis

[edit: comma ended up as part of the url (last character). fixed that]

[Updated on: Thu, 21 January 2010 15:08]

Report message to a moderator

Re: [ATL] Question about using superimpose in Ant files [message #509177 is a reply to message #499324] Thu, 21 January 2010 15:23 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
I believe there was a bug with super-imposition in ant scripts. It was corrected I think but i don't know in which version.
Re: [ATL] Question about using superimpose in Ant files [message #509179 is a reply to message #509177] Thu, 21 January 2010 15:28 Go to previous messageGo to next message
Dennis HendriksFriend
Messages: 74
Registered: January 2010
Location: The Netherlands
Member
Thanks for the quick reply.

I'm using eclipse-modeling-galileo-SR1-incubation-linux-gtk.tar.gz as my Eclipse version. I think that's the latest version, except for cvs versions. Was it fixed very recently or before galileo SR1?

Dennis
Re: [ATL] Question about using superimpose in Ant files [message #509200 is a reply to message #499324] Thu, 21 January 2010 16:31 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
I was talking about this bugzilla
Re: [ATL] Question about using superimpose in Ant files [message #509340 is a reply to message #509200] Fri, 22 January 2010 07:34 Go to previous messageGo to next message
Dennis HendriksFriend
Messages: 74
Registered: January 2010
Location: The Netherlands
Member
l guess it'll be in Galileo SR2 then. Thanks!
Re: [ATL] Question about using superimpose in Ant files [message #517540 is a reply to message #509340] Mon, 01 March 2010 09:11 Go to previous messageGo to next message
Dennis HendriksFriend
Messages: 74
Registered: January 2010
Location: The Netherlands
Member
D. Hendriks (Dennis) wrote on Fri, 22 January 2010 08:34
l guess it'll be in Galileo SR2 then. Thanks!


Just to let you know, it works again in Galileo SR2. Thanks again!

Dennis
Re: [ATL] Question about using superimpose in Ant files [message #543279 is a reply to message #517540] Mon, 28 June 2010 23:05 Go to previous messageGo to next message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
On 16/03/1431 11:11 ص, D. Hendriks (Dennis) wrote:
> D. Hendriks (Dennis) wrote on Fri, 22 January 2010 08:34
>> l guess it'll be in Galileo SR2 then. Thanks!
>
>
> Just to let you know, it works again in Galileo SR2. Thanks again!
>
> Dennis


hi all


and I have some questions if you kindly can answer them

what is the need of the superimpose in the Ant file, what I understand
is that it enforces second transformation file after the first one, I am
speaking about the UML2Profile use case not the above code as I could
not understand it all.

the second is that is there an editor which facilitates the ant build
task completion as I know only the mentioned in the ATL tutorial and it
is not enough as I deduced later.
Re: [ATL] Question about using superimpose in Ant files [message #543312 is a reply to message #543279] Tue, 29 June 2010 06:09 Go to previous message
Dennis HendriksFriend
Messages: 74
Registered: January 2010
Location: The Netherlands
Member
> what is the need of the superimpose in the Ant file, what I understand
> is that it enforces second transformation file after the first one

For more information on ATL superimposition: http://wiki.eclipse.org/ATL_Superimposition

Basically, the rules of one file overwrite the rules of another. Superimposition has nothing to do with Ant scripts, you can use it in ATL launch configurations as well.

Dennis
Previous Topic:How does ATl deal with many source models in the normal execution mode
Next Topic:[ATL] Would you please provide with a workable standalone ATL transformation example?
Goto Forum:
  


Current Time: Fri Apr 26 19:10:36 GMT 2024

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

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

Back to the top