This is by design

http://lists.jboss.org/pipermail/rules-users/2009-March/008299.html

What are you trying to accomplish? There is no difference in the patterns you are matching in both rules however you expect different consequences to occur based upon salience. Based upon the foregoing link you could try changing one rule to be in a different ruleflow-group however that could have other consequences. 

2010/9/16 Yaniv Itzhaki <iyaniv@gmail.com>

Hi All,

 

I have an urgent problem which I hope someone can explain it to me and how it can be solved.

 

I created 2 rules "Update 1" and "Update 2", basically the rules are the same, get all the CaseLog objects according to "Category" and "Value" and update the Case, which holds a list of CaseLogs, with a new object.

 

Note that in the update method I am updating the working memory by retracting the old log and inserting the new one.

 

Now for the problem:


The problem is that on one hand, when I insert a new log line all rules without lock-on-active re-fire. On the other hand, rules with lock-on-active seem to disregard the addition of the new object and fire only on the lines that were present when their group was activated.

 

Please see the rules below

 

Thanks

Yaniv

 

rule "Update 1"

      salience 4

      ruleflow-group "group1"

      lock-on-active

      when

            $case : Case()

            $myLog : CaseLog( myClass == "Category",

                  myValue == "1" )

      then

            System.out.println("Logic: Update 1");

            $case.update($myLog,40.0,null);

end

rule "Update 2"

      salience 0

      ruleflow-group "group1"

      lock-on-active

      when

            $case : Case()

            $myLog : CaseLog( myClass == "Category",

                  myValue == "1", $score : myScore )

      then

            System.out.println("Logic: Update 2 " + $score + 5.0);

            $case.update($myLog,$score + 5,null);

end


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users