Search code examples
wso2complex-event-processingsiddhiwso2-cep

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. Is this possible with 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..?


Solution

  • 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.

    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