[Acceleo] Multi-model to text transformation [message #1766269] |
Mon, 19 June 2017 12:41  |
Eclipse User |
|
|
|
Dear all,
I am trying to use Acceleo to generate some text from a root.xmi model, defined in terms of a rootMM.ecore meta-model. This metamodel has some dependencies on other meta-models. As a consequence, my root.xmi model needs to load some "external models" in memory when the required attributes/references need to be displayed/modified in the model editor. This means that these "external models" are only loaded in memory on demand... not when the root.xmi model is opened!! I guess this is why I am not being able to generate text from some parts of my root.xmi model, in particular, for the attributes of objects stored in those "external models".
When I try to write one of these attributes I always get "invalid". However, if I manage to load these elements in memory in advance (e.g., using an odd "getter" implemented just for that purpose in the corresponding class of the external meta-model), I get the right value of the attribute.
Do you know how to force the load in memory of all the models required by a given xmi model? I guess this would definitively solve the problem.
Thanks in advance,
Cristina
|
|
|
|
Re: [Acceleo] Multi-model to text transformation [message #1766292 is a reply to message #1766281] |
Mon, 19 June 2017 23:29   |
Eclipse User |
|
|
|
Dear Ed,
Thanks a lot for your prompt answer!
The same problem arises when running my acceleo transformation within the local Eclipse where I wrote the .mtl file, and when I execute it in another Eclipse, launched from the former :-(
Where shall I invoke EcoreUtil.resolveAll to see if it works? In the main method of the GenerateXXX.java associated to the main Acceleo template? After getting the input model URI?, i.e., after:
URI modelURI = URI.createFileURI(args[0]);
or after creating the generator object?, i.e., after:
GenerateXXX generator = new GenerateXXX (modelURI, folder, arguments);
EcoreUtil.resolveAll requires a ResourceSet as an input, right? Where do I get that ResourceSet from?
Thanks in advance!
Cheers,
Cristina
|
|
|
|
|
Re: [Acceleo] Multi-model to text transformation [message #1768717 is a reply to message #1768363] |
Sat, 22 July 2017 04:25  |
Eclipse User |
|
|
|
Hi
Don't. The gap between SysML and SystemC text is much too large. Implement one (or more) M2Ms from the SysML model to a SystemC model, then an M2T from SystemC to text. You should be able to find a SystemC model somewhere and so can probably find an M2T too.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.03164 seconds