<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=211462812-01062011><FONT face=Arial 
color=#0000ff size=2>Agreed, but this was just an example - if the function 
required something more complicated - say a DB lookup, could it be 
done?</FONT></SPAN></DIV><BR>
<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=3010490&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>] <BR><B>Sent:</B> 01 
June 2011 12:40<BR><B>To:</B> Mullard, Christopher<BR><B>Subject:</B> Re: 
[rules-users] Smart Templates<BR></FONT><BR></DIV>
<DIV></DIV>If there are just 2 types (<SPAN><FONT face=Arial color=#0000ff 
size=2>IRDELTA, </FONT></SPAN><SPAN><SPAN><SPAN><FONT face=Arial color=#0000ff 
size=2>COMLEASEDELTA) you can add a function that computes this from the 
3-letter name.</FONT></SPAN></SPAN></SPAN><BR>-W<BR><BR><BR>
<DIV class=gmail_quote>2011/6/1 ChrisMu <SPAN dir=ltr>&lt;<A 
href="/user/SendEmail.jtp?type=node&amp;node=3010275&amp;i=0" target=_top rel="nofollow" link="external">[hidden email]</A>&gt;</SPAN><BR>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-RIGHT: 1em; PADDING-LEFT: 1em; PADDING-BOTTOM: 0px; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: #cccccc 2px solid; PADDING-TOP: 0px">
  <DIV dir=ltr align=left><SPAN><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><FONT face=Arial color=#0000ff size=2>Given this 
  excerpt from a decision table:</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2><IMG 
  src=""></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN><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><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>When fed 
  with data, this would generate the&nbsp;rules:</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>when Arg0 
  = USD, output RiskType IRDELTA, USD</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><SPAN><FONT face=Arial color=#0000ff size=2>when 
  Arg0 = GBP, output RiskType IRDELTA, GBP</FONT></SPAN></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><SPAN><FONT face=Arial color=#0000ff 
  size=2>etc</FONT></SPAN></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><SPAN><SPAN><FONT face=Arial color=#0000ff 
  size=2>when Arg0 = XAU, output RiskType COMLEASEDELTA, 
  XAU</FONT></SPAN></SPAN></SPAN></DIV>
  <DIV><SPAN></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>&nbsp;</DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2>I<SPAN>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></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN>Does that make 
  more sense?</SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><FONT 
  size=2><SPAN></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><FONT 
  size=2><SPAN>Thanks</SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><FONT 
  size=2><SPAN>Chris</SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><FONT 
  size=2><SPAN></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
  <DIV><BR></DIV>
  <DIV lang=en-us dir=ltr align=left>
  <HR>
  <FONT face=Tahoma size=2><B>From:</B> Wolfgang Laun-2 [via Drools] [mailto:<A 
  href="http://user/SendEmail.jtp?type=node&amp;node=3010119&amp;i=0" 
  target=_blank 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>Â&nbsp;Â&nbsp; Service( $name: name, $value: value 
  )<BR>Â&nbsp;Â&nbsp; $sb: ServiceBean( name == $name, value == $value 
  )<BR>then<BR>Â&nbsp;Â&nbsp; # RiskType ... is what?<BR>Â&nbsp;Â&nbsp; 
  ...$value..., ...$sb.getType()... 
  <BR>end<BR><BR>-W<BR><BR><BR>_______________________________________________ 
  <BR>rules-users mailing list <BR><A 
  href="http://user/SendEmail.jtp?type=node&amp;node=3010097&amp;i=0" 
  target=_blank rel="nofollow" link="external">[hidden email]</A> <BR><A 
  href="https://lists.jboss.org/mailman/listinfo/rules-users" target=_blank 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: rgb(68,68,68); font-size-adjust: none; font-stretch: normal">
  <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=_blank 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: rgb(102,102,102); font-size-adjust: none; font-stretch: normal">To 
  unsubscribe from Smart Templates, <A target=_top rel="nofollow" link="external">click here</A>. </DIV><BR>
  <P class=MsoNormal><SPAN lang=EN-US 
  style="FONT-SIZE: 8pt; 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=_blank rel="nofollow" link="external">http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html</A><BR>==============================================================================</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" 
  target=_blank rel="nofollow" link="external">RE: [rules-users] Smart 
  Templates</A><BR>Sent from the <A 
  href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html" 
  target=_blank rel="nofollow" link="external">Drools: User forum mailing list 
  archive</A> at 
  Nabble.com.<BR><BR>_______________________________________________<BR>rules-users 
  mailing list<BR><A 
  href="/user/SendEmail.jtp?type=node&amp;node=3010275&amp;i=1" target=_top rel="nofollow" link="external">[hidden email]</A><BR><A 
  href="https://lists.jboss.org/mailman/listinfo/rules-users" target=_blank rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</A><BR><BR></BLOCKQUOTE></DIV><BR><BR>_______________________________________________ 
<BR>rules-users mailing list <BR><A 
href="/user/SendEmail.jtp?type=node&amp;node=3010275&amp;i=2" 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-tp3006479p3010275.html" target="_top" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010275.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-tp3006479p3010490.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/>