This documentation is for WSO2 Complex Event Processor 2.0.1. View documentation for the latest release.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

 

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 )]

 

 

  • No labels