[rules-users] Conflict resolution strategy - before vs after Phreak impl

Borris borris at chaos.org.uk
Tue Aug 5 14:12:16 EDT 2014


Mark,

This was a really useful post, going into some detail on behaviour and 
the underlying reasoning for the Drools implementation, especially the 
6.X stuff. I've removed a whole bunch of salience mess as a result as 
well, which is always good for code quality.

A question though - if rules in multiple different files become eligble 
for firing "at the same time", is their ordering something that is 
readily predictable?

Thanks

Borris

On Monday 28/07/2014 17:11, Mark Proctor wrote:
> Phreak is just depth + load order, so it’s not a big change, all it does is remove the degree of arbitrary behaviour you were relying on for performance. Depth in 5x meant rules with the same salience were executed in an arbitrary order, it seems this arbitrary order was not so arbitrary in your case and makes an impact on performance - but as it’s arbitrary the repeatability of this cannot be ensured, even across environments let alone versions. In 6x this is no longer arbitrary, which will allow people more predictability in their rule executions. Load order is also much easier for people to understand and deal with, and often avoids the need to use salience at all - it’s also how people’s brains tend to think.  Rules higher up in the file, fire first. We recommend one “agenda-group” per file, so that it’s easy to keep control of those orders. Salience can still over-ride this; but over time we have further ideas to completely remove the need for salience. This didn’t make much sense in 5x as load order was not preserved between kbase updates, so if you add rules later you lose the load order. In 6x we fixed this, so load order is always preserved between versions, an thus adding this enhancement makes sense.
>





More information about the rules-users mailing list