Very true Wolfgang, and I agree your comments re: accessing meta data too.<br><br>In this case if Events are raised in response to Facts and the events themselves expire after 5 mins; I&#39;d assume a constant time expiration policy on the queue to be acceptable however this is based on assumption rather than fact.<br>
<br>Edson\Mark are the experts in this realm so I&#39;ll defer further comment to them.<br><br>With kind regards,<br><br>Mike<br><br><div class="gmail_quote">2010/11/12 Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">There isn&#39;t much support Drools provides for this. The listener tells you about<br>a new Fact being inserted, and then - what? Unless you are satisfied with<br>
a constant expiry offset, or define expiry times by a Map&lt;Class&lt;?&gt;,Long&gt;<br>
or implement getExpiryOffset in all of your classes, you don&#39;t know <i><b>when</b></i><br>to retract.<br><br>You can define @expires(...) on a declare even when the @role is not &quot;event&quot;,<br>but getting at this value isn&#39;t simple; you have to use the unstable API<br>

<br>    org.drools.definitions.impl.KnowledgePackageImp rpkg = <br>        (org.drools.definitions.impl.KnowledgePackageImp)kBase.getKnowledgePackage( &quot;some.package&quot; );<br>    org.drools.rule.TypeDeclaration td = (org.drools.rule.TypeDeclaration)rpkg.pkg.getTypeDeclaration( &quot;FactTYpe&quot; );<br>

    System.out.println( &quot;Expires: &quot; + td.getExpirationOffset() );<br><br>It&#39;s difficult to accept why features which are part of the established user interface are not accessible via the stable API. <br><br>

As an aside, notice that the Expert manual teaches me to add metadata to a Java-defined class:<br>   declare org.drools.examples.Person<br>      @author( Bob )<br>      ...<br>   end<br>Great, and Bob&#39;s your uncle! How do I retrieve this author metadata?<br>

<br>Regards<br>Wolfgang<br><br><br><br><br><br>2010/11/12 Michael Anstis &lt;<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>&gt;:<div><div></div><div class="h5"><br>&gt; A time based eviction queue is simply a queue that evicts its content based<br>

&gt; upon time-based heuristic. So the WorkingMemoryEventListener would store<br>&gt; facts inserted into the WorkingMemory in an internal queue and evict them<br>&gt; from that queue based upon some time-based heuristic. You could use an<br>

&gt; Executor (ScheduledExecutorService) etc to remove facts from the queue and<br>&gt; working memory at set intervals.<br>&gt;<br>&gt; With kind regards,<br>&gt;<br>&gt; Mike<br>&gt;<br>&gt; On 11 November 2010 22:31, Ayush &lt;<a href="mailto:ayush.vatsyayan@alcatel-lucent.com" target="_blank">ayush.vatsyayan@alcatel-lucent.com</a>&gt; wrote:<br>

&gt;&gt;<br>&gt;&gt; Can you please elaborate on &quot;Have it store each inserted object in a<br>&gt;&gt; time based eviction queue and it&#39;ll remove things for you.&quot; i.e. how can I<br>&gt;&gt; do it?<br>&gt;&gt; --<br>

&gt;&gt; View this message in context:<br>&gt;&gt; <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Removing-facts-from-statefulknowledgeSession-s-memory-tp1875795p1885760.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Removing-facts-from-statefulknowledgeSession-s-memory-tp1875795p1885760.html</a><br>

&gt;&gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>&gt;&gt; _______________________________________________<br>&gt;&gt; rules-users mailing list<br>&gt;&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>

&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br><br>
</div></div><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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>