[rules-users] Question about managing working memory facts
Edson Tirelli
tirelli at post.com
Wed Feb 20 12:36:40 EST 2008
If you know what is the timestamp attribute, you can even write a rule...
:)
rule "garbage collect"
salience 100 // use a reasonable salience
when
$e : Event( $ts : timestamp )
not Event( timestamp < $ts )
Number( intValue > 1000 ) from accumulate(
$c : Event(),
count( $c ) )
then
$retract( $e );
end
Not sure if it is the best way, but should work... :)
[]s
Edson
2008/2/19, Zoltan Farkas <zoly at daxtechnologies.com>:
>
> I am looking to implement a system that has as facts "events" that happen
> randomly.
>
>
>
> How is the best way to implement a "garbage collection" mechanism that if
> the number of "events" in the working memory reaches a limit value will
> retract the oldest event/s…
>
>
>
> Thanks
>
>
>
> --zoly
>
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080220/fff208f2/attachment.html
More information about the rules-users
mailing list