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 Zarnekow
Messages: 2832
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 Efftinge
Messages: 1762
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


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Previous Topic:EMF.JETCompiler fails to Extend EMF model
Next Topic:[Announce] M2T XPAND 0.8.0M3 is available
Goto Forum:
  


Current Time: Sat Sep 20 16:19:52 GMT 2014

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

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