<br>     Hmmm, strange... would you be able to share your junit test? If so, could you please open a JIRA and attach the test? <br><br>     Thanks,<br>        Edson<br><br><div class="gmail_quote">2010/3/22 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: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">









<div link="blue" vlink="purple" lang="PT">

<div>

<p class="MsoNormal"><span lang="EN-US">Hi folks!</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">First time in this mailing-list, with very
little experience in Drools (Fusion, regarding CEP).</span></p>

<p class="MsoNormal"><span lang="EN-US">I hope that someone could help me out </span><span style="font-family: Wingdings;" lang="EN-US">J</span><span lang="EN-US"></span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">I’ve being investigating about this
issue and I’m not getting any answer.</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<div style="border-width: medium medium 1pt; border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; padding: 0cm 0cm 1pt;">

<p class="MsoNormal" style="border: medium none; padding: 0cm;"><span lang="EN-US">Here’s
the problem:</span></p>

</div>

<p class="MsoNormal"><span lang="EN-US">I’ve got a DRL file with a simple
rule:</span></p>

<p class="MsoNormal" style=""><b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(150, 0, 0);" lang="EN-US">rule</span></b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US"> “....”</span></p>


<p class="MsoNormal" style=""><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">       </span><b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(150, 0, 0);" lang="EN-US">when</span></b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;;" lang="EN-US"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">             $offline
: Event( code == </span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: green;" lang="EN-US">&quot;101&quot;</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">, $offlineLane
: lane ) </span><b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(150, 0, 0);" lang="EN-US">from</span></b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US"> entry-point </span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: green;" lang="EN-US">&quot;incoming&quot;</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;;" lang="EN-US"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">             </span><b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(150, 0, 0);" lang="EN-US">not</span></b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US"> (
$online : Event(code == </span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: green;" lang="EN-US">&quot;102&quot;</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">,
lane == $offlineLane, </span><b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(150, 0, 0);" lang="EN-US">this</span></b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US"> after [0s,3m]
$offline ) </span><b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(150, 0, 0);" lang="EN-US">from</span></b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US"> entry-point </span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: green;" lang="EN-US">&quot;incoming&quot;</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US"> )</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;;" lang="EN-US"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">       </span><b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(150, 0, 0);" lang="EN-US">then</span></b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;;" lang="EN-US"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">             //
some code here          </span></p>

<p class="MsoNormal"><b><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(150, 0, 0);" lang="EN-US">end</span></b></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">What I want is: when there’s an
offline for more than 3 minutes *<b>without</b>* any online event (meanwhile),
that execute the rule.</span></p>

<div style="border-width: medium medium 1pt; border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; padding: 0cm 0cm 1pt;">

<p class="MsoNormal" style="border: medium none; padding: 0cm;"><span lang="EN-US"> </span></p>

</div>

<p class="MsoNormal"><span lang="EN-US">I’ve got JUnits, with Drools
configured with STREAM mode and PSEUDO clock.</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">All is good in JUnit world except in this
testcase:</span></p>

<p><span style="font-family: Symbol;" lang="EN-US"><span>·<span style="font: 7pt &quot;Times New Roman&quot;;">        
</span></span></span><span lang="EN-US">Insert an offline event (</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(0, 0, 192);" lang="EN-US">workingMemoryEntryPoint</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">.insert(
offlineEvent );</span><span lang="EN-US">)</span></p>

<p><span style="font-family: Symbol;" lang="EN-US"><span>·<span style="font: 7pt &quot;Times New Roman&quot;;">        
</span></span></span><span lang="EN-US">Clock advances 2m50s (</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(0, 0, 192);" lang="EN-US">clock</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">.advanceTime(2,TimeUnit.</span><i><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(0, 0, 192);" lang="EN-US">MINUTES</span></i><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US"> );</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(0, 0, 192);" lang="EN-US">clock</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">.advanceTime(50,
TimeUnit.</span><i><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(0, 0, 192);" lang="EN-US">SECONDS</span></i><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US"> );</span><span lang="EN-US">)</span></p>


<p><span style="font-family: Symbol;" lang="EN-US"><span>·<span style="font: 7pt &quot;Times New Roman&quot;;">        
</span></span></span><span lang="EN-US">Insert an online event (</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(0, 0, 192);" lang="EN-US">workingMemoryEntryPoint</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">.insert(
onlineEvent );</span><span lang="EN-US">)</span></p>

<p><span style="font-family: Symbol;" lang="EN-US"><span>·<span style="font: 7pt &quot;Times New Roman&quot;;">        
</span></span></span><span lang="EN-US">Clock advances 0m15s (</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(0, 0, 192);" lang="EN-US">clock</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US">.advanceTime(15,TimeUnit.</span><i><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: rgb(0, 0, 192);" lang="EN-US">SECONDS</span></i><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: black;" lang="EN-US"> );</span><span lang="EN-US">)</span></p>


<p><span style="font-family: Symbol;" lang="EN-US"><span>·<span style="font: 7pt &quot;Times New Roman&quot;;">        
</span></span></span><span lang="EN-US">Assertion error: the rule runs
when it shouldn’t (online event cancels offline event).</span></p>

<div style="border-width: medium medium 1pt; border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; padding: 0cm 0cm 1pt;">

<p class="MsoNormal" style="border: medium none; padding: 0cm;"><span lang="EN-US"> </span></p>

</div>

<p class="MsoNormal"><span lang="EN-US">I’ve got no clue about this but I
have some more interesting info:</span></p>

<p style=""><span style="font-size: 9pt; font-family: Symbol;" lang="EN-US"><span>·<span style="font: 7pt &quot;Times New Roman&quot;;">        
</span></span></span><span lang="EN-US">When clock advances 0m15s,
there’s an NPE on a LinkedList:<br>
</span><u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: navy;" lang="EN-US">java.lang.NullPointerException</span></u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;;" lang="EN-US"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: red;" lang="EN-US">       at
org.drools.util.LinkedList.remove(</span><u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: navy;" lang="EN-US">LinkedList.java:113</span></u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: red;" lang="EN-US">)</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;;" lang="EN-US"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: red;" lang="EN-US">       at
org.drools.common.Scheduler$DuractionJob.execute(</span><u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: navy;" lang="EN-US">Scheduler.java:71</span></u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: red;" lang="EN-US">)</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;;" lang="EN-US"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: red;" lang="EN-US">       at
org.drools.time.impl.PseudoClockScheduler$ScheduledJob.call(</span><u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: navy;" lang="EN-US">PseudoClockScheduler.java:219</span></u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: red;" lang="EN-US">)</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;;" lang="EN-US"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: red;" lang="EN-US">       at
org.drools.time.impl.PseudoClockScheduler.runCallBacks(</span><u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: navy;" lang="EN-US">PseudoClockScheduler.java:168</span></u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: red;" lang="EN-US">)</span><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;;" lang="EN-US"></span></p>


<p class="MsoNormal" style="margin-left: 18pt;"><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: red;" lang="EN-US">   at
org.drools.time.impl.PseudoClockScheduler.advanceTime(</span><u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: navy;" lang="EN-US">PseudoClockScheduler.java:130</span></u><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;; color: red;" lang="EN-US">)</span><span lang="EN-US"></span></p>


<p><span style="font-family: Symbol;" lang="EN-US"><span>·<span style="font: 7pt &quot;Times New Roman&quot;;">        
</span></span></span><span lang="EN-US">I haven’t any code/rule that
retracts events (I shouldn’t have it for this case, right?)</span></p>

<p><span style="font-family: Symbol;" lang="EN-US"><span>·<span style="font: 7pt &quot;Times New Roman&quot;;">        
</span></span></span><span lang="EN-US">I’ve tried Drools 5.0.1
and 5.1.0.M1, with the same results</span></p>

<p><span style="font-family: Symbol;" lang="EN-US"><span>·<span style="font: 7pt &quot;Times New Roman&quot;;">        
</span></span></span><span lang="EN-US">The issue causing NPE, I’ve
found an old issue regarding Drools 3.0.4 and the bug was corrected in 3.0.5 (<a href="https://jira.jboss.org/jira/browse/JBRULES-455" target="_blank">https://jira.jboss.org/jira/browse/JBRULES-455</a>)</span></p>

<p><span style="font-family: Symbol;" lang="EN-US"><span>·<span style="font: 7pt &quot;Times New Roman&quot;;">        
</span></span></span><span lang="EN-US">I think that someone wrote
about this error (in Drools 5) but I don’t have the link to it.</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">Thanks In Advance!</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">Best regards,</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<table style="width: 100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
 <tbody><tr>
  <td colspan="2" style="background: none repeat scroll 0% 0% rgb(180, 203, 61); padding: 0cm;">
  <p class="MsoNormal"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"><img src="cid:image001.jpg@01CAC9E1.DBEC6E10" height="6" width="389"></span></p>
  </td>
 </tr>
 <tr>
  <td style="border-width: medium medium medium 1pt; border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color black; background: none repeat scroll 0% 0% rgb(235, 243, 204); padding: 7.5pt;">

  <p class="MsoNormal"><span style="font-size: 7.5pt;">Vítor
  Mendonça Moreira<br>
  <b><span style="color: rgb(138, 154, 55);">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 style="width: 1%; background: none repeat scroll 0% 0% rgb(235, 243, 204); padding: 7.5pt;" width="1%">
  <p class="MsoNormal"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"><img src="cid:image002.jpg@01CAC9E1.DBEC6E10" border="0" height="60" width="119"></span></p>
  </td>
 </tr>
 <tr style="min-height: 0.75pt;">
  <td style="background: none repeat scroll 0% 0% rgb(180, 203, 61); padding: 0cm; min-height: 0.75pt;"></td>
  <td style="background: none repeat scroll 0% 0% rgb(180, 203, 61); padding: 0cm; min-height: 0.75pt;"></td>
 </tr>
</tbody></table>

<p class="MsoNormal"> </p>

<p class="MsoNormal"> </p>

</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><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>