<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><br><br></div><div><br>On Feb 27, 2014, at 4:06 PM, "lin.lin [via Drools]" &lt;<a href="mailto:ml-node+s46999n4028396h13@n3.nabble.com">ml-node+s46999n4028396h13@n3.nabble.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div>

        Hi 
<br><br>&nbsp; &nbsp;Thanks again for the pointers!!
<br><br>&nbsp; &nbsp;I modified the code but the sliding window rule does not seem to be working as how I want it to be(copied shown in the following). &nbsp;I injected 6 events, one event every 10 seconds, the first one is less than 90, the rest are more than 90. &nbsp;I am expecting getting 3 alerts at 4th event, 5th event and 6 event. But instead I only get one alert.
<br><br>&nbsp; when 
<br>&nbsp; &nbsp; not Reading( reading &lt;= 90 ) over window:time( 30s ) from entry-point ReadingStream
<br>&nbsp; then 
<br>&nbsp; &nbsp; &nbsp;System.out.print ("alert: Reading high for 30 seconds \n"); 
<br><br>&nbsp; 
<br>&nbsp; So I used the other way as you suggested. It works and gives me 3 alerts. However if I added the accumulate pattern (copied below) , no alert is generated at all. &nbsp;If I removed the first 3 patterns, just leave the last pattern, it does print the average of last 30 seconds event every time when a new event is injected. What else did I do wrong?
<br><br>&nbsp; &nbsp; &nbsp; when
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $r1: Reading( reading &gt;90 ) from entry-point HeartrateStream
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $r2: Reading( reading &gt; 90, this after[30s,30s] $r1 ) from entry-point HeartrateStream
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; not (Reading( reading &lt;= 90, this after $r1, this before $r2 ) from entry-point HeartrateStream)
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$averg: Number() from accumulate( Reading ( $r:reading) over windiw:time(30s) from entry-point HeartrateStream, average($r) )
<br>&nbsp; &nbsp; &nbsp; then
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.print ("alert: Reading high for 30 seconds, average reading"+$averg+"\n"); 
<br><br><br>Thanks a lot!!!
<br>Lin
<br>&nbsp; &nbsp; 
<br><br><br>

        
        
        
        <br>
        <br>
        <hr noshade="noshade" size="1" color="#cccccc">
        <div style="color:#444; font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://drools.46999.n3.nabble.com/sliding-window-question-tp4028367p4028396.html">http://drools.46999.n3.nabble.com/sliding-window-question-tp4028367p4028396.html</a>
        </div>
        <div style="color:#666; font: 11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from sliding window question, <a href="http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&amp;node=4028367&amp;code=bGluLmxpbkBjb21jYXN0Lm5ldHw0MDI4MzY3fC0xODk3NDMyNjQ3">click here</a>.<br>
                <a href="http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp;breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif">NAML</a>
        </div></div></blockquote></body></html>