<div><br></div>   By default, Drools does not start any internal thread, so that you can embed it in non-multithread applications or in JEE containers. That means that the actual release of events in such cases depends on triggers. In your example, after 1h has passed, whenever something happens to the session (a new rule is fired, a new event is inserted, the session clock is advanced, etc), the event will be expired as part of the action. Remember though that it only happens when running in STREAM mode. In CLOUD mode, event garbage collection does not make sense and will not happen.<div>
<br></div><div>  Edson<br><br><div class="gmail_quote">2011/3/16 Makewise - Vitor Rui Mendonça <span dir="ltr">&lt;<a href="mailto:Vitor.Mendonca@brisa.pt">Vitor.Mendonca@brisa.pt</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">








<div lang="PT" link="blue" vlink="purple">
<p></p>
<div>
<p class="MsoNormal">Hi all!</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span lang="EN-US">I’ve got a really basic doubt… I’ve read several documentation regarding it but I think I need some advice here…</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Imagine that I have an event:</span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">declare</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black"> A</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black">      @role( event )</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black">      @expires( 1h )</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;"></span></p>

<p class="MsoNormal" style="text-autospace:none"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">end</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;"></span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">On my Java code, I call “fireAllRules()” method every time that I put an event into the working memory.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">My doubt: When does event A expires?</span></p>
<p><span lang="EN-US"><span>a)<span style="font:7.0pt &quot;Times New Roman&quot;">     
</span></span></span><span lang="EN-US">One hour after it was inserted (time-based and without the “fireAllRules()” method call) or
</span></p>
<p><span lang="EN-US"><span>b)<span style="font:7.0pt &quot;Times New Roman&quot;">     
</span></span></span><span lang="EN-US">by calling “fireAllRules()” method (event-based)</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">T.I.A.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%">
<tbody>
<tr>
<td colspan="2" style="background:#B4CB3D;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"><img width="389" height="6" src="cid:image001.jpg@01CBE3EF.C9596900"></span></p>
</td>
</tr>
<tr>
<td style="border:none;border-left:solid black 1.0pt;background:#EBF3CC;padding:7.5pt 7.5pt 7.5pt 7.5pt">
<p class="MsoNormal"><span style="font-size:7.5pt">Vítor Mendonça Moreira<br>
<b><span style="color:#8A9A37">Analista / Programador<br>
Direcção de Investigação e Desenvolvimento</span></b><br>
<br>
Rua Dr. Francisco Sá Carneiro, nº. 4 r/c esq.<br>
2500 - 206 - Caldas da Rainha<br>
Tel: (+351) 262 832 196<br>
Fax: (+351) 262 186 455<br>
Web: <a href="http://www.makewise.pt" target="_blank"><span style="color:blue">www.makewise.pt</span></a><br>
Uma empresa: <a href="http://www.sousapedro.com" target="_blank"><span style="color:blue">Grupo Sousa Pedro</span></a>
</span></p>
</td>
<td width="1%" style="width:1.0%;background:#EBF3CC;padding:7.5pt 7.5pt 7.5pt 7.5pt">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"><img border="0" width="119" height="60" src="cid:image002.jpg@01CBE3EF.C9596900"></span></p>
</td>
</tr>
<tr style="min-height:.75pt">
<td style="background:#B4CB3D;padding:0cm 0cm 0cm 0cm;min-height:.75pt"></td>
<td style="background:#B4CB3D;padding:0cm 0cm 0cm 0cm;min-height:.75pt"></td>
</tr>
</tbody>
</table>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
</div>
<p></p>
<font size="1"><font face="Frutiger 45 Light">
<div>
<hr>
</div>
<div><font face="Arial">  </font>
<div><font face="Arial">Declaração:<br>
A informação contida nesta mensagem, e os ficheiros anexos, é privilegiada e confidencial, destinando-se exclusivamente ao(s) destinatário(s).Se não é o destinatário (ou o responsável pela sua entrega ao destinatário) e recebeu a mesma por engano, fica notificado
 que é estritamente proibido reproduzir, guardar ou distribuir toda ou qualquer parte desta mensagem e ficheiros anexos.Por favor reencaminhe a mensagem para o responsável pelo seu envio ou contacte-nos por telefone e elimine a mensagem e ficheiros anexos do
 seu computador,sem os reproduzir. </font></div>
<div><font face="Arial"></font> </div>
<div><font face="Arial">Disclaimer:<br>
The information contained in this message, and any files attached, is privileged and confidential, and intended exclusively for the included addresses.If you are not the intended recipient (or the person responsible for delivering to the intended recipient)
 and received this message by mistake, be aware that copy, storage, distribution or any other use of all or part of this message and the files attached is strictly prohibited. Please notify the sender by reply e-mail or contact us by telephone and delete this
 message and the files attached, without retaining a copy.</font><font face="Times New Roman"> </font></div>
<div>
<hr>
</div>
</div>
<p></p></font></font>
</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><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>