<div dir="ltr"><br> The same interface you are using (AgendaEventListener) has 2 methods for activations created and canceled:<br><br> void activationCreated(ActivationCreatedEvent event,<br> WorkingMemory workingMemory);<br>
<br> void activationCancelled(ActivationCancelledEvent event,<br> WorkingMemory workingMemory);<br><br> []s<br> Edson<br><br><div class="gmail_quote">2008/7/29 Claudio Rainoldi <span dir="ltr"><<a href="mailto:claudio.rainoldi@gmail.com">claudio.rainoldi@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Hi everyone,</div>
<div>isn'it there a way to find when a rule isn't more active.</div>
<div>For example if i have this rule:</div>
<div> </div>
<div> </div>
<div>rule "light 2 on"<br>dialect "java" <br>when<br>Light (name=="0/0/2", actualvalue=="1");<br>then<br>System.out.println("luce 2 on");<br>end</div>
<div> </div>
<div> </div>
<div>when someone turn on the light 2 i discover that the rule is fired using an Agenda Event Listener and the method <font size="2">afterActivationFired;</font></div>
<div><font size="2">But when someone turn off the ligth isn't there a similar way to discover that the rule "light 2 on" isn't more active.</font></div>
<div><font size="2">My only solution is to use the dual rule:</font></div>
<div> </div>
<div>rule "light 2 on_dual"<br>dialect "java" <br>when<br>not (Light (name=="0/0/2", actualvalue=="1"));<br>then<br>System.out.println("luce 2 off");<br>end</div>
<div> </div>
<div>Isn't there a more sample way to do this?</div>
<div>Thanks in advance.</div>
<div> </div>
<div> </div>
<div>Cla</div>
<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>
<br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>