我是WSO2 CEP Siddhi QL的新手,我要求用多个参数分析多个节点的事件。 siddi有可能吗?如果是的话,我怎样才能实现它。?
执行计划
@Plan:name('ExecutionPlan')
@Import('InputStream:1.0.0')
define stream InputStream (node string, param1 int, param2 double, param3 string, param4 string, param5 string, param6 string, param7 string,......,param120 string);
@Export('outputStream:1.0.0')
define stream OutputStream (val1 string, param3 string);
from InputStream [(node == 11 AND Param2 < 110)
AND
(node == 12 AND Param3 > 40)
AND
(node == x AND Paramx > some value)] #window.time(1 sec)
select node as val1, param2 as param2, param3 as param3
insert into OutputStream;
因为我必须等待获取其他节点的数据。如何处理多个事件..?
答案 0 :(得分:0)
我不认为Siddhi可以做到这一点。 Siddhi将“按事件”处理,因此无法评估需要来自多个事件的输入的过滤器。
但是,如果您知道事件到达顺序(即节点11后跟节点12等等)和节点计数,那么您可以使用Siddhi patterns来实现此目的;
例如:
from every( e1=InputStream[node == 11 AND Param2 < 110] ) -> e2=InputStream[node == 12 AND Param3 > 40] -> eX=InputStream[node == X AND ParamY > ZZ]
select e1.node as val1, e1.param2 as param2, e2.param3 as param3
insert into OutputStream;
答案 1 :(得分:0)
通过将Stream拆分为多个,可以访问具有多参数的多节点,您可以访问它。这是通过使用来自WSO2的模式来完成的。
from every (e1=InputStream) -> (e2=InputStream)-> e3=InputStream[(e1.node == '11' AND e1.param1 > 500 AND e1.param2 > 1000 ) AND (e2.node =='12' AND e2.param3 > 200 AND e2.param1 < 100)] within x mins