<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT face=Arial
color=#0000ff size=2>Erm, Rule Flow springs immediately to
mind.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT face=Arial
color=#0000ff size=2>Or you can use semaphore Facts yourself - but you're
re-inventing the (Rule Flow) wheel.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT face="Courier New"
color=#0000ff size=2>rule "rule 1"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>when</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>condition is true</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>then</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>insert(new SemaphoreFact());</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>end</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT face="Courier New"
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT face="Courier New"
color=#0000ff size=2>rule "rule 2"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>when</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>SemaphoreFact()</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>Some other conditions are true;</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>then</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>action</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>end</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT face="Courier New"
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT face="Courier New"
color=#0000ff size=2>rule "rule 3"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>when</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>Even more conditions</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>then</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>action</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT
face="Courier New"><FONT size=2> <FONT
color=#0000ff>end</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=713035409-22052008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>Vishal
Deshmukh<BR><B>Sent:</B> 22 May 2008 10:31<BR><B>To:</B>
rules-users@lists.jboss.org<BR><B>Subject:</B> [rules-users] Nested
Rules<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV>I am using Drools 4.0.4 with Eclipse 3.2. I m much happy with the
results. But now my application needs nested loops..</DIV>
<DIV>Can i write nested rules like </DIV>
<DIV> </DIV>
<DIV>rule "rule 1 " // if
condition of rule 1 is true then only execute rule 2 other wise skip it</DIV>
<DIV>when</DIV>
<DIV> condition is true</DIV>
<DIV>then</DIV>
<DIV> execute rule2</DIV>
<DIV> </DIV>
<DIV>rule "rule 2 "</DIV>
<DIV>when</DIV>
<DIV> condition is true</DIV>
<DIV>then</DIV>
<DIV> action</DIV>
<DIV> </DIV>
<DIV>rule "rule 3"</DIV>
<DIV>when </DIV>
<DIV> condition is true</DIV>
<DIV>then</DIV>
<DIV> action</DIV>
<DIV> </DIV>
<DIV>Thanks and Rgards</DIV>
<DIV> </DIV>
<DIV>Vishal</DIV>
<P></P></BLOCKQUOTE></BODY></HTML>