Using either globalvardef or property in both workflow and Xpand [message #521991] |
Fri, 19 March 2010 14:56 |
MaximeLecourt Messages: 108 Registered: February 2010 Location: France |
Senior Member |
|
|
I want to generate Java code, and packages.
I know how to use a property to create the package when generating.
I know how to use a globalvardef in my XPand template, via Xtend.
But I'd like to use only one value, either a globalvar or a property in both my workflow and my Xpand template (or Xtend).
How can I do that ?
Regards,
Maxime
One day I shall master M2T, but that day has yet to come...
[Updated on: Fri, 19 March 2010 14:56] Report message to a moderator
|
|
|
Re: Using either globalvardef or property in both workflow and Xpand [message #522118 is a reply to message #521991] |
Sat, 20 March 2010 08:51 |
|
without using globalvar this could look like this
...
<property name="package" value="thepackage" />
...
<expand value="template::Template::main('${package}') FOR model" />
«DEFINE main(String package) FOR Model»
«EXPAND javaClass(package) FOREACH entities()»
«ENDDEFINE»
«DEFINE javaClass(String package) FOR Entity»
«FILE package+"/"+name+".java"»
using globalvars it would look like
<globalVarDef name="package" value="'thepackage'"/>
«DEFINE javaClass FOR Entity»
«FILE ((String) GLOBALVAR package)+"/"+name+".java"»
you should find both in the docs
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04533 seconds