This documentation is for WSO2 CEP 2.1.0. View the home page of the latest release.

Language Model

 

The Siddhi Language consists of following constructs.

  1. Event Definitions
  2. Queries
    1. Filters
    2. Windows
    3. Joins
    4. Patterns
    5. Sequences
  3. Calls to external functions (not supported in 1.0)
Following provides an abstract BNF based definition for Siddhi language.

<query> ::= <define-stream> | <execution-query>

<define-stream> ::= define stream <stream-name> <attribute-name> <type> {<attribute-name> <type>}

<execution-query>::= <input> <output> [<projection>]

<input> ::= from <streams>

<output> ::= ((insert [<output-type>] into <stream-name>) | (return [<output-type>]))

<streams> ::= <stream>[#<window>] 

   |   <stream>#<window> [unidirectional] <join> [unidirectional] <stream>#<window> on <condition> within <time>

   |   [every] <stream> -> <stream> ... <stream> within <time>

   |  <stream>, <stream>, <stream> within <time>

<stream> ::= <stream-name> <condition-list>

<projection> ::= (<external-call> <attributelist>) | <attributelist> [group by <attribute-name> ][having <condition>]

<external-call> ::= call <name> ( <param-list> )

<condition-list> ::= {‘[’<condition>’]’}

<attributelist>::=(<attribute-name> [as <reference-name>]) | ( <function>(<param-list>) as <reference-name>)

<output-type> ::= expired-events | current-events | all-events

<param-list> ::= {<expression>}

<condition> ::= ( <condition> (and|or) <condition> ) | (not <condition>) | ( <expression> (==|!=|>=|<=|>|<|contains|instanceof) <expression> )

<expression> ::= ( <expression> (+ | - | / | * | %) <expression> ) | <attribute-name> | <int> | <long> | <double> | <float> | <string> | <time>

<time> ::= [<int>( years | year )]  [<int>( months | month )] [<int>( weeks | week )] [<int>( days | day )] [<int>( hours | hour )] [<int>( minutes | min | minute )] [<int>( seconds | second | sec )]

  [<int>( milliseconds | millisecond )]

 

 

Copyright © WSO2 Inc. 2005-2014