[rules-users] priority based on object properties

Simon Chen simonchennj at gmail.com
Mon Jul 18 15:44:30 EDT 2011


Hi all,

I am curious if we can inform Drools' execution based on properties
within objects.

In particular, the salience value is defined for each rule, in the
sense that rule A has priority over rule B to execute. I am wondering
if we can define some kinda of salience metric, such that object X has
higher priority than object Y to be executed in the same rule.

To give an example, I am (still) playing with implementing shortest
path using a few rules. I have a rule for selecting a shortest path on
a node (among all the paths received from its neighbors) to a source
node, and another rule for propagating the shortest path on a node to
neighboring nodes. When I have many nodes in my graph, I found that
the paths propagated (via the second rule) are not always the
shortest, while Dijkstra's algorithm always "propagate" from the node
with the shortest distance to the source. The effect is that my rules
are wasting most of the time propagating paths that would be dropped
in the end anyway...

Any ideas?

Thanks.
-Simon



More information about the rules-users mailing list