<br>&nbsp;&nbsp; Jason,<br><br>&nbsp;&nbsp; Yes, the engine does not see any change in TestObject until you call update() for it.<br>&nbsp;&nbsp; In your case, I would play that a bit different:<br><br>rule &quot;remove objects older than 2 seconds&quot;
<br>when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clock( $cur : currentTime )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$to : TestObject( creationTime &lt; ( $cur - 2000 ) )<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(new java.util.Date() + &quot; ========= Retracting &quot; +<br>$to);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;retract($to);<br>end<br><br>&nbsp;&nbsp; This way you only need to update your clock object and not your testObjects.<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><br><div><span class="gmail_quote">2007/7/6, Jason Vasquez &lt;<a href="mailto:jason@mugfu.com">
jason@mugfu.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi all,<br><br>I need a set of rules to fire on time-based criteria.&nbsp;&nbsp;I have a
<br>&#39;Clock&#39; object in working memory, along with an unknown number of<br>&#39;TestObject&#39;s, each of which can report its &#39;age&#39;.&nbsp;&nbsp;At some interval,<br>I modify the Clock object in working memory, and then fire the
<br>rules.&nbsp;&nbsp;As a start (which I&#39;m certain shouldn&#39;t work anyway), I&#39;m<br>playing around with a rule like this:<br><br>rule &quot;remove objects older than 2 seconds&quot;<br>when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clock()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$to : TestObject( ageInMillis &gt; 2000 )
<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(new java.util.Date() + &quot; ========= Retracting &quot; +<br>$to);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;retract($to);<br>end<br><br>It appears that the RHS is never executed, presumably because<br>TestObjects were not modified.&nbsp;&nbsp;(I&#39;m new to JBossRules, so I&#39;m
<br>unclear on that )<br><br>Alternatively, I could just remove the Clock() constraint and iterate<br>an external collection of TestObject&#39;s, marking each object as<br>modified.&nbsp;&nbsp;Just looking for the best way here...<br>
<br>Thanks,<br>-jason<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">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646
<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>