|Re: Generation an XMI file to java file [message #957851 is a reply to message #957597]
||Thu, 25 October 2012 14:47
| Laurent Goubet
Registered: July 2009
Acceleo operates on any EMF model, not only ".ecore" ones. Generating code from your xmi file is as easy as providing them to your launch config. However, your templates have been created to operated on ecore objects (EClass, EOperation, EAttribute...). The objects from your dynamic instance are not elements applying to the ecore metamodel, but elements applying to your own metamodel (as defined in "file.ecore").
For example, you may have created a class named "Library" in your model "file.ecore". When you launch acceleo with file.ecore, generating code from that object needs a template applying to (its first parameter) EClass. When you create a dynamic instance of your "Library" class, the template that applies to that dynamic instance must have its first parameter to be of type "Library".
In other words : yes, you can generate code from your dynamic instance through Acceleo, whatever the file extension; but no, you can't use the same generators for both the Ecore metamodel and your dynamic instance (that is in fact a model which metamodel is that 'file.ecore' from which you created it).
Powered by FUDForum
. Page generated in 0.05244 seconds