Starts With Clause

A pattern describes a sequence of events, beginning with the starts with event, followed by each then event, in the order specified. The starts with clause is where the actual event sequence or pattern is described. For the pattern to succeed, all the events must be received according to the specified order (and any additional time constraints).

Only events listed in the using clause can be used. You specify the event sequence or pattern using the event aliases, to indicate the absence or occurrence of events in the sequence. Use then as the conjunction, for example:

starts with a then b then c

In the simplest case, the order in which the events must occur is signified by the order in which they are specified in the clause. However you can specify the ordering in a variety of ways. You can create sub-clauses and sub-patterns to describe constraints such as the number of event occurrences and the interval between them. To indicate a sub-pattern, wrap the event sequence in parentheses: (sub-pattern).

Bind variables begin with the dollar sign ($). The value is provided at deploy time. See Create the Pattern String.

Items Syntax

Then Syntax

Alias List Syntax

Sub-pattern Syntax

Starts With Sub-clause Examples

starts with a
starts with a then b
starts with a then any one (a, b) then all (a, b)
starts with a then ( (a then b) )
starts with a then within 10 milliseconds | seconds | minutes | hours | days b
starts with a then repeat 10 to 20 times a
starts with a then repeat $intParam2 to $intParam3 times b
starts with a then after $longParam minutes
starts with a then all ( (a then b), b )

Then Sub-clause Examples

then any one (a, b)
then all (a, b)
then within 10 milliseconds
then repeat 10 to 20 times a
then repeat $intParam2 to $intParam3 times b
then after $longParam minutes
then all ( (a then b), b )

As shown in the example, a nested sub-pattern is surrounded by parentheses.