[rules-users] Time constrained rules

Jason Vasquez jason at mugfu.com
Fri Jul 6 15:59:16 EDT 2007


Thanks Edison, that will do the trick.


On Jul 6, 2007, at 2:52 PM, Edson Tirelli wrote:

>
>    Jason,
>
>    Yes, the engine does not see any change in TestObject until you  
> call update() for it.
>    In your case, I would play that a bit different:
>
> rule "remove objects older than 2 seconds"
> when
>         Clock( $cur : currentTime )
>         $to : TestObject( creationTime < ( $cur - 2000 ) )
> then
>         System.out.println(new java.util.Date() + " =========  
> Retracting " +
> $to);
>         retract($to);
> end
>
>    This way you only need to update your clock object and not your  
> testObjects.
>
>    []s
>    Edson

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2413 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20070706/84b86e5c/attachment.bin 


More information about the rules-users mailing list