<font face="Arial, Helvetica, sans-serif">Hi,<br>


<br>


I'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'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: "Row 1 DecisionTableName", "Row 2 DecisionTableName" ... "Row N DecisionTableName", so I create a <b>RuleNameEndsWithAgendaFilter </b>agenda filter to only accept rules that ends with "DecisionTableName". 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'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> "DefaultAgenda.fireAllRules(AgendaFilter, fireLimit)"</b> and with the <b>"DefaultAgenda.fireNextItem(AgendaFilter)"</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 id='MAILCIAMA046-5bad49a31b6a5d' class='aol_ad_footer'><br/><font style="color:black;font:normal 10pt arial,san-serif;"> <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"> See yours in just 2 easy steps!</a></b></font> </div>