Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Metamodel registered, but still...("there are no model elements that matches at least.....")
[Acceleo] Metamodel registered, but still... [message #707935] |
Tue, 02 August 2011 04:42  |
Eclipse User |
|
|
|
Hi,
I'm creating a plugin for Papyrus, in which I perform M2M and M2T. It works as follows : first, a native metamodel transformation from UML to a dedicated metamodel. Then, an extension point "modelTransformation" is set to accept model transformations from this dedicated metamodel to any other, and it has an attribute "codeGeneration" to link this transformation to a code generation module.
I didn't have any trouble transforming models, but I can't get to launch the code generation. I've got this error
!ENTRY org.eclipse.acceleo.engine 2 0 2011-08-02 10:03:47.137
!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.
The metamodel I use isn't registered, it would seem. But it is well registered indeed, as I used the extension org.eclipse.emf.ecore.dynamic_package to get it done, and I can tell it works because (for example) modisco browser can go through the generated xmi.
Let's see then how the code generation is executed :
@Override
public void run() throws Exception {
((AbstractAcceleoGenerator) codeGen).initialize(URI.createURI(model),currentProject.getFullPath().toFile(), args);
((AbstractAcceleoGenerator) codeGen).doGenerate(new BasicMonitor());
}
model is a string containing the full name of the xmi file. The URI created from it contains the first Element (an EClassImpl) of the xmi file. I guess that's how it's supposed to be.
currentProject is the current active IProject, I tested it and it correspond to what's expected.
I tried in the template to replace the package ns uri with a relative and an absolute path, it didn't change a thing (wasn't worse tho).
I should mention that the generation works when executed alone in my dev eclipse instance.
I really don't know what to do. If you could please point me to the right direction, it would help a lot. Thank you for reading all this.
A
[Updated on: Tue, 02 August 2011 05:04] by Moderator
|
|
| | | | | | | | | |
Goto Forum:
Current Time: Wed Mar 12 00:36:54 EDT 2025
Powered by FUDForum. Page generated in 0.04351 seconds
|