<br> Brian,<br><br> I'm not aware of any problem with AgendaFilters, so if you think it is indeed a problem, may I ask you please to open a JIRA?<br><br> Having said that, I personally think that AgendaFilters should be used only for test purposes. To implement phased rule firing like the ones you are doing, I strongly recommend you use agenda-groups. You can control the rules that will fire simply by calling setFocus() method on working memory. You can still let rule names to have the prefixes you are using just for documentation purposes, but I discourage you to use them as a control mechanism.
<br> Ruleflow can also be used, but for your use case, I think agenda-groups will be enough.<br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2007/8/22, Brian Enderle <<a href="mailto:brianke@gmail.com">
brianke@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I have many rules in which I have named the various rules by the level at
<br>which the rules are to be fired, for instance:<br><br>rule "LevelOne: Name cannot be null"<br> when<br> Person(firstNm == null)<br> then<br> <log an error><br>end<br><br>rule "LevelTwo: Street cannot be null"
<br> when<br> Person(street== null)<br> then<br> <log an error><br>end<br><br>Within my Java code I first insert all objects into a statefulSession, then<br>add all my globals. I then use a switch statement to call different methods
<br>to perform the various levels of validation (ie: performLevelOneValidation(),<br>performLevelTwoValidation(), etc.). Each of these methods calls a common<br>method, performValidation(String validationLevel) which I want to use to fire
<br>the rules of just the validation level supplied. I am doing this with:<br><br>statefulSession.fireAllRules(new RuleNameStartsWithAgendaFilter<br>(validationLevel));<br><br>In some cases I need to perform multiple levels of validation (if anything
<br>over Level One validation is called, all preceding levels also need to be<br>validated) and need to perform them in order for reporting purposes. My code<br>correctly calls my performaValidation() method with the correct
<br>validationLevel but the only rules that fire are those with "LevelOne" in the<br>rule name.<br><br>I know the data, the rules, the globals, etc are all present for firing rules<br>in a level other than level one and that I should get some mathces to my rules
<br>but I am not getting anything to match outside of Level One.<br><br>I can only assume that the rules other than Level One are not firing and that<br>I am missing something within my code that fires the rules for other levels.
<br>Am I misunderstanding how the AgendaFilter works? Should I be using something<br>else like agenda-group to accomplish this segregation of rules?<br><br>Also, my rules and data objects do not change as the rules are run. I simply
<br>display a list of errors found. Would it benefit me to use sequential mode<br>and would this help me in trying to segerate the rules into various levels?<br><br>Thanks in advance,<br>Brian Enderle<br><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">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @
<a href="http://www.jboss.com">www.jboss.com</a>