[rules-users] Preventing re-evaluation on modification of 'output' fact

Jamie jshaw at llbean.com
Tue Nov 1 12:29:01 EDT 2011


I've continued digging in this issue and I've learned a few more things:

- Per a suggestion I received via the mailing list, I tried making the
'output' fact a global.  This gave me an incredible performance boost -
going from > 10 mins to < 100 ms!

- BUT - making the output fact a global caused some of my tests to fail.  As
it turns out, some rules modify the output, which causes re-evaluation to
occur, as it should, but it means that I can't use a global.

- Some rules specified no-loop and others specified lock-on-active.  I tried
using lock-on-active on all of them thinking that rules in subsequent
ruleflow groups would be re-valuated at the end of the ruleflow group, but
there was no change in performance.

- In looking at some debugging statements generated via a process listener
and an agenda listener, it looks like evaluation happens for all rules
regardless of the ruleflow group or the lock-on-active option. 

Given the performance gain I saw with the switch to a global, I feel like
the unnecessary re-evaluation is what's killing my performance as the number
of recipients on an order grows. 

The results we're storing in the output fact only flow downward - i.e., the
rules in each ruleflow group only care about modifications to the output
fact made by prior groups.  They don't care about modifications to the
output fact made by other rules in that same group or by subsequent groups.

Is there some other way to approach this that will cut down on the amount of
reevaluation that's occurring? 
 

--
View this message in context: http://drools.46999.n3.nabble.com/Preventing-re-evaluation-on-modification-of-output-fact-tp3455022p3471145.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list