Apama 10.7.2 | Developing Apama Applications | EPL Reference | Events and Event Listeners | Event expressions | The all operator
 
The all operator
When the all operator appears before an event template, when that event template finds a match, it continues to watch for subsequent events that also match the template.
Consider the following event expression:
all A -> B
This event listener would match on every A and the first B that follows it. The way this works is that upon encountering an A, the correlator creates a second event listener to seek the next A. Both event listeners would be active concurrently; one looking for a B to successfully match the sequence specified, the other initially looking for an A. If more As are encountered the procedure is repeated; this behavior continues until either the monitor or the event listener are explicitly killed.
Consider the following sequence of incoming events:
C1 A1 F1 A2 C2 B1 D1 E1 B2 A3 G1 B3
With these input events, on all A() -> B() would return the following:
{A1, B1}, {A2, B1} and {A3, B3}.
Note that all is a unary operator and has higher precedence than ->, or and and.