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@gmail.com>:
On Fri, Jul 25, 2008 at 1:04 PM, Claudio Rainoldi
<claudio.rainoldi@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@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users