<br> Well found! Thanks for reporting. I will fix and let you know.<br><br> Edson<br><br><div class="gmail_quote">2009/2/23 <span dir="ltr"><<a href="mailto:guyt1122@aim.com">guyt1122@aim.com</a>></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'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. 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. It seems to always works if there is a single decision table under the package. 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. 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. 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. 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>
public int <b>fireAllRules</b>(AgendaFilter agendaFilter,<br>
int fireLimit) {<br>
this.halt.set( false );<br>
int fireCount = 0;<br>
while ( continueFiring( fireLimit ) && fireNextItem( agendaFilter ) ) {<br>
fireCount++;<br>
<b>fireLimit = updateFireLimit( fireLimit );</b><br>
this.workingMemory.executeQueuedActions();<br>
}<br>
if ( this.focusStack.size() == 1 && getMainAgendaGroup().isEmpty() ) {<br>
// the root MAIN agenda group is empty, reset active to false, so it can receive more activations.<br>
getMainAgendaGroup().setActive( false );<br>
}<br>
return fireCount;<br>
}<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> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>