What is the problem - I assume the rule is not firing?<br><br>Many things can go wrong here:<br> - Is Event declared properly in the DRL?<br> - Is the session run properly?<br> - Is the insert call correct?<br><br>In short, a full working example would be required, and the Drools version you are using.<br>
<br>-W<br><br><br><div class="gmail_quote">2011/6/13 Nicolás Sanchez <span dir="ltr"><<a href="mailto:sancheznicolas89@gmail.com">sancheznicolas89@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I have written the next rule :<br><br>rule "Too many events in a short period of time"<br>dialect "mvel" <br><br>when<br> $user : User()<br> Number(intValue > 3) from accumulate($event : Event(userId == $<a href="http://user.id" target="_blank">user.id</a>) over window:time(1m) from entry-point Event , count($event))<br>
then<br> //Java code...<br>end<br><br>And the events, I insert in the Event entrypoint, are 4 and have these timestamps:<br><br>Calendar cal1 = Calendar.getInstance();<br>cal1.set(2010,9,23,10,30,00);<br>Calendar cal2 = Calendar.getInstance();<br>
cal2.set(2010,9,23,10,30,05);<br>Calendar cal3 = Calendar.getInstance();<br>cal3.set(2010,9,23,10,30,10);<br>Calendar cal4 = Calendar.getInstance();<br>cal4.set(2010,9,23,10,30,15);<br><br>Has the rule any syntax or semantic problem, knowing that i aim to catch if there has been more than 3 events in the last minute?<br>
<br>-- <br><font color="#888888"><div>Nicolás Sanchez</div>
<div><br></div><br><div style="padding: 0px; overflow: hidden; margin-left: 0px; margin-top: 0px; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;"></div><br>
<div style="padding: 0px; overflow: hidden; margin-left: 0px; margin-top: 0px; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;">
</div>
</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>