<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Sorry I replied to the wrong message, doh! So here it is again.<br>
<br>
I've thought about some callback mechanism that is executed when a rule
is no longer true, the problem I have is which variable changed to make
the rule no longer true and how do I expose the bound variables to the
user, especially if the rule is no longer true due to a retraction,
and ofcourse I need to figure our the DRL syntax that makes sense. <br>
<br>
I've thought about doing it as a sort of logical closure, so you have
to declare the data:<br>
insertLogicalClosure( new LogicalClosure() {<br>
execute() {.......}<br>
} )<br>
<br>
Not sure how to make the data accessible, maybe the user should have to
populate the map. Anyway idea is in the same way that a logical insert
is executed when the rule is true, the logical closure/method is
executed.<br>
<br>
So if someone has some time and fun, maybe they would work on this and
submit a patch :)<br>
<br>
Claudio Rainoldi wrote:
<blockquote
cite="mid:90ba25a80807290220o2f67041fm9b4d97d03650121b@mail.gmail.com"
type="cite">
<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>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>