A rule's salience can be defined with an arbitrary expression which<br>may include variables bound to mathced fact fields.<br><br>It should be possible to compute the effective salience from a "base"<br>salience (according to the rule) plus an offset value derived from<br>
field values.<br><br>-W<br><br><br><div class="gmail_quote">On 18 July 2011 21:44, Simon Chen <span dir="ltr"><<a href="mailto:simonchennj@gmail.com">simonchennj@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br>
<br>
I am curious if we can inform Drools' execution based on properties<br>
within objects.<br>
<br>
In particular, the salience value is defined for each rule, in the<br>
sense that rule A has priority over rule B to execute. I am wondering<br>
if we can define some kinda of salience metric, such that object X has<br>
higher priority than object Y to be executed in the same rule.<br>
<br>
To give an example, I am (still) playing with implementing shortest<br>
path using a few rules. I have a rule for selecting a shortest path on<br>
a node (among all the paths received from its neighbors) to a source<br>
node, and another rule for propagating the shortest path on a node to<br>
neighboring nodes. When I have many nodes in my graph, I found that<br>
the paths propagated (via the second rule) are not always the<br>
shortest, while Dijkstra's algorithm always "propagate" from the node<br>
with the shortest distance to the source. The effect is that my rules<br>
are wasting most of the time propagating paths that would be dropped<br>
in the end anyway...<br>
<br>
Any ideas?<br>
<br>
Thanks.<br>
-Simon<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>