Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo]Using 2 metamodels in combination with 2 separate model instances
[Acceleo]Using 2 metamodels in combination with 2 separate model instances [message #932663] Thu, 04 October 2012 09:59 Go to next message
Frederik Gailly is currently offline Frederik Gailly
Messages: 4
Registered: October 2012
Junior Member
Hello,

Context:
MM 1: ER metamodel
MM 2: Policy metamodel wich refers to metamodel1 and uses metaconcepts that are defined in MM1

Model1 (model1.er): instantiation of MM 1 which is created using an EMF generated editor
Model 2 (model2.policy): instantiation of MM2 which contains a reference to Model 1 and uses concepts defined in model 1

Problem:
I can define an mtl generation file using Acceleo which contains no syntax errors. However when I run this file there seems to be something wrong when I want to use the references in model2 to elements in model1. Seems like model2 cannot find model1.

Thanks in advance,
Frederik

[Updated on: Thu, 04 October 2012 13:16]

Report message to a moderator

Re: [Acceleo]Using 2 metamodels in combination with 2 separate model instances [message #938860 is a reply to message #932663] Wed, 10 October 2012 08:13 Go to previous message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 413
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

It seems odd, well you can force the loading of all the related resources by using the commented line (//org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model)) in the method "doGenerate" of your java launcher. You can look in the resource set of your model to check that both models are properly loaded (model.eResource().getResourceSet().getResources()).

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau & @acceleo
Google+: stephane.begaudeau & acceleo
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo



Previous Topic:[Acceleo 3] Multiple metamodels
Next Topic:[Acceleo] Ordered unbound choices / EFeatureMapEntry
Goto Forum:
  


Current Time: Fri Oct 31 05:41:00 GMT 2014

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

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