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

Unknown macro: {next_previous_link3}
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 6 Next »

 

The Siddhi Language consists of following constructs.

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

<execution-plan> ::= <define-parition> | <define-stream> | <define-table> | <execution-query>

<define-partition> ::= define partition <partition-id> by <partition-type> {, <partition-type>}

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

<define-table> ::= define table <table-id> ( <attribute-name> <type> {, <attribute-name> <type>} ) { from <table-type>.<datasource-name>:<database-name>.<table-name>}

<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