Dear all, First, let me inform that we are using stateless sessions in Drools 5 CR1. In my application I have to compute a score and if the score is above a threshold, an alert is created. The score is accumulated from many small rules (actually, generated from excel using drools decision-tables).
Initially, many input objects and a Score object initialized to zero are inserted. The form of my rules is: 1 rule “accumulate #1” 2 when 3 Input(....) 4 s:Score() 5 then 6 s.add(4) // 4 is just an example 7 end 8 9 rule “threshold” 10 when 11 Score(value>40) 12 then 13 Alert.create(..) 14 end 1.The Score object was actually accumulated as expected. But for some reason, the “threshold” rule fired once when the score.value was still ==0. 2.I tried to set the salience of the “threshold” rule to -1 (low priority). But it didn't affect the rule firing. 3.I suspected that the engine was not informed that the score object was updated in the first rules. So, I added a call to drools.update(s) after line 6. That solved the issue and the “threshold” rule actually fired. But now, I noticed that several alerts were created because the score was set several times to a value>40. 4.To solve that new issue, I set again the salience of the threshold rule to -1. This time, only one alert was created. My concern is that I don't understand what happened. Can someone please explain? To my understanding, the situation described in my second bullet should work. Initially, all the inserted objects are checked in the RETE network and an agenda is created. The activation for the “threshold” rule is the last one. I don't see the reason how can the threshold rule fire before all the accumulate rules were fired. Thanks for the help, David -- View this message in context: http://www.nabble.com/rule-with-low-Salience-is-fired-too-early-tp23585593p23585593.html Sent from the drools - user mailing list archive at Nabble.com. _______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
