Hi all,

I need a set of rules to fire on time-based criteria. I have a 'Clock' object in working memory, along with an unknown number of 'TestObject's, each of which can report its 'age'. At some interval, I modify the Clock object in working memory, and then fire the rules. As a start (which I'm certain shouldn't work anyway), I'm playing around with a rule like this:

rule "remove objects older than 2 seconds"
when
        Clock()
        $to : TestObject( ageInMillis > 2000 )
then
System.out.println(new java.util.Date() + " ========= Retracting " + $to);
        retract($to);
end

It appears that the RHS is never executed, presumably because TestObjects were not modified. (I'm new to JBossRules, so I'm unclear on that )

Alternatively, I could just remove the Clock() constraint and iterate an external collection of TestObject's, marking each object as modified. Just looking for the best way here...

Thanks,
-jason

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to