|
|
| Re: [Acceleo] How to load two models as input for generation? [message #1008705 is a reply to message #1008364] |
Wed, 13 February 2013 11:22   |
André Ribeiro Messages: 43 Registered: January 2013 |
Member |
|
|
Hi,
Maybe I wasn't clear. The 2 two diagrams that I need share the same metamodel.
Stephane Begaudeau wrote on Wed, 10 October 2012 09:10Hi,
If you want to use multiple models in your generator, you should start with one of the models and then navigate to elements of the second one in the generator. If the second one is not loaded, you can use the code in the comment in the method "doGenerate" (//org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model)).
Probably the information above is useful, but I'm just a beginner using acceleo.
If someone could provide me some help I would appreciate it very much.
Thanks.
André Ribeiro
IST Lisbon
Portugal
|
|
|
| Re: [Acceleo] How to load two models as input for generation? [message #1009499 is a reply to message #1008705] |
Fri, 15 February 2013 03:33  |
Laurent Goubet Messages: 1548 Registered: July 2009 |
Senior Member |
|
|
Hi André,
What this basically means is that you do not "need" to load the two models if there are links between the two : the references will be loaded automatically as you navigate your models. For example if you have a two models "library.ecore" and "types.ecore"; library.ecore contains a class "Book", types.ecore contains a class "CirculatingItem". If the super-type of class "Book" is "CirculatingItem", then there is a "natural" link between your two models. You only need to load "library.ecore" and feed it to Acceleo : references will be automatically resolved when you try to access [book.eSuperTypes/] from Acceleo.
If you want to be absolutely sure that all your models are loaded when you generate, without relying on lazy loading, you can use the proposed code, calling "EcoreUtil.resolveAll(...)" before starting the generation.
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.03717 seconds