Skip to main content


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 Friend
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 ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
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, EMF, Eclipse IDE?
Go to: http://devhub.karakun.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: Fri Mar 29 13:28:12 GMT 2024

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

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

Back to the top