Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [acceleo 3.1] change metamodel resolving?
[acceleo 3.1] change metamodel resolving? [message #726045] Fri, 16 September 2011 09:19 Go to next message
ranjit  is currently offline ranjit
Messages: 2
Registered: September 2011
Junior Member
Hi,
i got the following situation:
There is an emf plugin-project(a model editor).
The editor has a method to call an acceleo generation on a given model-object. The acceleo-template used is "generated" normally in an acceleo-project.

Now, the name of the metamodel is like "com.sample.model/model.ecore" and the nsURI of that model is "sample.com/model/1.0" (i trimmed http part, since i may not post links yet^^). Since the plugin is not finished, i need to run it in the runtime instance.
In the acceleo-template(generate.mtl) i specified the metamodel as "sample.com/model/1.0". In the acceleo-editor, at first the model cannot be resolved, but 1-2 seconds later it is found. Acceleo's auto completion also does not show "sample.com/model/1.0" immediately, only "com.sample.model/model.ecore" .

When i take a look in the compiled generate.emtl, the ePackage is "com.sample.model/model.ecore".
I mention this, because when i launch the plugin and use the method that calls the generation i get this message:
!MESSAGE The generation fail to generate any file because there are no model elements that matches at least the type of the first parameter of one of your main templates. 
The problem may be caused by a problem with the registration of your metamodel, please see the method named "registerPackages" in the Java launcher of your generator. 

I think that is because the metamodel "com.sample.model/model.ecore" (like it is described in the .emtl) cannot be found in the runtime instance, since it is registered as "sample.com/model/1.0".
So i imported the acceleo project into the runtime, let it compile, and this time the ePackage in the .emtl was "sample.com/model/1.0". I copied the .emtl to the first instance acceleo project, launched the plugin again and everything worked.

So basically, the specified metamodel of my generate.mtl ("sample.com/model/1.0") is resolved to "com.sample.model/model.ecore" when compiling in the first instance, and is resolved to "sample.com/model/1.0" in the runtime-instance. My problem is that i need it to be resolved to "sample.com/model/1.0" in the first instance also, so the generation works in the runtime.

Is there any way to do this, besides moving the acceleo project to the runtime of the launched plugin ?

Many thanks in advance Smile

[Updated on: Fri, 16 September 2011 11:51]

Report message to a moderator

Re: [acceleo 3.1] change metamodel resolving? [message #726801 is a reply to message #726045] Mon, 19 September 2011 11:21 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

Quote:
When i take a look in the compiled generate.emtl, the ePackage is "com.sample.model/model.ecore".

Right click on your project, go to the properties and see if you are using binary or XMI based serialization. Try to switch to XMI.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo



Re: [acceleo 3.1] change metamodel resolving? [message #726847 is a reply to message #726801] Mon, 19 September 2011 13:19 Go to previous message
ranjit  is currently offline ranjit
Messages: 2
Registered: September 2011
Junior Member
Thanks a lot, that worked.

Best regards,
ranjit
Previous Topic:Registration problem of GCM package of MARTE Profile
Next Topic:[acceleo] check for already generated java code
Goto Forum:
  


Current Time: Sat Aug 30 10:30:41 EDT 2014

Powered by FUDForum. Page generated in 0.05749 seconds