<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Ciao, I&#39;m using 6.1.0.beta4 and I identified in my application a rule pattern inducing memory leaks. I try to attach rule, screenshots, and javacode to replicate the issue.<div>

<br></div><div>IF the rule &quot;<span style="color:green;font-family:&#39;Courier New&#39;;font-size:10pt;line-height:115%">After No data received within the last 1 hour Error,
now resumed</span>&quot; is included, memory leaks happens, and pretty quickly.</div><div>IF such rule is commented out, application do manage to keep alive.</div><div><br></div><div>[&gt;] Question kindly is: is this normal on 6.1.0.beta4, or shall I go ahead and raise a JIRA for this, please?</div>


<div><br></div><div>This time I ask in the mailinglist first, just because last time I experienced a similar issue and raised JIRA, but in fact at the end was just another way to replicate a known issue.</div><div><br></div>


<div>Thank you in advance</div><div>Ciao,</div><div>MM</div><div><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">package</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">
com.acme.drools6test.anotherleak;</span><br></div><div>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">import</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">
com.acme.objectmodel.*</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:olive">// we take time is insertion time
of SensorReading</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">declare</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> SensorReading</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      @role(event)</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">declare</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> Alert</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      @role(event)</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">declare</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> AlertErrorToken</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      @role(event)</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      @timestamp(ts)</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      ts
: </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">long</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">declare</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> AMap</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      @role(fact)</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      map
: java.util.HashMap</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">query</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;AMap&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      $AMap
: AMap()</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">query</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;Alerts&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      $alert
: Alert()</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">query</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;All&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      $o
: Object()</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">rule</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;init
AMap&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">  </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">no-loop</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">when</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">not</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> ( AMap() )</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">then</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      AMap
t = </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">new</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> AMap();</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      t.setMap(
</span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">new</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">
java.util.HashMap() );</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">insert</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">( t );</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">rule</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;to display
a kind of single table that list most recent value&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">    </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">no-loop</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">when</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      $sr
: SensorReading($id : <a href="http://header.id" target="_blank">header.id</a> , $value : value)</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      AMap($map
: map)</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">then</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      $map.put($id,
$value);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">rule</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;No data
received within the last 1 minutes Warning&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">   </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">no-loop</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">when</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      $sr
: SensorReading()</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">not</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">( SensorReading(
</span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">this</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> != $sr, </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">this</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> after[0,1m] $sr
) )</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">not</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">( Alert( sr ==
$sr, type == AlertType.WARNING ) )</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">then</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      Alert
alert = </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">new</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">
Alert(kcontext.getKieRuntime().getSessionClock().getCurrentTime(), </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;No data
received within the last 1 minutes&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">,   AlertType.WARNING,
$sr);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">insert</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">(alert);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      System.out.println(</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;1 minutes
Warning insert &quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> + alert);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:olive">// send WARNING
notification</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">rule</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;No data
received within the last 1 hour Error&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">  </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">no-loop</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">when</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      $sr
: SensorReading()</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">not</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">( SensorReading(
</span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">this</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> != $sr, </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">this</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> after[0,1h] $sr
) )</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">not</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">( Alert( sr ==
$sr, type == AlertType.ERROR ) )</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">then</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">long</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> errTs =
kcontext.getKieRuntime().getSessionClock().getCurrentTime();</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      Alert
alert = </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">new</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> Alert(errTs, </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;No data received within the last 1 hour&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">,      AlertType.ERROR, $sr);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">insert</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">(alert);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      AlertErrorToken
errToken = </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">new</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> AlertErrorToken();</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      errToken.setTs(errTs);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">insert</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">(errToken);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      System.out.println(</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;last 1
hour Error insert &quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> + alert);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:olive">// send ERROR
notification</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">rule</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;After No
data received within the last 1 hour Error, now resumed&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">no-loop</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">when</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      $errToken
: AlertErrorToken()</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      $errAlert
: Alert(</span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">this</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> coincides $errToken)</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      SensorReading(
</span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">this</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> after $errToken
) </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">then</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">retract</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">($errToken);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      System.out.println(</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;now
resumed retract &quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> + $errToken);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">      </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:olive">// send INFO
resume notification</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">rule</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;Housekeep
rule&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">salience</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> -1000</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">no-loop</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">dialect</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;mvel&quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">when</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">    $last : SensorReading( )  over window:length( 1 )</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">    $earlier : SensorReading( </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">this</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> before $last, </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">this</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> != $last )</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">then</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">    </span><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">retract</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">($earlier);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>




<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">    System.out.println(</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;Housekeep
: &quot;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">+$earlier);</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal"><b><span style="font-size:10pt;line-height:115%;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b></p></div><div><br></div></div></div></div>