[Acceleo 3.1] Problem launching transformation [message #704072] |
Thu, 28 July 2011 08:44  |
JM Gauthier Messages: 25 Registered: June 2011 |
Junior Member |
|
|
Hi,
I am planning to use Acceleo to generate a file from a .xmi model and as a noob, I got several troubles... This model is generated by ATL from a meta-model. I have done the "Quick start" and other tutorials...But no one talks about generating file from xmi file. Well, I have changed the Acceleo Compiler to XMI (properties of the project) but it doesn't change anything, and I got this error :
org.eclipse.acceleo.engine.AcceleoEvaluationException: The type of the first parameter of the main template named 'generateProject' is a proxy.
at org.eclipse.acceleo.engine.service.AcceleoService.doGenerate(AcceleoService.java:507)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.generate(AbstractAcceleoGenerator.java:175)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.doGenerate(AbstractAcceleoGenerator.java:154)
...
...
etc
and this is my mtl file :
[comment encoding = UTF-8 /]
[module tdmodel('tdmodel')]
[template public generateProject(aProject : Project)]
[comment @main /]
[file(aProject.name, false,'UTF-8')]
Hello World!
[/file]
[/template]
To finish the .xmi file which is used as the input model for Acceleo :
<?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:tdmodel="tdmodel">
<tdmodel:Project>
<model>
<model name="Model">
<rootPackage name="rootPackage">
<types xsi:type="tdmodel:Class" name="Student">
<attributes name="age"/>
<operations name="study"/>
</types>
</rootPackage>
</model>
</model>
</tdmodel:Project>
<tdmodel:ModelInstance/>
</xmi:XMI>
I don't know what to do, despite of intenses researches..
Thanks!
[Updated on: Thu, 28 July 2011 10:25] Report message to a moderator
|
|
|
|
|
Re: [Acceleo 3.1] Problem launching transformation [message #707100 is a reply to message #704118] |
Mon, 01 August 2011 08:40   |
|
Hi,
First things first, no, it is not a good way to register metamodels through the ATL popup menu. That being said, it is indeed the only way to do it since it is not something EMF recommends.
Second, generating from an xmi file is supported . Whatever the extension of your file (even if it has no extension), as long as it is a model that can be loaded with EMF, it is supported by Acceleo.
As for the error you have, "the type [...] is a proxy" indeed spans from the metamodel being unknown to Acceleo (or, more generally, to Eclipse). [module tdmodel('tdmodel')] means that you have in that Eclipse a metamodel going by the NsURI "tdmodel". It also means that in the generated Acceleo launcher, you have to register that same metamodel through code if it is not pluginized. (See also what Joachim has done with the "registerPackages" method of that class and my answer to his problem (which is the same has your BTW).)
Laurent Goubet
Obeo
[Updated on: Mon, 01 August 2011 08:41] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02411 seconds