[rules-users] Removing facts from statefulknowledgeSession's memory
Wolfgang Laun
wolfgang.laun at gmail.com
Thu Nov 11 02:12:49 EST 2010
On 11 November 2010 04:16, Ayush <ayush.vatsyayan at alcatel-lucent.com> wrote:
>
> Thanks for your reply.
>
> Also let me know about facts which are loaded into working memory (Keeping
> in mind that I'm not calling session.dispose()).
> Where should I define their expiry time or how should I retract them after 5
> minutes?
You declare the class to represent an event and set the expiry time.
import ...MyEventType
declare MyEventType
@role( event )
@expires( 5m )
end
Or you could catch them with a one-shot timer rule where other actions
besides retract would be possible.
rule "kill after 5m"
timer(int: 5m)
when
$f: SomeType()
then
// other actions?!
retract( $f );
end
Using a suitable interface or supertype may reduce the number of
required rules.
-W
> --
> View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Removing-facts-from-statefulknowledgeSession-s-memory-tp1875795p1880471.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
More information about the rules-users
mailing list