Apama 10.5.3 | Developing Apama Applications | EPL Reference | Queries | Find statement | Between clause
 
Between clause
In a within clause and in a without clause, an optional between clause restricts which part of the pattern the within or without clause applies to.
Specify the between keyword followed by two or more identifiers that are specified in the event pattern. Enclose the identifiers in parentheses.
The identifiers set a period of time that starts when one of the specified events is received and ends when one of the other specified events is received. The range is exclusive. That is, the range applies only after the first event is received and before the last event is received.
A between clause is the only place in which you can specify a coassignment identifier that was assigned in a wait clause. You cannot specify identifiers used in a without clause. Also, the same event cannot match both the coassignment identifier in the without clause and an identifier in a between clause.
The condition that the between clause is part of must occur in the range of identifiers specified in the between clause.
It is illegal to have two within clauses with identical between ranges. This would be redundant, as only the shortest within duration would have any effect. It is, however, legal to have more than one without clause with the same between range. Typically, these would refer to different event types or where conditions.
Example:
find A as a -> B as b -> (C as c and D as d)
within 10.0 between (a b)
within 10.0 between (c d)
See Query condition ranges for an explanation of this example.