Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » [EMFTVM] Problem with inout model in ANT lauch file
[EMFTVM] Problem with inout model in ANT lauch file [message #1333836] Mon, 05 May 2014 08:51 Go to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Hello,

I have defined an ATL transformation with an inout model. In the Eclipse launch configuration I have defined that the input model is located in a folder, but the update input model is serialized in other folder, this configuration work properly. The problems occours when I try to defined this launch configuration in an ANT Task. I defined the loadMetamodel and loadModel tasks, also I have defined de inoutput property for the emftvm.run task but I don't know where set the output path for the inoutmodel.

<emftvm.run modulepath="platform:/resource/migraria.m2m.strutsConfig_java_MIGRARIAMVCViewAndModel2MIGRARIAMVC_Controller/transformations/" module="strutsCfgJavaMVCViewModel2MVCController">
			<metamodel name="mmMIGRARIAMVC"/>
			
			
			<inoutmodel name="inMIGRARIAMVC" as="IN"/>		
						
			<outputmodel name="trace" as="trace" wspath="migraria.m2m.strutsConfig_java_MIGRARIAMVCViewAndModel2MIGRARIAMVC_Controller/mTarget/trace.xmi"/>
		</emftvm.run>


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: [EMFTVM] Problem with inout model in ANT lauch file [message #1334043 is a reply to message #1333836] Mon, 05 May 2014 11:07 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

You can set the output path by defining the "wspath" on the inoutmodel element. Example:

http://git.eclipse.org/c/mmt/org.eclipse.atl.git/tree/plugins/org.eclipse.m2m.atl.emftvm.compiler/compiler-compiler/build.xml?id=2bcbeec856bbd9b2488c17c30ffd34c5449505a0

See line 117.


Cheers,
Dennis
Re: [EMFTVM] Problem with inout model in ANT lauch file [message #1334151 is a reply to message #1334043] Mon, 05 May 2014 12:20 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Hi,

I follow the example, but I have a problem. In the transformation I set references to existing elements in the in/out model before the transformation. If I run the transformation with Eclipse launch the references point to elements of ouput model, but when I use the ANT task the references point to input model. And I'd like that transformation run with ANT task as when I launch with Eclipse.

Best regards


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: [EMFTVM] Problem with inout model in ANT lauch file [message #1334243 is a reply to message #1334151] Mon, 05 May 2014 13:23 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

The new Resource URI on the in/out model is set only when executing the emftvm.run task. You must save any models referring to the in/out model AFTER running the emftvm.run task.

Cheers,
Dennis
Re: [EMFTVM] Problem with inout model in ANT lauch file [message #1338273 is a reply to message #1334243] Wed, 07 May 2014 06:25 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Hello,

I save the models using the emftvm.saveModel task. The problem is that some of the references creates in the transformation between existing elements in the in/out model an the new elements in the in/out model are serialized as references to the elements in the model file use as input instead of set reference to the copy of elements in the new output model.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: [EMFTVM] Problem with inout model in ANT lauch file [message #1339588 is a reply to message #1338273] Wed, 07 May 2014 19:00 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

Victor, can you show me your build.xml? I can better understand what you mean
that way.


Cheers,
Dennis
Re: [EMFTVM] Problem with inout model in ANT lauch file [message #1340756 is a reply to message #1339588] Thu, 08 May 2014 06:55 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
I attach the build.xm and this is the model transformation head

module strutsCfgJavaMVCViewModel2MVCController;
create OUT: mmMIGRARIAMVC refining IN: mmMIGRARIAMVC, inJava: mmJava, inStrutsConfig: mmStrutsConfig, inModelTrace : mmTrace;


This is an excerpt of the output model generated when I run the transformation using Eclipse launch:
      <operations xsi:type="Controller:DataOperationCall" name="confDAO.get" dataOperation="//@model/@objects.1/@operations.3">
        <params xsi:type="Controller:DataOperationCallParameter" name="confId" instance="//@controller/@controlFlows.0/@instances.1" parameter="//@model/@objects.1/@operations.3/@parameters.0"[/color]/>
        <return name="DeclarationFragment conf" return="//@model/@objects.1/@operations.3/@return" instance="//@controller/@controlFlows.0/@instances.2"/>
      </operations>


And this is the excerpt of the model generated running the transformation with ANT task
      <operations xsi:type="Controller:DataOperationCall" name="confDAO.get">
        <params xsi:type="Controller:DataOperationCallParameter" name="confId" instance="//@controller/@controlFlows.0/@instances.1">
          <parameter xsi:type="Model:DataOperationParameter" href="../mSource/migraria_view_and_model.xmi#//@model/@objects.1/@operations.3/@parameters.0"/>
        </params>
        <return name="DeclarationFragment conf" instance="//@controller/@controlFlows.0/@instances.2">
          <return xsi:type="Model:DataOperationReturn" href="../mSource/migraria_view_and_model.xmi#//@model/@objects.1/@operations.3/@return"/>
        </return>
        <dataOperation href="../mSource/migraria_view_and_model.xmi#//@model/@objects.1/@operations.3"/>
      </operations>


The differences are in the attributes dataOperation of element operation, parameter of element param and return of element return.
  • Attachment: build.xml
    (Size: 2.21KB, Downloaded 21 times)


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.

[Updated on: Thu, 08 May 2014 06:59]

Report message to a moderator

Re: [EMFTVM] Problem with inout model in ANT lauch file [message #1366756 is a reply to message #1340756] Mon, 19 May 2014 13:09 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

Sorry for the delay: I cannot see any mistake in your build.xml file, so I will have to do some additional testing.

Cheers,
Dennis
Re: [EMFTVM] Problem with inout model in ANT lauch file [message #1367415 is a reply to message #1366756] Mon, 19 May 2014 19:37 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

I cannot reproduce you problem with a simple test project (see attached "AntTest".zip" project). Can you zip up a full project that allows me to reproduce your problem?
  • Attachment: AntTest.zip
    (Size: 84.32KB, Downloaded 19 times)


Cheers,
Dennis
Re: [EMFTVM] Problem with inout model in ANT lauch file [message #1385253 is a reply to message #1367415] Thu, 05 June 2014 08:14 Go to previous message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Hello

I attach a project where I try to reproduce the error simplifying the transformation rules and metamodels. In the process I found another error that didn't allow me to reproduce the same error that I get in my original project, but I think it is related to the original error. The problem that I found is when I load a model and the trace model of transformation that generated it. If I query the elements in eclipse launch the model elements and the target elements in trace model there are the same instances. But when I try running the ANT task the instances are different from the input model and the trace source elements.

Best regards,
Víctor.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Previous Topic:Migration from ATL to EMFTVM
Next Topic:[EMFTVM] writing to console
Goto Forum:
  


Current Time: Sun Oct 26 02:10:32 GMT 2014

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

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