<br>&nbsp;&nbsp; Well found! Thanks for reporting. I will fix and let you know.<br><br>&nbsp;&nbsp; Edson<br><br><div class="gmail_quote">2009/2/23  <span dir="ltr">&lt;<a href="mailto:guyt1122@aim.com">guyt1122@aim.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font face="Arial, Helvetica, sans-serif">Hi,<br>


<br>


I&#39;m using <b>Drools 5.0M5</b> and <b>Web Guided decision tables</b>. What I want to be able to do is to create several decision tables under one package and then using an Agenda filter and firelimit option to fire one rule from a single decision table that I&#39;m filtering.<br>

<br>
What I did to try and accomplish this is the following.&nbsp; I notice that each row in the decision table has a rule name that matches the following format: &quot;Row 1 DecisionTableName&quot;, &quot;Row 2 DecisionTableName&quot; ... &quot;Row N DecisionTableName&quot;, so I create a <b>RuleNameEndsWithAgendaFilter </b>agenda filter to only accept rules that ends with &quot;DecisionTableName&quot;. Then I call on the<b> StatefulSession.fireAllRules(AgendaFilter, fireLimit)</b> with my agenda filter and a <b>firelimit </b>of 1.<br>

<br>
What I&#39;m noticing is some inconsistent behavior were the logic would work sometimes and not other times.&nbsp; It seems to always works if there is a single decision table under the package.&nbsp; After debuging the<b> StatefuleSession.fireAllRules(AgendaFilter, firelimit)</b>, I tracked down the issue to the way the <b>firelimit </b>count updated in the<b> &quot;DefaultAgenda.fireAllRules(AgendaFilter, fireLimit)&quot;</b> and with the <b>&quot;DefaultAgenda.fireNextItem(AgendaFilter)&quot;</b>.<br>

<br>
I may have misunderstood what the <b>firelimit </b>meant but it seems like the while loop in the <b>fireAllRules </b>always decrements the firelimit count regardless if the <b>DefaultAgenda.fireNextItem(AgendaFilter)</b> calls the <b>fireActivation </b>method or the <b>fireActivationCancelled</b> method.&nbsp; I would perfer the <b>firelimit </b>count to only get decremented if the <b>fireNextItem </b>results in a <b>fireActivation </b>method call and I think the logic will work for my scenario.&nbsp; Looking at the documenation, it look like the logic is geared towards focusing agenda groups, but I do not want to have maintain a agenda group column on my decision tables.&nbsp; I want each decision table to be an agenda group automagically.<br>



<br>
I have included the following code showing the <b>firelimit </b>is always updated in the while loop below:<br>
<br>
&nbsp;&nbsp;&nbsp; public int <b>fireAllRules</b>(AgendaFilter agendaFilter,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int fireLimit) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.halt.set( false );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int fireCount = 0;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while ( continueFiring( fireLimit ) &amp;&amp; fireNextItem( agendaFilter ) ) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fireCount++;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>fireLimit = updateFireLimit( fireLimit );</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.workingMemory.executeQueuedActions();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( this.focusStack.size() == 1 &amp;&amp; getMainAgendaGroup().isEmpty() ) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // the root MAIN agenda group is empty, reset active to false, so it can receive more activations.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getMainAgendaGroup().setActive( false );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return fireCount;<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
<br>


Thanks,<br>


Guy<br>


</font>
<div><br><font style="color: black; font-family: arial,san-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> <hr style="margin-top: 10px;">
<b>A Good Credit Score is 700 or Above. <a href="http://pr.atwola.com/promoclk/100126575x1218822736x1201267884/aol?redir=http:%2F%2Fwww.freecreditreport.com%2Fpm%2Fdefault.aspx%3Fsc%3D668072%26hmpgID%3D62%26bcd%3DfebemailfooterNO62" target="_blank"> See yours in just 2 easy steps!</a></b></font> </div>

<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a 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><br clear="all"><br>-- <br> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>