<div dir="ltr">ok you are right.<br>But my problem now is: how can i know when a rule isn&#39;t more fired.<br>if this rule fired:<br><div><font size="2"><br>when mylamp==&quot;on&quot;</font></div>
<div><font size="2">then</font></div>
<div><font size="2">System.out.println(&quot;light 1 on&quot;);</font></div><br>How can i know&nbsp; when the light isn&#39;t more on?<br><br><div class="gmail_quote">2008/7/25 Marcus Ilgner &lt;<a href="mailto:marcus.ilgner@gmail.com">marcus.ilgner@gmail.com</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Fri, Jul 25, 2008 at 1:04 PM, Claudio Rainoldi<br>
&lt;<a href="mailto:claudio.rainoldi@gmail.com">claudio.rainoldi@gmail.com</a>&gt; wrote:<br>
&gt; Hi everyone,<br>
&gt; i&#39;m developing a java application using drools 4 for domotic control;<br>
&gt; i ve implemented a listener on my working memory with the<br>
&gt; method afterActivationFired(...) and activationCancelled(...) .<br>
&gt; At startup of my app i&#39;ve write the following lines:<br>
&gt;<br>
&gt; listener = new FiredRulesListener();<br>
&gt; workingMemory.addEventListener(listener);<br>
&gt;<br>
&gt; Each time a rule is fired the method afterActivationFired(...) is called and<br>
&gt; it is ok; but when the rule stop to be true the<br>
&gt; method activationCancelled &nbsp;isn&#39;t never called.<br>
<br>
</div>Afaik, activationCancelled works like this:<br>
The fact is added, a rule would match, the activation is scheduled.<br>
However, another rule (probably with higher priority) matches, too,<br>
and it modifies the fact in a way that would make the first rule not<br>
match - thus, the activation is cancelled and the corresponding<br>
listener method gets called.<br>
<br>
Somebody correct me if I&#39;m wrong, please ;)<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br></div>