Possibly. Let me try again with what I'm trying to
achieve.
Given this excerpt from a decision
table:
Basically I want to be able to specify a template that says
'If Arg0 is a currency, output RiskType IRDELTA (and currency), if Arg0 is a
commodity (begins with 'X') then output RiskType COMLEASEDELTA (and
commodity).
When fed with data, this would generate
the rules:
when Arg0 = USD, output RiskType IRDELTA,
USD
when Arg0 = GBP,
output RiskType IRDELTA, GBP
etc
when Arg0 = XAU, output RiskType COMLEASEDELTA,
XAU
etc
In this way theRiskType name is inferred from the data
when the rules are generated. It can be done by explicitly stating all possible
combinations as in the decision table above but that gets tedious quickly. I
wanted to have a more general template that could generate all the specific
rules instances.
Does that make more
sense?
Thanks
Chris
I don't want to confuse you, but have you considered not using
templates at all? If you can generate N rules from N objects containing
different literals for matching a fact or for updating a fact field, then you
can achieve the same thing with a single rule and additional facts containing
those literal values.
rule "one 4 all"
when
 Â
Service( $name: name, $value: value )
  $sb: ServiceBean( name
== $name, value == $value )
then
  # RiskType ... is
what?
  ...$value..., ...$sb.getType()...
end
-W
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
View this message in context: RE: [rules-users] Smart Templates
Sent from the Drools: User forum mailing list archive at Nabble.com.