|
Re: Doubt in Xpand template [message #498096 is a reply to message #498081] |
Sat, 14 November 2009 12:49 |
|
hello zakir.
this is afaik not possible since xpand ist stacially typed and wants to check at edit time if the definition you want to call exists for the type you want to call it.
can you tell more about your requirements? maybe there are some other solutions like aop for your problem
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Re: Doubt in Xpand template [message #498130 is a reply to message #498126] |
Sat, 14 November 2009 20:19 |
|
Hello Zakir,
one thing that comes into my mind is to call XpandFacade using a java extension.
another possibility is to move the problem to the workflow using the cartrige mechanisms or moving to template names to properties
e.g. (from a oaw 4.3.1 sample)
<property name="template" value="template::Template::main" />
<!-- generate code -->
<component class="org.openarchitectureware.xpand2.Generator">
<metaModel idRef="mm"/>
<expand
value="${template} FOR model" />
<outlet path="${src-gen}" >
<postprocessor class="org.openarchitectureware.xpand2.output.JavaBeautifier" />
</outlet>
</component>
Regards Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Re: Doubt in Xpand template [message #498162 is a reply to message #498161] |
Sun, 15 November 2009 09:46 |
|
so why don't you call a java excetion as replacement
for
«EXPAND this.definitionName FOREACH entities()»
that invokes the template dynamically
«invoketemplate(this.definitionName, entities())»
with
XpandFacade facade = XpandFacade.create(execCtx);
facade.evaluate("template::Start::main", inputModel);
replaced by someting like
XpandFacade facade = XpandFacade.create(execCtx);
facade.evaluate(templateName, inputModel);
in the java extenstion
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[Updated on: Sun, 15 November 2009 09:52] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03401 seconds