<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=352380115-01062011><FONT face=Arial
color=#0000ff size=2>Ideally:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=352380115-01062011><FONT face=Arial
color=#0000ff size=2>Load the data from a DB and instantiate Java objects with
that. Then generate the rule set using a template.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=352380115-01062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=352380115-01062011><FONT face=Arial
color=#0000ff size=2>The DB data would provide the list of permitted values per
field. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=352380115-01062011><FONT face=Arial
color=#0000ff size=2>The rule results are generated based on the
inputs.</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=352380115-01062011></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2>T<SPAN class=352380115-01062011>his avoids users
having to enter one rule for every single currency and commodity
type (using the example below) when there are only 2 underlying
'rules'.</SPAN></FONT></FONT></FONT></DIV>
<DIV><SPAN class=352380115-01062011></SPAN><SPAN
class=352380115-01062011></SPAN><FONT face=Arial><FONT color=#0000ff><FONT
size=2>I<SPAN class=352380115-01062011>f another currency is then added to the
data in the DB, the new rule will be automatically
generated.</SPAN></FONT></FONT></FONT><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> FrankVhh [via Drools]
[mailto:<a href="/user/SendEmail.jtp?type=node&node=3011200&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>] <BR><B>Sent:</B> 01
June 2011 15:57<BR><B>To:</B> Mullard, Christopher<BR><B>Subject:</B> RE:
[rules-users] Smart Templates<BR></FONT><BR></DIV>
<DIV></DIV>Hi, <BR><BR>Basically, you have 2 options. <BR><BR>1) You call the
function getType() from your .drl file. The function will be executed at
runtime. <BR><BR>header <BR>name <BR>value <BR><BR>TEMPLATE <BR>WHEN <BR>blabla
<BR>THEN <BR>$type.setName($service.getType("@{value}")); <BR><BR>2) Execute the
function <B>before</B> you compile your rules with Rule Templates. I.e.
make sure your objects have an attribute whose value will be set by getType()
and use this value in the Template. <BR><BR>header <BR>name <BR>value <BR>type
<BR><BR>TEMPLATE <BR>WHEN <BR>blabla <BR>THEN <BR>$type.setName("@{type}");
<BR><BR>Hope this helps. <BR><BR>Btw, am I understanding it correctly that you
do not want to use a Decision Table because you are worried about manageability
of your ruleset? And, in stead, you want to create rules directly from Java
objects, using templates. If this is correct, could you tell me how you are
going to manage these objects? <BR><BR>Regards, <BR>Frank <BR><BR><BR>
<BLOCKQUOTE class="quote light-black dark-border-color"
style="PADDING-RIGHT: 1em; PADDING-LEFT: 1em; PADDING-BOTTOM: 0px; BORDER-LEFT: #cccccc 2px solid; PADDING-TOP: 0px">
<DIV class="quote light-border-color">
<DIV class=quote-author style="FONT-WEIGHT: bold">ChrisMu wrote:</DIV>
<DIV class="quote-message shrinkable-quote">Sorry - you're losing me - could
you give an example please? <BR><BR>Thanks
<BR><BR>________________________________ <BR><BR>From: Wolfgang Laun-2 [via
Drools] [mailto:<A
href="/user/SendEmail.jtp?type=node&node=3011148&i=0" target=_top rel="nofollow" link="external">[hidden email]</A>] <BR>Sent: 01 June 2011 15:25
<BR>To: Mullard, Christopher <BR>Subject: Re: [rules-users] Smart Templates
<BR><BR><BR>It's just like a Java static method. Call JAva code if you don't
want to put it all into DRL function, or import from Java in the first place.
Both "import" and "function" can be used in spreadsheets. <BR>-W
<BR><BR><BR><BR>2011/6/1 ChrisMu <[hidden email]> <BR><BR><BR>
Agreed, but this was just an example - if the function
required something more complicated - say a DB lookup, could it be done?
<BR><BR>________________________________ <BR><BR>
From: Wolfgang Laun-2 [via Drools] [mailto:[hidden email] <<A
href="http://user/SendEmail.jtp?type=node&amp;node=3010490&amp;i=0>"
target=_top rel=nofollow
link="external">http://user/SendEmail.jtp?type=node&node=3010490&i=0></A> ]
<BR> Sent: 01 June 2011 12:40 <BR>
To: Mullard, Christopher <BR>
Subject: Re: [rules-users] Smart Templates <BR>
<BR> <BR> If there are
just 2 types (IRDELTA, COMLEASEDELTA) you can add a function that computes
this from the 3-letter name. <BR> -W <BR>
<BR> <BR>
<BR> 2011/6/1 ChrisMu <[hidden email]
<<A href="http://user/SendEmail.jtp?type=node&amp;node=3010275&amp;i=0>"
target=_top rel=nofollow
link="external">http://user/SendEmail.jtp?type=node&node=3010275&i=0></A> >
<BR> <BR><BR>
Possibly. Let me try again with what I'm trying to
achieve. <BR> Given
this excerpt from a decision table: <BR>
<BR>
<BR>
<BR> 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). <BR>
<BR>
When fed with data, this would generate the rules:
<BR> <BR>
when Arg0 = USD, output
RiskType IRDELTA, USD <BR>
when Arg0 = GBP, output RiskType IRDELTA, GBP <BR>
etc <BR>
when Arg0 = XAU, output RiskType COMLEASEDELTA, XAU
<BR> etc <BR>
<BR>
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. <BR>
<BR>
Does that make more sense? <BR>
<BR>
Thanks <BR>
Chris <BR>
<BR><BR>________________________________
<BR><BR> From: Wolfgang
Laun-2 [via Drools] [mailto:[hidden email] <<A
href="http://user/SendEmail.jtp?type=node&amp;node=3010119&amp;i=0>"
target=_top rel=nofollow
link="external">http://user/SendEmail.jtp?type=node&node=3010119&i=0></A> ]
<BR> Sent: 01 June 2011
11:21 <BR> To: Mullard,
Christopher <BR>
Subject: Re: [rules-users] Smart Templates <BR>
<BR>
<BR> 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.
<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>
[hidden email] <<A
href="http://user/SendEmail.jtp?type=node&amp;node=3010097&amp;i=0>"
target=_top rel=nofollow
link="external">http://user/SendEmail.jtp?type=node&node=3010097&i=0></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>
<BR>________________________________ <BR><BR>
If you reply to this email,
your message will be added to the discussion below: <BR>
<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>
<BR> To unsubscribe
from Smart Templates, click here. <BR><BR><BR>
==============================================================================
<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>
==============================================================================
<BR><BR><BR><BR>________________________________ <BR><BR>
View this message in context: RE:
[rules-users] Smart Templates <<A
href="http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010119.html>"
target=_top rel=nofollow
link="external">http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010119.html></A>
<BR> Sent from the
Drools: User forum mailing list archive <<A
href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html>"
target=_top rel=nofollow
link="external">http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html></A>
at Nabble.com. <BR>
<BR>
_______________________________________________ <BR>
rules-users mailing list <BR>
[hidden email] <<A
href="http://user/SendEmail.jtp?type=node&amp;node=3010275&amp;i=1>"
target=_top rel=nofollow
link="external">http://user/SendEmail.jtp?type=node&node=3010275&i=1></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><BR><BR><BR>
_______________________________________________ <BR>
rules-users mailing list <BR> [hidden email]
<<A href="http://user/SendEmail.jtp?type=node&amp;node=3010275&amp;i=2>"
target=_top rel=nofollow
link="external">http://user/SendEmail.jtp?type=node&node=3010275&i=2></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>
<BR>________________________________ <BR><BR>
If you reply to this email, your message will be added to the
discussion below: <BR> <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>
<BR> To unsubscribe from Smart Templates, click
here. <BR><BR><BR>
==============================================================================
<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>
==============================================================================
<BR><BR><BR><BR>________________________________ <BR><BR>
View this message in context: RE: [rules-users] Smart Templates <<A
href="http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010490.html>"
target=_top rel=nofollow
link="external">http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010490.html></A>
<BR> Sent from the Drools: User forum mailing list
archive <<A
href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html>"
target=_top rel=nofollow
link="external">http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html></A>
at Nabble.com. <BR> <BR>
_______________________________________________ <BR>
rules-users mailing list <BR> [hidden email]
<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><BR><BR><BR>_______________________________________________
<BR>rules-users mailing list <BR>[hidden email] <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><BR>________________________________
<BR><BR>If you reply to this email, your message will be added to the
discussion below: <BR><A
href="http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010989.html"
target=_top rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010989.html</A>
<BR>To unsubscribe from Smart Templates, click here <<A
href=""
target=_top rel=nofollow
link="external">
<BR><BR>===============================================================================
<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>===============================================================================
</DIV></DIV></BLOCKQUOTE><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-tp3006479p3011148.html" target="_top" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3011148.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-tp3006479p3011200.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/>