Apama Documentation : Developing Apama Applications : Developing Apama Applications in EPL : Defining Event Listeners : Defining event expressions with one event template : Using positional syntax to listen for events with particular content
Using positional syntax to listen for events with particular content
You can specify that you want to listen for StockTick events that have a particular name and a particular price. In the on statement below, the event listener is looking for StockTick events in which the name is ACME and the price is 50.5 or less.
on all StockTick("ACME", <=50.5):newTick processTick();
When you specify this syntax, called positional syntax, the event template must define a value (or a wildcard) to match against for every field of that event's type. You must specify these values in the same order as the fields in the event type definition. Consider the following event type:
event MobileUser {
   integer userID;
   location position;
   string hairColour;
   string starsign;
   integer gender;
   integer incomeBracket;
   string preferredHairColour;
   string preferredStarsign;
   integer preferredGender;
}
Following is an event listener definition for this event type:
on MobileUser(*,*, "red", "Capricorn", *, *, *, *, 1) some_action();
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback