Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [XPAND] Can't find references to metamodel from template
[XPAND] Can't find references to metamodel from template [message #764663] Mon, 12 December 2011 16:05 Go to next message
Dennis  is currently offline Dennis
Messages: 1
Registered: December 2011
Junior Member
Hi,

I have followed the "getting started" tutorial for creating xpand generator from here: ditec.um.es/ssdd/xpand_reference.pdf. I have created the ecore metamodel and generated java code. Then I loaded this project into the runtime and created Xpand project. When I get to the point of specifying the template I get an error "Can't find data:DataModel".

From another tutorials I found that I have to copy my .ecore model to the same src folder where I have my template. When I did that the error disappeared and it could find the model classes.
This is the first time I am using XPand and my question is do I have to always copy my .ecore file to the same folder as the template? Can I reference it differently?

Thanks in advance,
Dennis
Re: [XPAND] Can't find references to metamodel from template [message #764763 is a reply to message #764663] Mon, 12 December 2011 20:06 Go to previous message
Karsten Thoms is currently offline Karsten Thoms
Messages: 353
Registered: July 2009
Location: Dortmund
Senior Member

The EPackage of your metamodel must be known. This can be achieved by generating the EMF classes and use the org.eclipse.emf.ecore.generated_package extension point, e.g. like this:
   <extension point="org.eclipse.emf.ecore.generated_package">
      <package
            uri="http://code.google.com/a/eclipselabs.org/p/spray"
            class="org.eclipselabs.spray.mm.spray.SprayPackage"
            genModel="model/spray.genmodel"/>
   </extension>

Then your metamodel will be known in your UI.

~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Previous Topic:[Xpand] Access EAnnotations
Next Topic:[Acceleo] Start a module with a SET parameter
Goto Forum:
  


Current Time: Wed Sep 03 00:04:27 GMT 2014

Powered by FUDForum. Page generated in 0.01497 seconds