[rules-users] Handle activationCancelled Event

Claudio Rainoldi claudio.rainoldi at gmail.com
Fri Jul 25 08:35:42 EDT 2008


ok you are right.
But my problem now is: how can i know when a rule isn't more fired.
if this rule fired:

when mylamp=="on"
then
System.out.println("light 1 on");

How can i know  when the light isn't more on?

2008/7/25 Marcus Ilgner <marcus.ilgner at gmail.com>:

> 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 ;)
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080725/3def8f36/attachment.html 


More information about the rules-users mailing list