<!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.3059" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=496260017-11052007><FONT face=Arial 
color=#0000ff size=2>Correction... I inadvertantly stated Drools/JRules in my 
previous e-mail when I meant to say Drools/JBRules...</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> rules-users-bounces@lists.jboss.org 
[mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>Shahad 
Ahmed<BR><B>Sent:</B> Friday, May 11, 2007 9:58 AM<BR><B>To:</B> Rules Users 
List<BR><B>Subject:</B> Re: [rules-users] Sequential rules 
algorithm<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Dave,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks for the suggestions. I think giving each rule in the sequence the 
same activation-group (I may have incorrectly&nbsp;said agenda-group in my 
original email) would be a bit like the semaphore you described. When one rule 
in an activation-group fires then all the other rules in the group are disabled. 
I'll give this a try and see what the performance is like. </DIV>
<DIV>&nbsp;</DIV>
<DIV>I'm actively looking into what would be involved in adding a sequential 
mode to Drools. I've been using commercial rules engines like Ilog JRules in 
various projects for a couple of years, but the latest addition to Drools such 
as a BRMS and Ruleflow (with GUI) has definitely made me take Drools much more 
seriously as a "contender" in the business rules space. </DIV>
<DIV>&nbsp;</DIV>
<DIV>Regards,</DIV>
<DIV>Shahad<BR>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=gmail_quote>On 5/11/07, <B class=gmail_sendername>Hamu, 
Dave</B> &lt;<A href="mailto:Dave.Hamu@avnet.com">Dave.Hamu@avnet.com</A>&gt; 
wrote:</SPAN> 
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
  <DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2>Shahad,</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>In 
  addition to using salience, you would also need to use a semaphore.&nbsp; I am 
  not sure JBoss (Mark P., et. al.) have implemented a "sequential mode" which 
  is a feature that is provided by both JRules and Blaze Advisor (among others); 
  however, that would be a nice feature to add to the rules engine.&nbsp; It 
  seems that without massive changes to the product, they could allow a 
  rule-base to be loaded with a "sequential-mode" property in which case, the 
  RETE engine would be disabled. </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>I'm not 
  really up to speed on the LEAPS feature and whether it is being obsoleted... 
  </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>However, I 
  just read Mark's response and I respectfully disagree... I believe that you 
  can simulate sequential processing with salience and a semaphore.&nbsp; 
  Basically, if the rules in question have a salience order and the working 
  memory is changed using a semaphore construct, then any subsequent rules 
  beyond the first rule that fires would not execute.&nbsp; </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>So, if I 
  understand the issue that you have, say that there are many thousands of 
  rules, but you want them evaluated in a specific order.&nbsp; Once the first 
  rule fires, you can mark the data as processed and preclude the execution of 
  any additional 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>There may 
  be other issues from a performance perspective, but ultimately, I think that 
  this workaround is very doable.&nbsp; </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>On the 
  other hand, I applaud Mark's suggestion to have a member of the JRules 
  community take the lead on a sequential-mode algorithm for JRules 4.0...&nbsp; 
  I have been a fan of the Drools/JRules&nbsp;project since the 1.x days and I 
  have witness this project&nbsp;evolve from an intriguing&nbsp;tool-kit to a 
  impressive product and I think that your suggestion is fantastic.&nbsp; 
  Providing this additional feature will further position JRules as a leading 
  contender in the Business Rules space. </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>Regards,</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>Dave</FONT></SPAN></DIV><BR>
  <DIV lang=en-us dir=ltr align=left>
  <HR>
  <FONT face=Tahoma size=2><B>From:</B> <A 
  onclick="return top.js.OpenExtLink(window,event,this)" 
  href="mailto:rules-users-bounces@lists.jboss.org" 
  target=_blank>rules-users-bounces@lists.jboss.org</A> [mailto:<A 
  onclick="return top.js.OpenExtLink(window,event,this)" 
  href="mailto:rules-users-bounces@lists.jboss.org" target=_blank> 
  rules-users-bounces@lists.jboss.org</A>] <B>On Behalf Of </B>Shahad 
  Ahmed<BR><B>Sent:</B> Friday, May 11, 2007 8:34 AM<BR><B>To:</B> <A 
  onclick="return top.js.OpenExtLink(window,event,this)" 
  href="mailto:rules-users@lists.jboss.org" 
  target=_blank>rules-users@lists.jboss.org</A><BR><B>Subject:</B> [rules-users] 
  Sequential rules algorithm<BR></FONT><BR>&nbsp;</DIV>
  <DIV><SPAN class=e id=q_1127bdbe701719f9_1>
  <DIV></DIV>
  <DIV>Does anyone know if there's an efficient&nbsp;way of replicating 
  the&nbsp;Ilog JRules sequential algorithm in Drools?</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>From a (over simplified) users perspective, the <FONT 
  style="BACKGROUND-COLOR: #ffff00">JRules </FONT>sequential algorithm takes an 
  ordered list of rules and fires the first rule in the sequence with a valid IF 
  condition. You can also specify a maximum number of rules in a sequence that 
  may&nbsp;fire. If you have a large number of simple rules to be fired in 
  sequence (often precondition validating rules in a complex ruleflow), then 
  the&nbsp;sequential algorithm gives a significant performance gain over the 
  RETE algorithm in JRules. </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>I can see how you might order a set of rules by salience and give then 
  the same agenda group. Then I assume you will get the equivalent "behaviour" 
  to the Ilog sequential algorithm described above. However, before I try this 
  out, I thought I'd ask&nbsp;if anyone&nbsp;has a view on the performance of 
  this approach; and whether there would be anything to be gained by adding a 
  similar sequential algorithm to Drools. </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>I've seen a few Blog posts in the past that suggest that the Ilog 
  sequential algorithm is similar to LEAPS, but I don't know if that's accurate 
  - also LEAPS&nbsp;will no longer be&nbsp;supported on Drools 4.0 development 
  path. </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Thanks</DIV>
  <DIV>Shahad</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV></SPAN></DIV></DIV><BR>_______________________________________________<BR>rules-users 
  mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)" 
  href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org 
  </A><BR><A onclick="return top.js.OpenExtLink(window,event,this)" 
  href="https://lists.jboss.org/mailman/listinfo/rules-users" 
  target=_blank>https://lists.jboss.org/mailman/listinfo/rules-users</A><BR><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>