Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Re: Hand object as GLOBALVAR into Xtend file via MWE workflow?
Re: Hand object as GLOBALVAR into Xtend file via MWE workflow? [message #496120] Sun, 08 November 2009 18:32 Go to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Marcel,

I forwarded this one to the m2t newsgroup as this question is not
related to Xtext but Xpand.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Marcel schrieb:
> Hi!
>
> I want to hand an object into a Xtend file via the MWE workflow. I tried
> it this way:
>
> MWE:
>
>
> ...
> <component id="resultBuilder"
> class="com.example.pop.workflow.ResultBuilderFactory">
> </component>
> ...
> <component class="org.eclipse.xpand2.Generator">
> <metaModel
> class="org.eclipse.internal.xtend.type.impl.java.JavaMetaModel ">
> <typeStrategy
> class=" org.eclipse.internal.xtend.type.impl.java.beans.JavaBeansStr ategy "/>
> </metaModel>
>
> <fileEncoding value="Cp1252"/>
> <expand value="com::example::pop::templates::BuildMapper::main
> FOR popModel"/>
> <genPath value="${targetDir}"/>
>
> <!-- hand in the mapping model to search in it-->
> <globalVarDef name="mappingModel" value="mappingModel" />
>
> <!-- configure which implementation of the IResultBuilder should
> be used -->
> <!--<globalVarDef name="resultBuilder"
> value="resultBuilder"
> />--> </component>
>
>
>
> As highlighted I create a component with id="resultBuilder" and try to
> hand that one into the Generator via a globalvar.
> In the xtend file I defined the GLOBALVAR, but the workflow does not
> know the value="resultBuilder".
>
>
> Does anybody has an idea how to create an object in the workflow and use
> it in the templates??
>
> A workaround is to hand in the Classname as a String and call a Factory
> to create the object inside the xtend file.
>
>
> Thanks a lot!!
> Bye Marcel
Re: Hand object as GLOBALVAR into Xtend file via MWE workflow? [message #496502 is a reply to message #496120] Tue, 10 November 2009 11:00 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi,

this is not supported out-of-the-box.

Cheers,
Sven

> Hi!
>
> I want to hand an object into a Xtend file via the MWE workflow. I tried it this way:
>
> MWE:
>
>
> ...
> <component id="resultBuilder" class="com.example.pop.workflow.ResultBuilderFactory">
> </component>
> ...
> <component class="org.eclipse.xpand2.Generator">
> <metaModel class="org.eclipse.internal.xtend.type.impl.java.JavaMetaModel ">
> <typeStrategy class=" org.eclipse.internal.xtend.type.impl.java.beans.JavaBeansStr ategy "/>
> </metaModel>
> <fileEncoding value="Cp1252"/>
> <expand value="com::example::pop::templates::BuildMapper::main FOR popModel"/>
> <genPath value="${targetDir}"/>
> <!-- hand in the mapping model to search in it-->
> <globalVarDef name="mappingModel" value="mappingModel" />
> <!-- configure which implementation of the IResultBuilder should be used -->
> <!--<globalVarDef name="resultBuilder"
> value="resultBuilder" />--> </component>
>
>
>
> As highlighted I create a component with id="resultBuilder" and try to hand that one into the Generator via a globalvar.
> In the xtend file I defined the GLOBALVAR, but the workflow does not know the value="resultBuilder".
>
>
> Does anybody has an idea how to create an object in the workflow and use it in the templates??
>
> A workaround is to hand in the Classname as a String and call a Factory to create the object inside the xtend file.
>
>
> Thanks a lot!!
> Bye Marcel



--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Previous Topic:EMF.JETCompiler fails to Extend EMF model
Next Topic:[Announce] M2T XPAND 0.8.0M3 is available
Goto Forum:
  


Current Time: Thu Oct 10 18:21:56 GMT 2024

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

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

Back to the top