Thanks for your email below. I needed to refactor my code somewhat to get this technique to work but it solved the problem that I had. 
<br/><br/>I was previously using fireAllRules() but I refactored the code to use fireUntilHalt() instead, which required some additional work to make a couple of other supporting features behave properly. I know you don't strictly need to do this, but it needed to be done anyway and it made sense to do it now.
<br/><br/>I would have thought it was quite a common scenario where someone wanted to implement business logic such as:
<br/><br/>- Something happens
<br/>- It is expected that something else will happen within a certain time period of the first thing happening
<br/>- If the second thing doesn't happen within the time period, generate an alert
<br/><br/>I ran into trouble because my various rules (from my original email) wouldn't fire an alert as expected when I fed in simulated events. 
<br/><br/>I'm curious as to why you think it's interesting that the four rules below fail to meet my expectation? I suppose it's the fact that I'm a drools newbie and the issue here is probably just my inexperience mapping business logic into drools rules. 
<br/><br/>daveor
<br/><br/>On 15 Feb 2014, at 09:49, laune [via Drools] wrote:
<br/><div class='shrinkable-quote'><br/>&gt; It would be interesting to discuss why each of these four rules fails to 
<br/>&gt; meet you expectation. Mostly it's due to the engine not evaluating 
<br/>&gt; exactly one minute after the &quot;certain event&quot; arrives. 
<br/>&gt; 
<br/>&gt; The following rule fires 1 minute after the evaluation of the arrival 
<br/>&gt; of an Event according to constraints and when no second Event 
<br/>&gt; (according to constraints not shown) has arrived since then. 
<br/>&gt; 
<br/>&gt; rule &quot;Something Else&quot; dialect &quot;mvel&quot; 
<br/>&gt; &nbsp; &nbsp; timer ( int: 1m ) 
<br/>&gt; when 
<br/>&gt; &nbsp; &nbsp; $e1: Event($location: properties[&quot;location&quot;] &amp;&amp; ...) 
<br/>&gt; &nbsp; &nbsp; not Event(..., this after $e1) 
<br/>&gt; then 
<br/>&gt; &nbsp; &nbsp;... 
<br/>&gt; end 
<br/>&gt; 
<br/>&gt; -W 
<br/>&gt; 
<br/>&gt; On 14/02/2014, daveor &lt;[hidden email]&gt; wrote:
<br/>&gt; 
<br/>&gt; &gt; Hi there, 
<br/>&gt; &gt; 
<br/>&gt; &gt; I'm a drools newbie and I wonder if someone could help me. I'm using drools 
<br/>&gt; &gt; 6.0.1 and I'm trying to write a rule that fires when: 
<br/>&gt; &gt; 
<br/>&gt; &gt; 1) a certain event is seen and 
<br/>&gt; &gt; 2) a second event is not seen within a certain period of time (1 minute in 
<br/>&gt; &gt; the examples below) after the first event is seen 
<br/>&gt; &gt; 
<br/>&gt; &gt; I have tried the following LHS patterns: 
<br/>&gt; &gt; 
<br/>&gt; &gt; rule &quot;Something&quot; dialect &quot;mvel&quot; 
<br/>&gt; &gt; when 
<br/>&gt; &gt; &nbsp; &nbsp; $e1: Event($location: properties[&quot;location&quot;] &amp;&amp; ...) 
<br/>&gt; &gt; &nbsp; &nbsp; not Event(...., this after $e1) 
<br/>&gt; &gt; then 
<br/>&gt; &gt; &nbsp; &nbsp; //do stuff 
<br/>&gt; &gt; end 
<br/>&gt; &gt; 
<br/>&gt; &gt; rule &quot;Something&quot; dialect &quot;mvel&quot; 
<br/>&gt; &gt; when 
<br/>&gt; &gt; &nbsp; &nbsp; $e1: Event($location: properties[&quot;location&quot;] &amp;&amp; ...) 
<br/>&gt; &gt; &nbsp; &nbsp; not Event(...., this after[0, 1m] $e1) 
<br/>&gt; &gt; then 
<br/>&gt; &gt; &nbsp; &nbsp; //do stuff 
<br/>&gt; &gt; end 
<br/>&gt; &gt; 
<br/>&gt; &gt; rule &quot;Something&quot; dialect &quot;mvel&quot; 
<br/>&gt; &gt; when 
<br/>&gt; &gt; &nbsp; &nbsp; $e1: Event($location: properties[&quot;location&quot;] &amp;&amp; ...) 
<br/>&gt; &gt; &nbsp; &nbsp; List (size == 0) from collect (Event(..., this after $e1) over 
<br/>&gt; &gt; window:time(1m)) 
<br/>&gt; &gt; then 
<br/>&gt; &gt; &nbsp; &nbsp; //do stuff 
<br/>&gt; &gt; end 
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; rule &quot;Something&quot; dialect &quot;mvel&quot; 
<br/>&gt; &gt; when 
<br/>&gt; &gt; &nbsp; &nbsp; $e1: Event($location: properties[&quot;location&quot;] &amp;&amp; ...) 
<br/>&gt; &gt; &nbsp; &nbsp; List (size == 0) from collect (Event(...) over window:time(1m)) 
<br/>&gt; &gt; then 
<br/>&gt; &gt; &nbsp; &nbsp; //do stuff 
<br/>&gt; &gt; end 
<br/>&gt; &gt; 
<br/>&gt; &gt; The unwanted behaviours are as follows: 
<br/>&gt; &gt; 
<br/>&gt; &gt; In the first case, the rule fires immediately after the first event is 
<br/>&gt; &gt; inserted. 
<br/>&gt; &gt; In the second case, the rule fails to fire if the second event is seen (as 
<br/>&gt; &gt; expected) but the rule does not fire if the second event is not seen within 
<br/>&gt; &gt; 1 minute. 
<br/>&gt; &gt; In the third and fourth cases, the rule fires immediately after the first 
<br/>&gt; &gt; event is inserted. 
<br/>&gt; &gt; 
<br/>&gt; &gt; Event is a java class with a hash map of properties, defined with the 
<br/>&gt; &gt; following metadata: 
<br/>&gt; &gt; 
<br/>&gt; &gt; declare Event 
<br/>&gt; &gt; @role(event) 
<br/>&gt; &gt; end 
<br/>&gt; &gt; 
<br/>&gt; &gt; I would really appreciate if someone could help me out here. 
<br/>&gt; &gt; 
<br/>&gt; &gt; Thanks and let me know if you need any more info. 
<br/>&gt; &gt; 
<br/>&gt; &gt; Dave 
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; -- 
<br/>&gt; &gt; View this message in context: 
<br/>&gt; &gt; <a href="http://drools.46999.n3.nabble.com/Help-with-event-not-found-over-window-query-tp4028129.html" target="_top" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Help-with-event-not-found-over-window-query-tp4028129.html</a><br/>&gt; &gt; Sent from the Drools: User forum mailing list archive at Nabble.com. 
<br/>&gt; &gt; _______________________________________________ 
<br/>&gt; &gt; rules-users mailing list 
<br/>&gt; &gt; [hidden email] 
<br/>&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_top" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</a><br/>&gt; &gt;
<br/>&gt; _______________________________________________ 
<br/>&gt; rules-users mailing list 
<br/>&gt; [hidden email] 
<br/>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_top" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</a><br/>&gt; 
<br/>&gt; 
<br/>&gt; If you reply to this email, your message will be added to the discussion below:
<br/>&gt; <a href="http://drools.46999.n3.nabble.com/Help-with-event-not-found-over-window-query-tp4028129p4028131.html" target="_top" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Help-with-event-not-found-over-window-query-tp4028129p4028131.html</a><br/>&gt; To unsubscribe from Help with event not found over window query, click here.
<br/>&gt; NAML
</div><br/>

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://drools.46999.n3.nabble.com/Help-with-event-not-found-over-window-query-tp4028129p4028171.html">Re: [rules-users] Help with event not found over window query</a><br/>
Sent from the <a href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html">Drools: User forum mailing list archive</a> at Nabble.com.<br/>