[rules-users] Getting Latest Matching Fact

Wolfgang Laun wolfgang.laun at gmail.com
Sun Aug 26 03:25:23 EDT 2012


On 26/08/2012, salt <writemesaltworth at gmail.com> wrote:
> Hi david,
>
> Have doubt in the below implementation. As per my understanding the
> salience
> are used to execute the rules in an order. The rule with higher salience
> will execute first.

Correct.

>
> By the below implementation will that affect the rule execution order.
>
> salience ( 65535 - $list.indexOf( $trandet ) )    // lower indexes first
>

It does: indexOf returns 0, 1, 2,..., every so often, and thus the
salience values will be computed accordingly.

But as you wrote you want to fire the rule for the first "car" in your
list *only*, I suppose it isn't quite what you want.

-W

> Thanks
> Salt
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Getting-Latest-Matching-Fact-tp4019345p4019390.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list