Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [xpand + xtend]: how to access MWE workflow properties in Xpand templates, with xtend 2.17.x?
[xpand + xtend]: how to access MWE workflow properties in Xpand templates, with xtend 2.17.x? [message #1805607] Thu, 18 April 2019 15:00 Go to next message
Mauro Antonaci is currently offline Mauro AntonaciFriend
Messages: 12
Registered: February 2010
Junior Member
I'm facing a problem tryin to migrate some Xpand-based generator projects from oxygen to eclipse-2019-03 release of eclipse modeling platform.

Until Oxygen release I used to access some MWE workflow properties from Xpand templates using Xtend standard utility library (org.eclipse.xtend.util.stdlib plugin), as described in the following example:

In the MWE workflow definition a bundle of properties is loaded from a properties file, and then the generator is called:

<workflow>
...
        <component class="org.eclipse.xtend.util.stdlib.PropertiesReader">
  		<propertiesFile value="${propertiesFile}"/>
	</component>
...
    <!-- call the generator... -->
</workflow>


In Xpand templates an Xtend (java) extension is used to access property values:

...
String getProperty(String name) : JAVA
  org.eclipse.xtend.util.stdlib.PropertiesExtension.getProperty(java.lang.String);

String getGenerateAppModulesProperty() :
	if getProperty("generate-appmodules") != null then
		""+getProperty("generate-appmodules")
	else
		""; 
...


I don't know if this is the best way to accomplish the task, but it worked since 2009 until oxygen release (with Xtend v.2.2.x).

Tryin to migrate to eclipse-2019-03, and with xtend v. 2.17 I noticed that there is no more xtend.util.stdlib plugin, so that method does not work anymore.

I need some suggestion to find an alternative way.
Re: [xpand + xtend]: how to access MWE workflow properties in Xpand templates, with xtend 2.17.x? [message #1805614 is a reply to message #1805607] Thu, 18 April 2019 19:14 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 684
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Xpand is in version 2.2 for years, the plugin org.eclipse.xtend.util.stdlib is still available. You seem to have an inconsistent target platform. Check that and you should be able to use the current extensions further.
Re: [xpand + xtend]: how to access MWE workflow properties in Xpand templates, with xtend 2.17.x? [message #1805627 is a reply to message #1805614] Fri, 19 April 2019 07:35 Go to previous message
Mauro Antonaci is currently offline Mauro AntonaciFriend
Messages: 12
Registered: February 2010
Junior Member
Karsten Thoms wrote on Thu, 18 April 2019 21:14
Xpand is in version 2.2 for years, the plugin org.eclipse.xtend.util.stdlib is still available. You seem to have an inconsistent target platform. Check that and you should be able to use the current extensions further.


Thank you for the suggestion. Now I explicitly installed Xpand 2.2 (with Xtend 2.2) from a local update site (still available here) and now it works again.
Previous Topic:[Acceleo] proper signature of template
Next Topic:Invoke method cannot used for OrderedSet ?
Goto Forum:
  


Current Time: Mon May 27 08:16:02 GMT 2019

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

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

Back to the top