<div><br></div>   Yes, please. Thank you,<div><br></div><div>   Edson<br><br><div class="gmail_quote">2011/3/17 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"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">I forgot to mention that I’m running in stream mode, yes
</span><span lang="EN-US" style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">I’m having problems regarding event expiration: I define events with @expires(1h) but they won’t disappear, I had to write some rules to force
 the expiration.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">To keep short a long history…
</span><span lang="EN-US" style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"></span></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:Symbol;color:#1F497D"><span>·<span style="font:7.0pt &quot;Times New Roman&quot;">        
</span></span></span><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">I put transactions into entry-point “incoming”</span></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:Symbol;color:#1F497D"><span>·<span style="font:7.0pt &quot;Times New Roman&quot;">        
</span></span></span><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">I’ve got rules that create a new event (defined in .drl file) when a transaction is inserted in the working memory. That event has an
 expire time (1h)</span></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:Symbol;color:#1F497D"><span>·<span style="font:7.0pt &quot;Times New Roman&quot;">        
</span></span></span><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">But I’ve notice that the created event will never go away</span></p>
<div style="border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
</div>
<p class="MsoNormal" style="text-autospace:none"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#76923C">// transaction inserted into working memory through insertFact()</span></b></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"> Transaction</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;"></span></p>
<div class="im">
<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"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">end</span></b></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:#76923C"> </span></b></p>
</div><p class="MsoNormal" style="text-autospace:none"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#76923C">// event created when working memory receives transaction</span></b></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"> ExampleTransaction</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"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black">      value:
</span><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">int</span></b><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">      transaction: Transaction    
</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;"></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">end</span></b></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000"> </span></b></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:#76923C">// rule to create event
</span></b></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">rule</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:green">&quot;new example transaction&quot;</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">when</span></b><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">      $transaction : Transaction() over window:time(1h)
</span><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">from</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black"> entry-point
</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:green">&quot;incoming&quot;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black">
</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">then</span></b><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">    ExampleTransaction exampleTransaction =
</span><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">new</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black"> ExampleTransaction();</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">    exampleTransaction.setValue(0);</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">    exampleTransaction.setTransaction($transaction);</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">   
</span><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">insert</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black">( exampleTransaction );</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;"></span></p>

<p class="MsoNormal"><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:11.0pt;color:#1F497D"></span></p>
<div style="border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">Maybe submitting a new issue with a JUnit test would be nice, right?
</span><span lang="EN-US" style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"></span></p><div class="im">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </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="color:#1F497D"><img width="389" height="6" src="cid:image001.jpg@01CBE4C1.8E0B7E10"></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;color:#1F497D">Vítor Mendonça Moreira<br>
</span><b><span style="font-size:7.5pt;color:#8A9A37">Analista / Programador<br>
Direcção de Investigação e Desenvolvimento</span></b><span style="font-size:7.5pt;color:#1F497D"><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">www.makewise.pt</a><br>
Uma empresa: <a href="http://www.sousapedro.com" target="_blank">Grupo Sousa Pedro</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="color:#1F497D"><img border="0" width="119" height="60" src="cid:image002.jpg@01CBE4C1.8E0B7E10"></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"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
</div></div>
<p></p>
<font size="1"><font face="Frutiger 45 Light"><div class="im">
<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>
</div><div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt">From:</span></b><span lang="EN-US" style="font-size:10.0pt"> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>]
<b>On Behalf Of </b>Edson Tirelli<br>
<b>Sent:</b> quinta-feira, 17 de Março de 2011 13:41</span></p><div><div></div><div class="h5"><br>
<b>To:</b> Rules Users List<br>
<b>Subject:</b> Re: [rules-users] Basic doubt regarding Drools Fusion - @expires</div></div><p></p>
</div><div><div></div><div class="h5">
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">   You lost me. Why are you defining a rule to retract your event? If you are running in STREAM mode, @expires will take care of the retraction for you automatically...</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">   Regarding threads, I said by default because there is an experimental feature that makes drools start internal threads, but that is not production ready yet. </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">   Edson</p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> </p>
<div>
<p class="MsoNormal">2011/3/17 Makewise - Vitor Rui Mendonça &lt;<a href="mailto:Vitor.Mendonca@brisa.pt" target="_blank">Vitor.Mendonca@brisa.pt</a>&gt;</p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">Edison, first of all, thanks for your quick reply!</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">Those initial words caught my attention, although: “</span><span lang="EN-US">By default, Drools does not start any internal
 thread</span><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">”… </span>
</p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">What do you mean “by default”?
</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">I know there are ways to force the event to be expired but I’m looking for a solution that doesn’t involve to write new
 rules.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
<div style="border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">For example, I’m using this kind of solution:</span></p>
</div>
<div>
<p style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">declare</span></b><span style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black"> A</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black">      @role( event )</span></p>
<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black">      @expires( 1h )</span></p>
<p 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></p>
</div>
<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">rule</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:green">&quot;internal - expiring A&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">      timer(</span><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">int</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black">:1h)</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">when</span></b></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">      $a : A()
</span><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">from</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black"> entry-point
</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:green">&quot;incoming&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">then</span></b></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">     
</span><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">retract</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:black">($a);</span></p>

<div style="border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Lucida Console&quot;;color:#960000">end</span></b></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">Although this solution works (from Drools 5.1), I’m forced to write a rule to expire an event that’s supposed to be expired
 initially.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">There’s a simpler way to do this? I’m thinking correctly?</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">Once again, thanks!</span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </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="color:#1F497D"><img border="0" width="389" height="6" src="cid:image001.jpg@01CBE4C1.8E0B7E10"></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;color:#1F497D">Vítor Mendonça Moreira<br>
</span><b><span style="font-size:7.5pt;color:#8A9A37">Analista / Programador<br>
Direcção de Investigação e Desenvolvimento</span></b><span style="font-size:7.5pt;color:#1F497D"><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">www.makewise.pt</a><br>
Uma empresa: <a href="http://www.sousapedro.com" target="_blank">Grupo Sousa Pedro</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="color:#1F497D"><img border="0" width="119" height="60" src="cid:image002.jpg@01CBE4C1.8E0B7E10"></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"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
</div>
</div>
<div>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;">
<hr size="2" width="100%" align="center">
</span></div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt"> 
</span><span style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;"></span></p>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt">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. </span><span style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt">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.</span><span style="font-size:7.5pt"> </span><span style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;"></span></p>
</div>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;">
<hr size="2" width="100%" align="center">
</span></div>
</div>
</div>
</div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt">From:</span></b><span lang="EN-US" style="font-size:10.0pt">
<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>]
<b>On Behalf Of </b>Edson Tirelli<br>
<b>Sent:</b> quarta-feira, 16 de Março de 2011 18:38<br>
<b>To:</b> Rules Users List<br>
<b>Subject:</b> Re: [rules-users] Basic doubt regarding Drools Fusion - @expires</span></p>
</div>
<div>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal"> </p>
</div>
<p class="MsoNormal">   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.</p>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">  Edson</p>
<div>
<p class="MsoNormal">2011/3/16 Makewise - Vitor Rui Mendonça &lt;<a href="mailto:Vitor.Mendonca@brisa.pt" target="_blank">Vitor.Mendonca@brisa.pt</a>&gt;</p>
<div>
<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></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></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></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></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" style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;">a)</span><span lang="EN-US" style="font-size:7.0pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;">     
</span><span lang="EN-US" style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;">One hour after it was inserted (time-based and without the “fireAllRules()” method call) or
</span><span style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;"></span></p>
<p><span lang="EN-US" style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;">b)</span><span lang="EN-US" style="font-size:7.0pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;">     
</span><span lang="EN-US" style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;">by calling “fireAllRules()” method (event-based)</span><span style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;"></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"><img border="0" width="389" height="6" src="cid:image001.jpg@01CBE4C1.8E0B7E10"></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">www.makewise.pt</a><br>
Uma empresa: <a href="http://www.sousapedro.com" target="_blank">Grupo Sousa Pedro</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"><img border="0" width="119" height="60" src="cid:image002.jpg@01CBE4C1.8E0B7E10"></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>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;">
<hr size="2" width="100%" align="center">
</span></div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt"> 
</span></p>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt">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. </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt">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. </span></p>
</div>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:7.5pt;font-family:&quot;Frutiger 45 Light&quot;,&quot;serif&quot;">
<hr size="2" width="100%" align="center">
</span></div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <br>
  Edson Tirelli<br>
  JBoss Drools Core Development<br>
  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <br>
  Edson Tirelli<br>
  JBoss Drools Core Development<br>
  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a></p>
</div></div></div>
</font></font>
<p></p>
</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>