[rules-users] Why does it seem like salience is being ignored?
Edson Tirelli
ed.tirelli at gmail.com
Mon Jul 16 10:07:21 EDT 2012
Sorry, just saw your message. fireUntilHalt() will work in your use
case, as Mark mentioned. With fireUntilHalt(), as soon as a rule is
activated, it will fire if the agenda is idle. Because the topology of the
discrimination network is affected by the order of the rules in the file,
you end up having this different firing order depending on the order of the
rules in the file.
The only way to work around this with the current version of Drools is
to call fireAllRules() after each insertion of an object into the working
memory and the current implementation of the Drools-Camel component does
not support that. If you want to do it yourself, it is quite easy:
1. Add support to a new parameter to tell the component to fireAllRules()
after inserting the object into the working memory:
https://github.com/droolsjbpm/droolsjbpm-integration/blob/master/drools-camel/src/main/java/org/drools/camel/component/DroolsEndpoint.java
2. Add the call to fireAllRules() after inserting the object in here:
https://github.com/droolsjbpm/droolsjbpm-integration/blob/master/drools-camel/src/main/java/org/drools/camel/component/DroolsInsertProducer.java
Meanwhile, for the next version, we will need to add a staging area to
the agenda where the activations of a given propagation are added to the
agenda only when the whole propagation completes. This will fix the issue
for the general case.
Edson
On Sat, Jul 14, 2012 at 2:18 PM, Ladd <ladd at codemettle.com> wrote:
> I just tried the same test using 5.3.0 and got the same results. Rule1b
> fires first.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Why-does-it-seem-like-salience-is-being-ignored-tp4018669p4018687.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
>
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120716/cd3b562b/attachment-0001.html
More information about the rules-users
mailing list