<html><body><span style="font-family:Verdana; color:#000000; font-size:10pt;"><div>&nbsp;</div>
<div>I have a need to "expire" some facts based on time. In other words, if an event occurs some time and if sufficient time has gone by, the fact should become inonsequential and be retracted. Here is my simple rule to do this:</div>
<div>&nbsp;</div><FONT size=2>
<div align=left></FONT><B><FONT color=#960000 size=2><FONT color=#960000 size=2></B></FONT></FONT><FONT size=2><FONT size=2></div>
<div align=left></FONT><B><FONT color=#960000 size=2><FONT color=#960000 size=2>rule</B></FONT></FONT><FONT size=2></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>"Retract expired facts"</div>
<div align=left></FONT></FONT><FONT size=2></div>
<div align=left></FONT><B><FONT color=#960000 size=2><FONT color=#960000 size=2>dialect</B></FONT></FONT><FONT size=2></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>"mvel"</div>
<div align=left></FONT></FONT><FONT size=2></div>
<div align=left></FONT><FONT color=#808000 size=2><FONT color=#808000 size=2>// salience -5</div>
<div align=left></FONT></FONT><FONT size=2></div>
<div align=left></FONT><B><FONT color=#960000 size=2><FONT color=#960000 size=2>when</div>
<div align=left></B></FONT></FONT><FONT size=2></div>
<div align=left>e1 : Event (code == </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>"LOGON"</FONT></FONT><FONT size=2>, status == </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>"ACTIVE"</FONT></FONT><FONT size=2>)</div>
<div align=left></FONT><B><FONT color=#960000 size=2><FONT color=#960000 size=2>eval</B></FONT></FONT><FONT size=2> ((getCurrentTimeStamp ()- e1.getLongTimeStamp()) &gt; </FONT><FONT size=2>100)</FONT><FONT size=2></div>
<div align=left></FONT><B><FONT color=#960000 size=2><FONT color=#960000 size=2>then</B></FONT></FONT><FONT size=2></div>
<div align=left>System.out.println( </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>"Retracting expired event with Timestamp: "</FONT></FONT><FONT size=2> + e1.longTimeStamp ); </div>
<div align=left></FONT><B><FONT color=#960000 size=2><FONT color=#960000 size=2>retract</B></FONT></FONT><FONT size=2> (e1);</div>
<div align=left></P>
<div align=left></div>
<div align=left></FONT><FONT color=#960000 size=2><FONT color=#960000 size=2></div>
<div><STRONG>end</STRONG></div>
<div>&nbsp;</div>
<div><FONT color=#000000>This does not seem to work because the "eval" method does not evaluate the rule every cycle. And, there is no other change to the fact (event) to force the rule to re-evaluate the fact. Is there a way to make "eval" in the LHS evaluate every cycle? Is there any other method?</FONT></div>
<div><FONT color=#000000></FONT>&nbsp;</div>
<div><FONT color=#000000>I would greatly appreciate any ideas.</FONT></div>
<div>&nbsp;</div>
<div><FONT color=#000000>Thanks,</FONT></div>
<P><FONT color=#000000>Ravi.</FONT></FONT></FONT><FONT size=2></div></FONT></FONT></span></body></html>