[rules-users] Handle activationCancelled Event

Marcus Ilgner marcus.ilgner at gmail.com
Fri Jul 25 07:50:00 EDT 2008


On Fri, Jul 25, 2008 at 1:04 PM, Claudio Rainoldi
<claudio.rainoldi at gmail.com> wrote:
> Hi everyone,
> i'm developing a java application using drools 4 for domotic control;
> i ve implemented a listener on my working memory with the
> method afterActivationFired(...) and activationCancelled(...) .
> At startup of my app i've write the following lines:
>
> listener = new FiredRulesListener();
> workingMemory.addEventListener(listener);
>
> Each time a rule is fired the method afterActivationFired(...) is called and
> it is ok; but when the rule stop to be true the
> method activationCancelled  isn't never called.

Afaik, activationCancelled works like this:
The fact is added, a rule would match, the activation is scheduled.
However, another rule (probably with higher priority) matches, too,
and it modifies the fact in a way that would make the first rule not
match - thus, the activation is cancelled and the corresponding
listener method gets called.

Somebody correct me if I'm wrong, please ;)



More information about the rules-users mailing list