Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » XPand2 extension problem
XPand2 extension problem [message #896688] Thu, 19 July 2012 11:51 Go to next message
Alan DW is currently offline Alan DW
Messages: 105
Registered: March 2012
Senior Member
Hello everyone,

I'm running an MWE workflow with an Xpand2 generator in it.
Here's the important part of the .mwe file:

	<component id="generator" class="org.eclipse.xpand2.Generator" skipOnErrors="true">
		<metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel"> 
			<metaModelPackage  value="org.eclipse.emf.ecore.EcorePackage"/> 
		</metaModel> 
		
	 	<metaModel class="org.eclipse.xtend.typesystem.uml2.UML2MetaModel">
  	  	</metaModel>   
    
	  	<expand value="Root::Root FOR model"/>
	  	<fileEncoding value="ISO-8859-1"/>
	  	<outlet path="${baseDir}src-gen">
	   		<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier"/>
	  	</outlet>
	</component>



... and in the Root.xpt file, the first line is this one:

«EXTENSION template::GeneratorExtensions»



Finally, the file "template/GeneratorExtensions.ext" looks like this:

String xmiID(emf::EObject x) :
	JAVA template.Extensions.xmiId(org.eclipse.emf.ecore.EObject);
String typename(emf::EObject x) :
	JAVA template.Extensions.dataTypeName(org.eclipse.uml2.uml.Type);
Boolean isSuperClass(emf::EObject x) :
	JAVA template.Extensions.isSuperClass(org.eclipse.emf.ecore.EObject) ;
Boolean isNameOfPrimitivType(String x) :
	JAVA template.Extensions.isNameOfPrimitivType(java.lang.String) ;



Now, the problem is that whenever I try to call one of the methods described in the GeneratorExtensions.ext file, I get an exception which looks like this:

[ERROR] Generator - template.Extensions.isSuperClass(org.eclipse.emf.ecore.EObject) not found, problems were:
[AnalysationIssueType not found] - Couldn't find Java type template.Extensions : template.Extensions
<EvaluationException : template.Extensions.isSuperClass(org.eclipse.emf.ecore.EObject) not found, problems were:
[AnalysationIssueType not found] - Couldn't find Java type template.Extensions : template.Extensions

template::GeneratorExtensions.ext[200,111] on line 5 'Boolean isSuperClass(emf::EObject x)'



Does anybody have an idea why the extension cannot be resolved correctly? The extension file is stored in "ProjectRoot/template/GeneratorExtensions.ext", so the generator should find it... Or do I need to add it in a particular way to my project?

If it is of any relevance, I'm running this code in a standalone Java application outside Eclipse.


Any help or hint on this would be appreciated, I'm really stuck here...



Thanks,



Alan
Re: XPand2 extension problem [message #896809 is a reply to message #896688] Thu, 19 July 2012 21:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6313
Registered: July 2009
Senior Member
Hi,

the error message complains about the JAVA Class template.Extensions cannot be found

~Christian
Re: XPand2 extension problem [message #896881 is a reply to message #896809] Fri, 20 July 2012 09:17 Go to previous message
Alan DW is currently offline Alan DW
Messages: 105
Registered: March 2012
Senior Member
Hi,

alright, I'm feeling rather stupid now. To preserve my "honor" as a programmer: I did not write the workflow code - I'm just porting it into a different application. And the one who created this obviously forgot to tell me that I need an implementation class here, too. I'm sorry, Christian. Thank you for your response, though, that totally nailed it and it works now Smile

Greets,


Alan
Previous Topic:[Xpand] Running MWE workflow with Xpand generator outside eclipse?
Next Topic:[Acceleo] Removing duplicate in collection
Goto Forum:
  


Current Time: Sun Sep 21 14:10:34 GMT 2014

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

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