[英]WSO2 CEP :Siddhi QL: Can i access multiple attributes in a single execution plan
I am pretty new to WSO2 CEP Siddhi QL, I got a requirement to analyze the events of multiple node with multiple parameters. 我对WSO2 CEP Siddhi QL还是很陌生,我有一个要求来分析具有多个参数的多个节点的事件。 Is this possible with siddi ?
siddi有可能吗? if yes, How can I achieve it .?
如果是,我该如何实现呢?
Execution Plan 执行计划
@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;
As i have to wait to get the data of other nodes.How to handle multiple events..? 由于我不得不等待获取其他节点的数据。如何处理多个事件..?
I don't think this is possible with Siddhi. 我认为Siddhi不可能做到这一点。 Siddhi will process "per event" basis and therefore, such filters which require input from multiple events cannot be evaluated.
Siddhi将处理“每个事件”的基础,因此,无法评估需要多个事件输入的此类过滤器 。
However, If you know the event arrival order (ie node 11 followed by node 12, etc...), and node count then you can use Siddhi patterns to achieve this; 但是,如果您知道事件的到达顺序(即节点11之后是节点12, 依此类推 ),以及节点计数,则可以使用Siddhi模式来实现;
eg: 例如:
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;
It is Possible to Access Multi-Node with Multi-Parameter by splitting the Stream into multiple and you can access it. 通过将流拆分为多个,可以访问具有多参数的多节点,并且可以访问它。 This is done by using patterns from WSO2.
这是通过使用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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.