Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand/MWE] Scoping of global variables and element properties(Upgrading Xpand and MWE has changed the behaviour of my transformation)
[Xpand/MWE] Scoping of global variables and element properties [message #1219705] Thu, 05 December 2013 13:41
Peter Keller is currently offline Peter KellerFriend
Messages: 14
Registered: October 2009
Junior Member
Dear all,

I am biting the bullet and trying to migrate a transformation/generation project from Indigo to Kepler. I have a workflow that first transforms a model like this:

    <component class="org.eclipse.xtend.XtendComponent">
       ....
       <invoke value="uml2xsd::root( ${modelSlot} )"/>
       <outputSlot value="xmlSchema"/>
    </component>


I then run some Xpand generators that use both the original model and the generated one, like this:
    <component class="org.eclipse.xpand2.Generator">
      .....
      <globalVarDef name="schemaDocs" value="xmlSchema"/>
      <expand value="pythonHelper::pythonGenerator('${srcGen}') FOR ${modelSlot}"/>
      ...
    </component>


In the first transformation, I use storeGlobalVar and setProperty from org::eclipse::xtend::util::stdlib::globalvar and org::eclipse::xtend::util::stdlib::elementprops respectively, and access the values from the subsequent Xpand components. Under Indigo this works fine, but I find that with Kepler the values are lost and getGlobalVar and getProperty just return nulls. Is this change of behaviour intentional, or do I need to do something specific to enable these variables and properties to persist between workflow components?

In my case I can work around the loss of the global variable trivially, but losing the element properties is a real nuisance. The versions that I am using are:

Indigo: MWE, Xpand and Xtend versions 1.2.1
Kepler: MWE version 1.3.1 (installed from the "EMFT MWE-2.4.1" package; Xpand and Xtend versions 1.4.0

Thanks for any hints,
Peter.
Previous Topic:[XPand] Programatically run Workflow
Next Topic:[Xpand] Change Templates at Runtime
Goto Forum:
  


Current Time: Fri Apr 26 23:49:58 GMT 2024

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

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

Back to the top