<br>&gt; <font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">I guess the rule engine doesn’t
allow matching against literal strings from within accumulate &lt;src 
regex
pattern&gt;<br><br>  That is *not* true. The engine is consistent. Wherever you have a pattern, you can write any kind of constraint, does not matter if the pattern is nested in an accumulate, it it is a top level pattern, or whatever.<br>
<br>   You have a different problem there. It is not the literal constraint for sure.<br><br>    Edson</span></font>   <br><br><br><div class="gmail_quote">2010/4/13 Badrinath, Shyam <span dir="ltr">&lt;<a href="mailto:sbadrinath@sonusnet.com">sbadrinath@sonusnet.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">









<div link="blue" vlink="blue" lang="EN-US">

<div>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Hi</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">I figured out how to make the &lt;src regex
pattern&gt; in ‘accumulate’ match the criteria I am interested in.
In the example below, I was matching against a literal string from within ‘accumulate’,
but apparently that doesn’t work. Instead, if I give it as follows:</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p class="MsoNormal"><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">$c: Cpu(srcIp ==
&#39;10.155.21.86&#39; &amp;&amp; destIp == &#39;10.6.35.120&#39;)</span></font></p>

<p class="MsoNormal"><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">$cpuMin:
Number(intValue &gt;=80) from accumulate(Cpu(srcIp == $c.srcIp &amp;&amp;
destIp == $c.destIp, $val:value) over window:time(5s), min($val)</span></font></p>

<p class="MsoNormal"><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">So, it looks like it binds a subset of the
Cpu objects that match the criteria to $c and then we need to use that variable
to compare against, within our accumulate function. </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">I guess the rule engine doesn’t
allow matching against literal strings from within accumulate &lt;src regex
pattern&gt;</span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">$cpuMin:
Number(intValue &gt;=80) from accumulate(Cpu(srcIp ==
’10.155.21.86’ &amp;&amp; destIp == ’10.6.35.120’,
$val:value) over window:time(5s), min($val)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Also, is it possible to configure the firing
policy in the first sliding window as you suggested below?</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Thanks</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Shyam</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<div>

<div class="MsoNormal" style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">

<hr align="center" size="2" width="100%">

</span></font></div>

<p class="MsoNormal"><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> Badrinath, Shyam
<br>
<b><span style="font-weight: bold;">Sent:</span></b> Monday, April 12, 2010 1:26
PM<br>
<b><span style="font-weight: bold;">To:</span></b> &#39;Rules Users List&#39;<br>
<b><span style="font-weight: bold;">Subject:</span></b> RE: [rules-users]
drools-fusion: rule firing erroneously for thefirst time in a sliding window</span></font></p>

</div><div><div></div><div class="h5">

<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Hi Edson</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Thanks for the clarification. The sliding
window implementation does wait for 5s, later on during a test, before
activating the rule. So, theoretically, there shouldn’t be any difference
in behavior, even at the beginning, whether the clock is in pseudo or real
mode.</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Lets assume t(0) is the start, then
nothing should fire atleast until t(0+5) and it should be the same for the
window between t(n) and t(n+5).</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Also, I noticed that the accumulate function seems to ignore the
regex in the &lt;src pattern&gt;. For example, given the rule below, if I
insert Cpu events with no matching srcIp and destIp, then I would expect no
rule to fire, since the window would look at only the Cpu objects in working
memory that match the criteria below. Am I missing something? </span></font><font color="navy"><span style="color: navy;"></span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">$cpuMin
: Number(intValue &gt;= 80) from accumulate(</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">$cpu
: Cpu($v : value, srcIp ==’&lt;val1&gt;’ &amp;&amp; destIp ==
‘&lt;val2&gt;’) over window:time(5s), min($v)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<div>

<div class="MsoNormal" style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">

<hr align="center" size="2" width="100%">

</span></font></div>

<p class="MsoNormal"><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">
<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><span style="font-weight: bold;">On
Behalf Of </span></b>Edson Tirelli<br>
<b><span style="font-weight: bold;">Sent:</span></b> Monday, April 12, 2010 12:10
PM<br>
<b><span style="font-weight: bold;">To:</span></b> Rules Users List<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users]
drools-fusion: rule firing erroneously for thefirst time in a sliding window</span></font></p>

</div>

<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>

<p class="MsoNormal" style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
    Hi,<br>
<br>
    Yes, the current implementation for sliding time windows
does not wait for a window to move before starting to fire rules. As soon as
the constraint is met, it will activate the rule. The question is: should the
sliding window delay before firing? should it be configurable? <br>
<br>
   I need to do some research on that. Comments are welcome.<br>
<br>
   Edson</span></font></p>

<div>

<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">2010/4/12 Badrinath, Shyam &lt;<a href="mailto:sbadrinath@sonusnet.com" target="_blank">sbadrinath@sonusnet.com</a>&gt;</span></font></p>


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

<div>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Hi</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">I am using
Drools 5.1.0 M1 within Eclipse. I am trying out a sample rule, which fires if
the minimum cpu is over 80 for 5s using sliding windows. I see that it works
well over a running window of 5s, but for the first time, it fires even before
reaching 5s.</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">It seems to
ignore the fact that 5s hasn’t elapsed yet. I am using the engine in
STREAM mode and using a pseudo clock to advance the time manually.</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Is this the
expected behavior? Thanks!</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">sb</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Here is the
rule:</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">package
org.drools.examples</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">import
org.drools.examples.CpuMetric.Cpu;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">import
org.drools.examples.CpuMetric.Alarm;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">global
org.apache.log4j.Logger logger</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">declare
Cpu</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
@role(event)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
@expires(5s)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">end</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">rule
&quot;Above Cpu threshold of 80 for 5s&quot;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
dialect &quot;java&quot;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
when</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
not Alarm()</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
$cpuMin : Number(intValue &gt;= 80) from accumulate(</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
$cpu : Cpu($v : value) over window:time(5s), min($v)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
then</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
<a href="http://logger.info" target="_blank">logger.info</a>(&quot;Cpu above 80
for 5 s, raising alarm. min cpu: &quot;+$cpuMin);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
Alarm a = new Alarm();</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
a.setReason(&quot;raised alarm as we hit cpu threshold&quot;);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
a.setTime(System.currentTimeMillis());</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
insert(a);        </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">end</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Here is the
snippet of the class that declares the Cpu and Alarm class as well inserts events
into the rule engine. The other thing I noticed is the accumulate function
seems to ignore the regex in the &lt;src pattern&gt;. For example, in the rule
above, if I give </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">$cpuMin
: Number(intValue &gt;= 80) from accumulate(</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">$cpu
: Cpu($v : value, srcIp ==’&lt;val1&gt;’ &amp;&amp; destIp ==
‘&lt;val2&gt;’) over window:time(5s), min($v)</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">And insert
cpu events, with no matching srcIp and destIp, I shouldn’t see any alarm
raised, but I do and right at the beginning.</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
. . ... (code before this..)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
//to use sliding windows, have to run the engine in stream mode</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
//default is cloud mode..where there are no concept of time and</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
//event     ordering</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
KnowledgeBaseConfiguration kbaseconfig =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
kbaseconfig.setOption(EventProcessingOption.STREAM);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
// add the packages to a knowledgebase (deploy the knowledge packages).</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbaseconfig);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
kbase.addKnowledgePackages(pkgs);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
KnowledgeSessionConfiguration conf =
KnowledgeBaseFactory.newKnowledgeSessionConfiguration();</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
conf.setOption(ClockTypeOption.get(&quot;pseudo&quot;));</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(conf,
null);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
//get clock to manually advance and test firing..</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
SessionPseudoClock clock = ksession.getSessionClock();</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
<a href="http://logger.info" target="_blank">logger.info</a>(&quot;Pseudo clock
current time: &quot;+clock.getCurrentTime());</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
ksession.setGlobal(&quot;logger&quot;, logger);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
ksession.addEventListener(new DebugAgendaEventListener());</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
ksession.addEventListener(new DebugWorkingMemoryEventListener());</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
// setup the audit logging</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
KnowledgeRuntimeLogger krlogger = KnowledgeRuntimeLoggerFactory</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
.newFileLogger(ksession, &quot;log/cpu&quot;);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
BufferedReader bf = new BufferedReader(new
FileReader(&quot;/opt/cpumetricdata.txt&quot;));</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
String s;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
long time=0;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
int count=0;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
long lastime=0;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
int delta=0;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
//<a href="http://logger.info" target="_blank">logger.info</a>(&quot;Advancing
5s right at the start&quot;);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
//clock.advanceTime(5000, TimeUnit.MILLISECONDS);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
while((s = bf.readLine()) != null)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    String[] vals = s.split(&quot;,&quot;);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    Cpu cpumetric = new Cpu();</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    cpumetric.setValue(Integer.parseInt(vals[1]));</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    //set in ms</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    //for the first time, initialize time and lastime</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    //to the value read in from the first line.</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    time = Long.parseLong(vals[0]);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    if(count ==0)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    {</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
lastime = time;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
<a href="http://logger.info" target="_blank">logger.info</a>(&quot;Initialized
lastime to &quot;+lastime);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    }</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    cpumetric.setTime(time);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    cpumetric.setSrcIp(&quot;10.155.21.86&quot;);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    cpumetric.setDestIp(&quot;10.6.35.120&quot;);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    <a href="http://logger.info" target="_blank">logger.info</a>(&quot;Inserted
cpu metric &quot;+cpumetric);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    <a href="http://logger.info" target="_blank">logger.info</a>(&quot;Count:
&quot;+count+&quot; Pseudo clock current time: &quot;+clock.getCurrentTime());</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    ksession.insert(cpumetric);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    ksession.fireAllRules();</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    //advance based on the read in time in ms</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    //do it only from the second insert onwards</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    delta=(int) (time-lastime);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    if(count &gt;=1)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    {</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
clock.advanceTime(delta, TimeUnit.MILLISECONDS);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
<a href="http://logger.info" target="_blank">logger.info</a>(&quot;Pseudo clock
advanced &quot;+delta+ &quot;ms&quot;);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    }</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    count++;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    lastime=time;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
System.out.println(&quot;Inserted facts, current time is &quot;+new Date());</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
krlogger.close();</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
ksession.dispose();</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
bf.close();</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">   
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">   
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">   
public static class Alarm</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">   
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
private String reason;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
private long time;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
private String type;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @return the reason</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public String getReason()</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    return reason;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @param reason the reason to set</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public void setReason(String reason)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    this.reason = reason;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @return the time</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public long getTime()</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    return time;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @return the type</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public String getType()</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    return type;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @param type the type to set</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public void setType(String type)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    this.type = type;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @param time the time to set</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public void setTime(long time)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    this.time = time;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">   
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">   
public static class Cpu implements Serializable</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">   
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
private long time;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
private int value;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
private String srcIp;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
private String destIp;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/* (non-Javadoc)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @see java.lang.Object#toString()</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
@Override</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public String toString()</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    return &quot;Cpu [time=&quot; + time + &quot;, value=&quot;
+ value + &quot;]&quot;;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @return the time</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public long getTime()</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    return time;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @param time the time to set</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public void setTime(long time)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    this.time = time;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @return the srcIp</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public String getSrcIp()</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    return srcIp;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @param srcIp the srcIp to set</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public void setSrcIp(String srcIp)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    this.srcIp = srcIp;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @return the destIp</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public String getDestIp()</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    return destIp;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @param destIp the destIp to set</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public void setDestIp(String destIp)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    this.destIp = destIp;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @return the value</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public int getValue()</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    return value;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
/**</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 * @param value the value to set</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
 */</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
public void setValue(int value)</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
    this.value = value;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">   
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Data
that drives the insertion:</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">1358,81</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">2359,86</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">3360,88</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">4361,80</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">5362,84</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">6363,80</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">7364,83</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">8365,99</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">9366,97</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">10367,99</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

</div>

</div>

<p class="MsoNormal" style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><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></span></font></p>

</div>

<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><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></span></font></p>

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