<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000'><P>You can do this using the "extends" keyword in your rule.</P>
<P>&nbsp;</P>
<P><FONT face="Courier New">Rule "shopping cart total exceeds 4000, give 50% discount"<BR>&nbsp; &nbsp; &nbsp; &nbsp;when<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;condition&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;then<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>end</FONT></P>
<P><FONT face="Courier New"></FONT>&nbsp;</P>
<P><FONT face="Courier New">Rule "if order between 6 to 9 pm give additional discount of 20 %" extends "shopping cart total exceeds 4000, give 50% discount"<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;condition&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;then<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action&gt;<BR>end</FONT></P>
<P><FONT face="Courier New"></FONT>&nbsp;</P>
<P><FONT face="Courier New">You can also disable the first rule and just use "extends" to limit the amount of duplicate conditions in your rules. Note extends basically copies the conditions from the first rule to what is being extended, but I believe it will do what you are trying to do.</FONT></P>
<P><BR><BR>Michael Rhoden<BR>VP - IT Development<BR>Franklin American Mortgage Company<BR>Direct: 615-778-1117<BR>Fax: 615-778-2766<BR>Email: mrhoden@franklinamerican.com <BR><BR>----- Original Message -----<BR>From: "Pardeep Ruhil" &lt;Pardeep.Ruhil@lntinfotech.com&gt;<BR>To: rules-users@lists.jboss.org<BR>Sent: Wednesday, August 12, 2009 2:44:38 PM GMT -06:00 US/Canada Central<BR>Subject: [rules-users] How to create nested rules in Drool Guvnor<BR><BR></P><FONT face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=2>
<DIV><FONT face="Default Monospace,Courier New,Courier,monospace">Hi,<BR>Thanks for replying.<BR><BR>I have a scenario like<BR>Rule "shopping cart total exceeds 4000, give 50% discount"<BR>&nbsp; &nbsp; &nbsp; &nbsp;when<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;condition&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;then<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;call Rule"if order is &nbsp;between 6 to 9 pm, give additional <BR>discount of 20 %"<BR>end<BR>Rule "if order between 6 to 9 pm give additional discount of 20 %"<BR>&nbsp; &nbsp; &nbsp; &nbsp;when<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;condition&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;then<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action&gt;<BR>end<BR><BR>..............<BR>Also i have a &nbsp;query like, Can we make rule like this<BR><BR>Rule "shopping cart total exceeds 4000 give 50% discount"<BR>&nbsp; &nbsp; &nbsp; &nbsp;when<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;condition&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;then<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action&gt;<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Rule "if order between 6 to 9 pm give additional discount <BR>of 20 %"<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;when <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;condition&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;then<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<BR>end<BR><BR>Can we make rules like above?</FONT><BR></DIV>
<DIV><BR>
<DIV>Thanks &amp; Regards<BR><BR>Pardeep Ruhil<BR></DIV></DIV></FONT>This email may contain confidential or privileged information for the intended recipient(s). If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system. Thanks<BR><BR>______________________________________________________________________<BR><BR>_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users </div></body></html>