Developing Apama Applications > Apama 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.
AllExpr
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.
Copyright © Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its Subsidiaries and or/its Affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.