Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Generating Java/Caml code from XMI model?(M2T)
Generating Java/Caml code from XMI model? [message #817785] Sat, 10 March 2012 16:50 Go to next message
ting liu is currently offline ting liuFriend
Messages: 1
Registered: March 2012
Junior Member

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 08:15 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1901
Registered: July 2009
Senior Member

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" Smile. 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
Previous Topic:MWE: delay issue with mwe invoked from Eclipse' action
Next Topic:existing acceleo templates for java code generation
Goto Forum:

Current Time: Sun Jun 04 21:59:49 GMT 2023

Powered by FUDForum. Page generated in 0.01981 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top