<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]" <<a href="mailto:ml-node+s46999n4028396h13@n3.nabble.com">ml-node+s46999n4028396h13@n3.nabble.com</a>> wrote:<br><br></div><blockquote type="cite"><div>
        Hi
<br><br> Thanks again for the pointers!!
<br><br> 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). I injected 6 events, one event every 10 seconds, the first one is less than 90, the rest are more than 90. I am expecting getting 3 alerts at 4th event, 5th event and 6 event. But instead I only get one alert.
<br><br> when
<br> not Reading( reading <= 90 ) over window:time( 30s ) from entry-point ReadingStream
<br> then
<br> System.out.print ("alert: Reading high for 30 seconds \n");
<br><br>
<br> 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. 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> when
<br> $r1: Reading( reading >90 ) from entry-point HeartrateStream
<br> $r2: Reading( reading > 90, this after[30s,30s] $r1 ) from entry-point HeartrateStream
<br> not (Reading( reading <= 90, this after $r1, this before $r2 ) from entry-point HeartrateStream)
<br> $averg: Number() from accumulate( Reading ( $r:reading) over windiw:time(30s) from entry-point HeartrateStream, average($r) )
<br> then
<br> System.out.print ("alert: Reading high for 30 seconds, average reading"+$averg+"\n");
<br><br><br>Thanks a lot!!!
<br>Lin
<br>
<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&node=4028367&code=bGluLmxpbkBjb21jYXN0Lm5ldHw0MDI4MzY3fC0xODk3NDMyNjQ3">click here</a>.<br>
                <a href="http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&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>