You could write a DSLR as
Set the rate of interest to @{tempvar}
and it should expand into
$loan.setRateOfInterest( @{tempvar} )
And I think that the DSL expander would ignore the template header,
parameter definition and the start and end template lines.
But I'd hate to debug this rule concoction process.
If you use templates, consider the template as a very-high-level DSL
statement, and forget about the DSL expansion.
IMHO, it's a myth that DSLs enable non-programmers to write anything but
trivial (or very simple) rules.
Thanks for the explanation!
Wolfgang
2012/1/5 Michael Anstis <michael.anstis(a)gmail.com>
Wolfgang,
I suspect the need arose from within Guvnor.
You can define a DSL sentence such "[then]Set the rate of interest to
{rex} = $loan.setRateOfInterest( {rex} )
Currently in Guvnor you can only enter literal values for DSL variables
whereas it'd be good to be able to specify {rex} as a template key so
multiple rules, based on DSLs, can be generated from the template data. I
am unsure if drools-expert Templates support interpolation of DSLs.
With kind regards,
Mike
On 5 January 2012 13:10, srinivasasanda <srinivasasanda(a)gmail.com> wrote:
> Thank you Manstis for quick response.
>
> Regards,
> Srinivas
>
> --
> View this message in context:
>
http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3634749.html
> Sent from the Drools: User forum mailing list archive at
Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users