Generating Java/Caml code from XMI model? [message #817785] |
Sat, 10 March 2012 11:50  |
Eclipse User |
|
|
|
Hi,
I'm a engineering student doing a project on Java/Caml Code generation from Simulink/Stateflow model .
I'm using the Acceleo bundle 3.* to generate Java/Caml from a file Filter.xmi .
The problem is I learnt how to transform the Ecore/Uml model to Java/Caml code in the tutorials of Acceleo 3 , but I don't find any documentation which trait the XMI file as a input .
I have only a XMI file (Filter.xmi) which stores the Filter model (M0 level , M1 level is a geneauto.ecore )
I wonder whether it is possible to generate files from xmi model ?
Could anyone help me on the tutorial of generation of code from XMI , please ?
|
|
|
Re: Generating Java/Caml code from XMI model? [message #820512 is a reply to message #817785] |
Wed, 14 March 2012 04:15  |
Eclipse User |
|
|
|
Hi,
As long as your file can be loaded as an EMF model, its extension does not matter, be it ecore, uml, xmi ... XMI is only (one of) the way(s) the model can be serialized on disk.
I suppose you were defining this model from within Eclipse? If not, can you use the right-click > open with > Other > Sample Reflective Ecore Model Editor; it you can see your model in this editor, it can be used "as an EMF model" . If so, you can simply feed it to Acceleo as is. Just replace the "uml" or "ecore" models of the tutorials by your own. If not, you will need to override the "registerPackages" method of the Java class Acceleo automatically generates beside your mtl file and add your "M1" (geneauto.ecore) in the package registrations before feeding your model to Acceleo.
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.05917 seconds