Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This guide provides instructions to use the Siddhi Query Language 3.0 with WSO2 CEP using examples.

...

Functions parameters can be attributes ( int, long, float, double, string, bool, object), results of other functions, results of mathematical or logical expressions or time parameters. 

...

When projecting the join events the attributes of each stream need to be referred with the stream name  (E.g. <stream name>.<attribute name>) or with its reference Id (specially when events of same streams are joined) (E.g. <stream reference Id>.<attribute name>), "select *" can be used or "select" statement itself can be omitted if all attributes of the joined events need to be projected, but these can only be used when both streams does not have any attributes with same names. 

Ee.g. Switch on temperature regulator , Assume that the temperature regulators are updated every minute. The following switches on the temperature regulators if they are not already on , on all room which have current for all the rooms that have a room temperature greater than 30 degrees.    

Code Block
languagesql
linenumberstrue
define stream TempStream(deviceID long, roomNo int, temp double);

define stream RegulatorStream(deviceID long, roomNo int, isOn bool);

from TempStream[temp > 30.0]#window.time(1 min) as T 
  join RegulatorStream[isOn == false]#window.length(1) as R
  on T.roomNo == R.roomNo
select T.roomNo, R.deviceID, 'start' as action
insert into RegulatorActionStream;

...

  • math : Supporting mathematical operations 
  • str : Supporting String operations 
  • geo : Supporting geocode operations
  • regex : Supporting regular expression operations
  • time : Supporting time expression operations
  • ml : Supporting Machine Learning expression operations
  • timeseries : Supporting Time Series operations

Extensions released under GNU/GPL License v3 : 

  • geo : Supporting geographical processing operations   
  • r :  Supporting R executions
  • nlp : Supporting Natural Language Processing expression operations
  • pmml : Supporting Predictive Model Markup Language expression operations

You can get them from https://github.com/wso2-gpl/siddhi

...