<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.6082" name=GENERATOR>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><FONT face=Arial
color=#0000ff size=2>Possibly. Let me try again with what I'm trying to
achieve.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><FONT face=Arial
color=#0000ff size=2>Given this excerpt from a decision
table:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><FONT face=Arial
color=#0000ff size=2><IMG src="/attachment/3010119/0/Outlook.jpg"></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><FONT face=Arial
color=#0000ff size=2>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).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><FONT face=Arial
color=#0000ff size=2>When fed with data, this would generate
the rules:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><FONT face=Arial
color=#0000ff size=2>when Arg0 = USD, output RiskType IRDELTA,
USD</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><SPAN
class=893012410-01062011><FONT face=Arial color=#0000ff size=2>when Arg0 = GBP,
output RiskType IRDELTA, GBP</FONT></SPAN></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><SPAN
class=893012410-01062011><FONT face=Arial color=#0000ff
size=2>etc</FONT></SPAN></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=893012410-01062011><SPAN
class=893012410-01062011><SPAN class=893012410-01062011><FONT face=Arial
color=#0000ff size=2>when Arg0 = XAU, output RiskType COMLEASEDELTA,
XAU</FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=893012410-01062011></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2>etc</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2>I<SPAN
class=893012410-01062011>n 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.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=893012410-01062011></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=893012410-01062011>Does that make more
sense?</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=893012410-01062011></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=893012410-01062011>Thanks</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=893012410-01062011>Chris</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=893012410-01062011></SPAN></FONT></FONT></FONT> </DIV>
<DIV><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Wolfgang Laun-2 [via Drools]
[mailto:<a href="/user/SendEmail.jtp?type=node&node=3010119&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>] <BR><B>Sent:</B> 01
June 2011 11:21<BR><B>To:</B> Mullard, Christopher<BR><B>Subject:</B> Re:
[rules-users] Smart Templates<BR></FONT><BR></DIV>
<DIV></DIV>I don't want to confuse you, but have you considered <I>not </I>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 <I>and additional facts containing
those literal values.</I><BR><BR>rule "one 4 all"<BR>when<BR>Â Â
Service( $name: name, $value: value )<BR>Â Â $sb: ServiceBean( name
== $name, value == $value )<BR>then<BR>Â Â # RiskType ... is
what?<BR>Â Â ...$value..., ...$sb.getType()...
<BR>end<BR><BR>-W<BR><BR><BR>_______________________________________________
<BR>rules-users mailing list <BR><A
href="/user/SendEmail.jtp?type=node&node=3010097&i=0" target=_top rel="nofollow" link="external">[hidden email]</A> <BR><A
href="https://lists.jboss.org/mailman/listinfo/rules-users" target=_top rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</A><BR><BR><BR>
<HR color=#cccccc noShade SIZE=1>
<DIV style="FONT: 12px tahoma,geneva,helvetica,arial,sans-serif; COLOR: #444">
<DIV style="FONT-WEIGHT: bold">If you reply to this email, your message will be
added to the discussion below:</DIV><A
href="http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010097.html" target="_top" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010097.html</A>
</DIV>
<DIV
style="MARGIN-TOP: 0.4em; FONT: 11px tahoma,geneva,helvetica,arial,sans-serif; COLOR: #666">To
unsubscribe from Smart Templates, <A
href="" target="_top" rel="nofollow" link="external">click
here</A>. </DIV> <BR/><p class=MsoNormal><span lang=EN-US style='font-size:8.0pt;font-family:Courier'>==============================================================================<br>Please access the attached hyperlink for an important electronic communications disclaimer:<br><a href="http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html" target="_top" rel="nofollow" link="external">http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html</a><br>==============================================================================<o:p></o:p></span></p> <br>
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010119.html">RE: [rules-users] Smart Templates</a><br/>
Sent from the <a href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html">Drools: User forum mailing list archive</a> at Nabble.com.<br/>