0
從下面的流中,我想要警告在溫度超過90°時發生兩次的事件(如每次2個事件的溫度> 90需要被警告)。WSO2 CEP:Siddhi QL:如何在匹配某些條件後始終如一地警告事件
InputStream=[1001,91]
InputStream=[1001,86]
InputStream=[1002,70]
InputStream=[1001,85]
InputStream=[1003,70]
InputStream=[1003,85]
InputStream=[1002,70]
InputStream=[1003,70]
InputStream=[1003,87]
InputStream=[1002,70]
InputStream=[1001,95]
InputStream=[1001,96]
InputStream=[1001,97]
InputStream=[1001,98]
InputStream=[1001,98]
我寫了這樣的事情:
@Plan:name('TestExecutionPlan')
define stream InputStream (id string, temp int);
partition with (id of InputStream)
begin
from InputStream
select id, temp
having temp > 90
insert into CriticalStream
end;
from CriticalStream[count(id) == 2]
select id, temp
group by id
--having count(id) == 2
insert into EventReporter;
但其警告僅1 EventReporter流中的事件。
Below is the screen shot from Try It
我期待的EventReporter流具有[1001,97]和[1001,98]還有,現在它只有在[1001,95]記錄。有人能指出我在這裏做錯了嗎?如何在分組之後循環處理事件?我嘗試添加window.time和window.length,但沒有得到所需的輸出。任何幫助/指導將非常感激。謝謝。
嗨Grainier,該解決方案工作。非常感謝你的時間和幫助。 – Kannan
Grainier,我在這裏有另一個問題:http://stackoverflow.com/questions/43186895/wso2-cep-siddhi-ql-creating-a-unique-stream-with-similar-event-records 真的很感激,如果你可以看看它並給出寶貴的意見。謝謝。 – Kannan