Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] EXPAND problem
[Xpand] EXPAND problem [message #642049] Mon, 29 November 2010 16:52 Go to next message
Luca Gherardi is currently offline Luca Gherardi
Messages: 60
Registered: November 2010
Member
Hi,

I have a problem with xpand.
I have 2 ecore metamodel. The Scene metamodel includes the star metamodel.
This is my pwt file:


«IMPORT Scene» 
«IMPORT Star»

«DEFINE Main FOR Scene::SceneMetamodel»
«FILE (name == null ? "SceneModel" : name) + ".star"-»
<?xml version="1.0" encoding="UTF-8" ?>
<Star version="1.1.1">
	<models_library> 
		«FOREACH models AS model-»
		
			«EXPAND parseModel FOREACH models»
		
		«ENDFOREACH-»
	</models_library>
</Star>
«ENDFILE»
«ENDDEFINE»

«DEFINE parseModel FOR Star::StarMetamodel»
«FOREACH abc.abcs AS def-»
			...
			...
			...
			«ENDFOREACH-»
«ENDDEFINE»



and this is my mwe:

<?xml version="1.0"?>
<workflow>
	<property name="model" value="platform:/resource/star.metamodel/instances/default.scene_model"/>
	<property name="out" value="out" />
	<!-- set up EMF for standalone execution --> 
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
	<platformUri value="../" /> </bean>
	<component class="org.eclipse.emf.mwe.utils.Reader">
		<uri value="${model}" />
		<modelSlot value="model" />
	</component>
<!-- generate code --> 
<component class="org.eclipse.xpand2.Generator">
<metaModel id="mm" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<expand value="templates::scene2xml::Main FOR model" />
<outlet path="${out}"/> </component>
</workflow>


Finally I report the error:

...

GRAVE: Error in Component  of type org.eclipse.xpand2.Generator: 
	EvaluationException : No Definition 'parseModel for Star::StarMetamodel' found!
	templates::scene2xml.xpt[277,32] on line 12 'EXPAND paeseModel FOREACH models'
	[23,43] on line 1 'EXPAND templates::scene2xml::Main FOR model'               

...


Can someone help me??
Thanks,
Luca

[Updated on: Tue, 30 November 2010 13:50]

Report message to a moderator

Re: [Xpand] EXPAND problem [message #642159 is a reply to message #642049] Tue, 30 November 2010 07:46 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6388
Registered: July 2009
Senior Member
hi,

the error message is

EvaluationException : No Definition 'paeseModel for Star::StarMetamodel' found!


seems you have somewhere a typo.

~Christian
Re: [Xpand] EXPAND problem [message #642230 is a reply to message #642159] Tue, 30 November 2010 13:47 Go to previous message
Luca Gherardi is currently offline Luca Gherardi
Messages: 60
Registered: November 2010
Member
Hi,

thanks for your answer.
I found the error that you mentioned and I fixed it but it isn't the real problem.

Anyway, now I can execute the script. I've modified the .mwe in the following way and now it works:

<workflow>
	<property name="model" value="platform:/resource/star.metamodel/instances/default.scene_model"/>
	<property name="out" value="out" />
	<!-- set up EMF for standalone execution --> 
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
		<platformUri value="../" />
		<registerGeneratedEPackage value="Star.StarPackage" />
		<registerGeneratedEPackage value="Scene.ScenePackage" />
	</bean>
	<component class="org.eclipse.emf.mwe.utils.Reader">
		<uri value="${model}" />
		<modelSlot value="model" />
	</component>
	<!-- generate code --> 
	<component class="org.eclipse.xpand2.Generator">
		<metaModel id="mm1" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel">
		</metaModel>
		<expand value="templates::scene2xml::Main FOR model" />
		<outlet path="${out}"/>
	</component>
</workflow>
Previous Topic:[Acceleo] Unexpected inheritance behavior
Next Topic:[Acceleo] Problem with the generated UI launcher
Goto Forum:
  


Current Time: Sat Oct 25 17:49:46 GMT 2014

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

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