thanks a lot<br><br>
<div><span class="gmail_quote">2008/7/29, Ingomar Otter &lt;<a href="mailto:iotter@mac.com">iotter@mac.com</a>&gt;:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">There is a mechanism called truth maintenance ensuring for example<br><br>A -&gt; B<br>B -&gt; C<br><br>that C becomes false when it&#39;s premise (B) becomes false as well.<br>
What it basically does it track the LHS side of the rule and undoes asserted facts when there are no more &quot;facts&quot; to support it (activate the rules in question).<br>Look at the documentation for logicals / truth mainteance. It&#39;s pretty cool.<br>
<br>For your case:<br><br>rule &quot;light2on&quot;<br>when<br>&nbsp; &nbsp; &nbsp; &nbsp;LIght(name==&quot;0/0/2&quot;, actualvalue==&quot;1&quot;)<br>then<br>&nbsp; &nbsp; &nbsp;insertLogical( new LightIsOn(2))<br>end<br><br>the fact &quot;LightIsOn&quot; will only be true (in the working memory) as long as the LHS of the rule above is still true. For example if acutalvalue becomes 0, that fact would vanish automagically.<br>
That implies that you use facts to make statements about your system (not using behind the scene callbacks) - but from my very little experience I would say this is a good practice anyway. Fiddeling with activations make me suspicious ;-) - But then it all depends on your particular problem at hand.<br>
<br>--I<span class="q"><br><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">rule &quot;light 2 on&quot;<br>dialect &quot;java&quot;<br>when<br>Light (name==&quot;0/0/2&quot;, actualvalue==&quot;1&quot;);<br>
then<br>System.out.println(&quot;luce 2 on&quot;);<br>end<br></blockquote></blockquote></blockquote><br><br></span>Am 29.07.2008 um 14:42 schrieb Claudio Rainoldi: 
<div><span class="e" id="q_11b6ef5ceef6980a_3"><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">i&#39;m sorry i&#39;m a new drools user.. Can you try to be a little more clear?<br>thanks..<br><br><br>2008/7/29, Ingomar Otter &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:iotter@mac.com" target="_blank">iotter@mac.com</a>&gt;:<br>

<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Use logicals.<br><br>Am 29.07.2008 um 11:20 schrieb Claudio Rainoldi:<br><br>Hi everyone,<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">isn&#39;it there a way to find when a rule isn&#39;t more active.<br>For example if i have this rule:<br><br>
<br>rule &quot;light 2 on&quot;<br>dialect &quot;java&quot;<br>when<br>Light (name==&quot;0/0/2&quot;, actualvalue==&quot;1&quot;);<br>then<br>System.out.println(&quot;luce 2 on&quot;);<br>end<br><br><br>when someone turn on the light 2 i discover that the rule is fired using<br>
an<br>Agenda Event Listener and the method afterActivationFired;<br>But when someone turn off the ligth isn&#39;t there a similar way to discover<br>that the rule &quot;light 2 on&quot; isn&#39;t more active.<br>My only solution is to use the dual rule:<br>
<br>rule &quot;light 2 on_dual&quot;<br>dialect &quot;java&quot;<br>when<br>not (Light (name==&quot;0/0/2&quot;, actualvalue==&quot;1&quot;));<br>then<br>System.out.println(&quot;luce 2 off&quot;);<br>end<br><br>Isn&#39;t there a more sample way to do this?<br>
Thanks in advance.<br><br><br>Cla<br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote><br>_______________________________________________<br>
rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote><br>_______________________________________________<br>
rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</span></div></blockquote></div><br>