<font size="2">
<div>Hi,</div>
<div> </div>
<div>Thanks for your immediate response.</div>
<div> </div>
<div>I&#39;ve attached the source code with this.</div>
<div> </div>
<div>OMMain.java is where I used the approach you gave in the Drools fusion Example. that is, scheduling the jobs by having current time as base timestamp.</div>
<div> </div>
<div></div></font>It works as expected in the above case.
<div> </div>
<div>OMMainBatch is the one which triggers batch processing of events. This is where I set the basetimestamp as  <font face="verdana,sans-serif" size="1">1220859119428l which is </font><font size="2">Mon Sep 08 13:01:59 IST 2008.</font></div>

<div> </div>
<div><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">
<p align="left">public</p></font></font></b><font size="1"> </font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">class</font></font></b><font size="1"> OMMainForBatch {
<p align="left"></p>
<p align="left"></p></font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">public</font></font></b><font size="1"> </font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">static</font></font></b><font size="1"> </font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">void</font></font></b><font size="1"> main(String[] args) </font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">throws</font></font></b><font size="1"> Exception {
<p align="left"></p>
<p align="left">OMProcessor omProcessor = </p></font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">new</font></font></b><font size="1"> OMProcessor();
<p align="left">OMSource source = </p></font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">new</font></font></b><font size="1"> OMSource();
<p align="left">source.openForRead( </p></font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">new</font></font></b><font size="1"> InputStreamReader( OMMainForBatch.</font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">class</font></font></b><font size="1">.getResourceAsStream( </font><font color="#2a00ff" size="1"><font color="#2a00ff" size="1">&quot;/OMoutput.txt&quot;</font></font><font size="1"> ) ), 
<p align="left">1220859119428l );</p>
<p align="left"></p>
<p align="left"></p></font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">while</font></font></b><font size="1"> ( source.hasNext() ) {
<p align="left">Event&lt; ? &gt; event = source.getNext();</p>
<p align="left">omProcessor.receive(event);</p>
<p align="left">}</p>
<p align="left">omProcessor.dispose();</p>
<p align="left">}</p>
<p>}</p></font></div><font size="1">
<p align="left">//In OMSource.java, I add basetimestamp with the first column</p></font>
<p align="left"><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">public</font></font></b><font size="1"> OMTicket load() </font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">throws</font></font></b><font size="1"> ParseException, IOException {</font></p>

<p align="left">String input = <font color="#0000c0" size="1"><font color="#0000c0" size="1">in</font></font><font size="1">.readLine();</font></p>
<p align="left"><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">if</font></font></b><font size="1"> (input == </font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">null</font></font></b><font size="1">) </font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">return</font></font></b><font size="1"> </font><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">null</font></font></b><font size="1">;</font></p>

<p align="left">Object[] results = <font color="#0000c0" size="1"><font color="#0000c0" size="1">format</font></font><font size="1">.parse( input );</font></p>
<p align="left">OMTicket tick = <b><font color="#7f0055" size="1"><font color="#7f0055" size="1">new</font></font></b><font size="1"> OMTicket( ((String)results[2]).trim(),</font></p>
<p align="left">((String) results[1]).trim(),</p>
<p align="left"><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">new</font></font></b><font size="1"> Date(((Number)results[0]).longValue() + </font><font color="#0000c0" size="1"><font color="#0000c0" size="1">baseTimestamp</font></font><font size="1"> ));</font></p>

<p align="left"><b><font color="#7f0055" size="1"><font color="#7f0055" size="1">return</font></font></b><font size="1"> tick;</font></p>
<p>}</p>
<div>If I need to use PSEUDO_CLOCK, how can I make it available for the Engine.</div>
<div> </div>
<div><br> </div>
<div class="gmail_quote">2009/6/8 Edson Tirelli <span dir="ltr">&lt;<a href="mailto:tirelli@post.com">tirelli@post.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>   I can&#39;t say for sure that the results are right or wrong, because when time is involved, a lot of things must be taken in consideration. So, assuming you are using the fusion example as is, with the only difference that you are using your input/rules, meaning specifically that you are using the event feeder, knowledge base configured to stream mode and real time session clock, it is necessary to check what is discrepant between the results.<br>
<br>  Please note that since the engine is running in near-realtime as well as event feeders are running in near-realtime, you might have interferences from threads and processes running in the same machine. In other words, for your 3 inputs bellow and a time-window of 5 seconds, I would not be surprised if sometimes events 1 and 3 are reported in the same window and sometimes they don&#39;t since each one of them sit at one of the edges of the window.<br>
<br>   I would be concerned if events 2 and 3 are not in the same window and unless your machine is swapping or heavily loaded, events 1 and 2 should also be reported in the same window.<br><br>   If you want to test the actual algorithm with extreme precision, the only way I know is using the PSEUDO_CLOCK, so that the application can completely control the time flow with discrete advances.<br>
<br>   If the above is not what you are seeing, please give more details.<br><br>   Thank you,<br>     Edson<br><br>
<div class="gmail_quote">2009/6/8 PriyaSha <span dir="ltr">&lt;<a href="mailto:nash.8103@gmail.com" target="_blank">nash.8103@gmail.com</a>&gt;</span> 
<div>
<div></div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div><br>Hi,</div>
<div> </div>
<div>I had a chance to go through the fusion sample. I tried the same example with another logfile as input</div>
<div><font size="2">
<p align="left">Input:</p>
<p align="left">1000 critical Symantec</p>
<p align="left">5000 critical Symantec</p>
<p>6000 critical Symantec</p>
<p></p></font>Here I set the timestamp as ( some date in the past + first column of the input). </div>
<div><b><font color="#960000" size="2"><font color="#960000" size="2">
<p align="left">Following is the simple DRL which has the rule to count number of OMTicket using sliding window.</p>
<p align="left">package</p></font></font></b><font size="2">org.drools.examples.broker; 
<p align="left"></p></font><b><font color="#960000" size="2"><font color="#960000" size="2">
<p align="left">import</p></font></font></b><font size="2">org.drools.examples.broker.model.OMTicket; 
<p align="left"></p></font><b><font color="#960000" size="2"><font color="#960000" size="2">
<p align="left">dialect</p></font></font></b><font size="2"></font><font color="#008000" size="2"><font color="#008000" size="2">&quot;mvel&quot;</font></font><font size="2"> 
<p align="left"></p></font><b><font color="#960000" size="2"><font color="#960000" size="2">
<p align="left">declare</p></font></font></b><font size="2">OMTicket 
<p align="left">@role( event )</p>
<p align="left">@timestamp (timestamp)</p>
<p align="left">@expires (1h)</p></font><b><font color="#960000" size="2"><font color="#960000" size="2">
<p align="left">end</p></font></font></b><font size="2">
<p align="left"></p></font><b><font color="#960000" size="2"><font color="#960000" size="2">
<p align="left">rule</p></font></font></b><font size="2"></font><font color="#008000" size="2"><font color="#008000" size="2">&quot;Count over last 5 seconds&quot;</font></font><b><font color="#960000" size="2"><font color="#960000" size="2"> 
<p align="left">salience</p></font></font></b><font size="2">10</font><b><font color="#960000" size="2"><font color="#960000" size="2"> 
<p align="left">no-loop</p></font></font></b><font size="2"></font><b><font color="#960000" size="2"><font color="#960000" size="2">true 
<p align="left">when</p></font></font></b><font size="2">
<p align="left">Number( $count : intValue ) </p></font><b><font color="#960000" size="2"><font color="#960000" size="2">from</font></font></b><font size="2"> </font><b><font color="#960000" size="2"><font color="#960000" size="2">accumulate</font></font></b><font size="2"> ( 
<p align="left">OMTicket($severity:severity) over window:time(5s) </p></font><b><font color="#960000" size="2"><font color="#960000" size="2">from</font></font></b><font size="2"> entry-point </font><font color="#008000" size="2"><font color="#008000" size="2">&quot;OM stream&quot;</font></font><font size="2">, count() )</font><b><font color="#960000" size="2"><font color="#960000" size="2"> 
<p align="left">then</p></font></font></b><font size="2">
<p align="left">System.out.println(</p></font><font color="#008000" size="2"><font color="#008000" size="2">&quot;Number of Critical Tickets over last 5 seconds : &quot;</font></font><font size="2"> + $count);</font><font color="#960000" size="2"><font color="#960000" size="2"> 
<p><b>end</b></p>
<p><font color="#000000">Here, I just read and insert facts as events with no scheduling.</font></p>
<p><font color="#000000">But the ouput varies for each invocation and it is also not as expected.</font></p>
<p><font color="#000000">Am I missing any configuration here?</font></p>
<p><font color="#000000"></font> </p></font></font></div></blockquote></div></div></div><font color="#888888"><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com/" target="_blank">www.jboss.com</a><br>
</font><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">
<div></div><br>-- <br>Regards,<br>PriyaKathan<br>