<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:inherit;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Palatino Linotype";
        panose-1:2 4 5 2 5 5 5 3 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I’m not sure you can nest rules, you are thinking too
procedural, but you can extend conditions/lhs from other rules. Here is an
example from the test case in the drools source “extend_rule_test.drl”
that may help you.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>rule</span></b><span style='font-size:
10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New";color:green'>"test rule 1"</span><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>enabled</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>false</span></b><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>when</span></b><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>
c: Cheese( type == </span><span style='font-size:10.0pt;font-family:"Courier New";
color:green'>"stilton"</span><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> )</span><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>then</span></b><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> list.add(
</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>new</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> String (</span><span
style='font-size:10.0pt;font-family:"Courier New";color:green'>"rule
1"</span><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>) ); </span><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>end</span></b><span style='font-size:
10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>rule</span></b><span style='font-size:
10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New";color:green'>"test rule 2"</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> <span
style='background:green;mso-highlight:green'>extends</span> </span><span
style='font-size:10.0pt;font-family:"Courier New";color:green'>"test rule
1"</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>enabled</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>false</span></b><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>when</span></b><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>
Cheese( price <= 6.00) </span><b><span style='font-size:10.0pt;font-family:
"Courier New";color:#960000'>from</span></b><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> c</span><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>then</span></b><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> list.add(
</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>new</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> String (</span><span
style='font-size:10.0pt;font-family:"Courier New";color:green'>"rule
2"</span><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>) ); </span><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>end</span></b><span style='font-size:
10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>rule</span></b><span style='font-size:
10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New";color:green'>"test rule 3"</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> <span
style='background:green;mso-highlight:green'>extends</span> </span><span
style='font-size:10.0pt;font-family:"Courier New";color:green'>"test rule
2"</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>when</span></b><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>
Cheese( price > 1.00 ) </span><b><span style='font-size:10.0pt;font-family:
"Courier New";color:#960000'>from</span></b><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> c</span><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>then</span></b><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> list.add(
</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>new</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> String (</span><span
style='font-size:10.0pt;font-family:"Courier New";color:green'>"rule
3"</span><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>) ); </span><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'>end<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'><o:p> </o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'>Rule 1 & 2 are disabled, but rule 3 in the rete network will
have all 3 LHS (conditions). So the above would render…<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'><o:p> </o:p></span></b></p>
<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>rule</span></b><span style='font-size:
10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New";color:green'>"test rule 3"</span><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>when</span></b><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>c: Cheese( type == </span><span
style='font-size:10.0pt;font-family:"Courier New";color:green'>"stilton"</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> )<o:p></o:p></span></p>
<p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>Cheese( price <= 6.00) </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>from</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> c<o:p></o:p></span></p>
<p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>Cheese( price > 1.00 ) </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>from</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> c<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>then</span></b><span style='font-size:
10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> list.add(
</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>new</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> String (</span><span
style='font-size:10.0pt;font-family:"Courier New";color:green'>"rule
3"</span><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>) ); </span><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'>end<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'><o:p> </o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'>This was modeled more after how a programming language would have
one class extend another, but it only inherits the LHS.<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'><o:p> </o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'>-Michael<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'><o:p> </o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'>P.S. I believe this is available only in trunk at this time, but
will be out with the next 5.x release.<o:p></o:p></span></b></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
rules-dev-bounces@lists.jboss.org [mailto:rules-dev-bounces@lists.jboss.org] <b>On
Behalf Of </b>David Sinclair<br>
<b>Sent:</b> Wednesday, November 12, 2008 8:50 AM<br>
<b>To:</b> m_dilipkumar2006@yahoo.co.in; Rules Dev List<br>
<b>Subject:</b> Re: [rules-dev] Regarding Nested Rules in Drools 4.0.7<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>I think u are thinking about
this in the wrong sense. You don't want to call another rule. You can assert a
fact that will cause that other rule to fire.<o:p></o:p></p>
<div>
<p class=MsoNormal>On Wed, Nov 12, 2008 at 9:45 AM, M.DILIP KUMAR <<a
href="mailto:m_dilipkumar2006@yahoo.co.in">m_dilipkumar2006@yahoo.co.in</a>>
wrote:<o:p></o:p></p>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0>
<tr>
<td valign=top style='padding:0in 0in 0in 0in;font-style:inherit;font-variant:
inherit;font-weight:inherit;font-size:inherit;line-height:inherit;font-size-adjust: inherit;
font-stretch: inherit'>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'><br>
Hi All,<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'>
I got many idea by using this group. Now i want one clarification regarding
Nested rule.<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'>If any one
having sample code for nested Rule means Pls send reply along this mail.<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'>Acutally i
want rule like <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'>Rule :
"nested Rule"<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'> When <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'>
#Condition is true<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'> Then <br>
CALL another RULE ...!!!!<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'>
Here i want pass some argument to that nested rule<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'> is it
possible ? <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'>End<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'>Help me
regarding this and send sample code if possible please<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'> <o:p></o:p></span></p>
</div>
<div>
<div>
<div>
<p class=MsoNormal><b><i><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#AA4D4E'>Defeat yourself today!</span></i></b><b><i><span
style='font-family:"inherit","serif";color:blue'><o:p></o:p></span></i></b></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal><b><i><span style='font-size:10.0pt;font-family:"Palatino Linotype","serif";
color:maroon'>____________________________</span></i></b><b><i><span
style='font-size:10.0pt;font-family:"inherit","serif";color:black'> </span></i></b><b><i><span
style='font-family:"inherit","serif";color:blue'><o:p></o:p></span></i></b></p>
</div>
</div>
<p class=MsoNormal><span style='font-family:"inherit","serif"'>
<b>Error! Filename not specified.</b><b><i><span style='color:#C49B71'>DILIP
KUMAR.M</span></i></b><o:p></o:p></span></p>
</div>
</td>
</tr>
</table>
<p class=MsoNormal><o:p> </o:p></p>
<div class=MsoNormal align=center style='text-align:center'>
<hr size=1 width="100%" align=center>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'>Add more friends to your
messenger and enjoy! <a
href="http://in.rd.yahoo.com/tagline_messenger_6/*http:/messenger.yahoo.com/invite/"
target="_blank">Invite them now.</a><br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><o:p></o:p></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>