|[acceleo 3.1] change metamodel resolving? [message #726045]
||Fri, 16 September 2011 13:19
Registered: September 2011
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
[Updated on: Fri, 16 September 2011 15:51]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02628 seconds