<span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse">Dear all :<div><br></div><div>We have been using Drools Expert in our various projects. Now we are to use Drools Fusion v5.0.1 in our project for CEP.</div>
<div><br></div><div>We are trying to get SlidingTimeWindow function working... My Rule is like below</div><div><br></div><div>********************************</div><div><div>declare MyEvent</div><div> @role( event )</div>
<div> @timestamp(eventDateTime)</div><div>end</div><div><br></div><div>rule "Rule1"</div><div>when</div><div> $event: MyEvent() over window:time( 2s ) from entry-point "My Stream"</div><div>then</div>
<div> System.out.println($event.getEventName() + ": Event Occured!!!" + $event.getEventDateTime().toString());</div><div>end</div><div>*******************************</div><div><br></div><div>MyEvent is a Java Bean with eventName and eventDateTime attributes.</div>
<div><br></div><div>And my java code looks like below :</div><div><br></div><div>MyEvent e1 = new MyEvent("Meeting1", new Date(110, 1, 25, 10, 30)); </div><div>MyEvent e2 = new MyEvent("Meeting2", new Date(110, 1, 25, 10, 33)); </div>
<div>...</div><div>...</div><div>session.insert(e1);</div><div>Thread.sleep(5000);</div><div>session.insert(e2);</div><div>session.fireAllRules();</div><div><br></div><div>Here Since all these events time stamps indicate they had happened long back...when I evaluate the rule, I should not see any event picked up...</div>
<div>But I see the following output...</div><div><br></div><div><div>Meeting2: Event Occured!!!Thu Feb 25 10:33:00 IST 2010</div><div>Meeting1: Event Occured!!!Thu Feb 25 10:30:00 IST 2010</div><div><br></div><div>This example seems to pretty simple, but I am wondering whats going wrong. Am I missing anything here? Any help would be greatly appreciated.</div>
<div><br></div></div><div>Thanks.</div><div><br></div>Best regards,<br>Karthik Krishnan.<br><a href="http://karthiks.in" style="color:rgb(119, 153, 187)" target="_blank">http://karthiks.in</a></div></span>Best regards,<br>
Karthik Krishnan.<br><a href="http://karthiks.in" target="_blank">http://karthiks.in</a><br>