[rules-users] User and/or Code problem with insert/retract and salience

Jared Davis sunray at davisprogramming.com
Tue Mar 30 10:11:04 EDT 2010


We have 5 rules that are firing out of salience order for a particular set
of 4 objects.  The rules have a branch on the RHS which sometimes retracts
the A object. There are reasons why the branch is not in the LHS not shown
in this sample.

The 5 rules are like the following. The salience values
 are 70, 65, 60, 55, 50

rule "a1"
salience 70
 agenda-group "b"
when 
  a: A(name customevaluator "X")
     B(name = "B")
then
   //  sometimes retract
end

There is one B object.

Another rule fires (at salience 0) and inserts 4 A objects. 

1) A1 runs rule at salience 70 and is retracted
2) A2 runs rule at salience 70 and is not retracted
3) A3 runs rule at salience 70 and is retracted
4) A4 runs rule at salience 70 and is not retracted
5) A4 runs rule at salience 65 and is retracted
6) A2 runs rule at salience 50 and is retracted

I would have expected step 6 to have A2 run at salience 65 but instead it 
went from 70 to 50 skipping 60 and 65.  Is my understanding of the rule
rhs firing order wrong?

I'm using a 5.1 snapshot from Dec 23 2009.

I searched the JIRA and did not see anything related.






More information about the rules-users mailing list