Apama 10.7.2 | Developing Apama Applications | Developing Apama Applications in Java | Defining Event Expressions | Specifying parameter constraints in event templates
 
Specifying parameter constraints in event templates
The first part of an event template defines the event type of the event the listener is to match against, while the section in brackets describes further filtering criteria that must be satisfied by the contents of events of that type for a match.
Event template parameter operators specify constraints that define what values, or range of values, are acceptable for a successful event match.
Operator
Meaning
[value1 : value2]
Specifies a range of values that can match. The values themselves are included in the range to match against. For example:
stockPrice(*, [0 : 10])
This event template will match a stockPrice event where the price is between 0 and 10 inclusive. This range operator can only be applied to double and long types.
[value1 : value2)
Specifies a range of values that can match. The first value itself is included while the second is excluded from the range to match against. For example:
stockPrice(*, [0 : 10))
This example will match a stockPrice event where the price is between 0 and 9 inclusive (assuming the parameter was of long type).
This range operator can only be applied to double and long types.
(value1 : value2]
Specifies a range of values that can match. The first value itself is excluded from while the second is included in the range to match against. For example:
stockPrice(*, (0 : 10])
This example will match a stockPrice event where the price is between 1 and 10 inclusive (assuming the parameter was of long type).
This operator can only be applied to double and long types.
(value1 : value2)
Specifies a range of values that can match. The values themselves are excluded in the range to match against. For example:
stockPrice(*, (0 : 10))
This example will match if a stockPrice event where the price is between 1 and 9 inclusive (assuming the parameter was of long type).
This operator can only be applied to double and long types.
> value
All values greater than the value supplied will satisfy the condition and match.
This operator can only be applied to double and long types.
< value
All values less than the value supplied will satisfy the condition and match.This operator can only be applied to double and long types.
>= value
All values greater than or equal to the value supplied will satisfy the condition and match.
This operator can only be applied to double and long types.
<= value
All values less than or equal to the value supplied will satisfy the condition and match.
This operator can only be applied to double and long types.
value
Only a value equivalent to the value supplied will satisfy the condition and match.
A String value must be enclosed in double quotes (" "), and therefore these need to be preceded with an escape character inside event expression definitions in an EventExpression constructor ( \")
A Location value must consist of a structure with four doubles representing the coordinates of the corners of the rectangular space being represented.
*
Any value for this parameter will satisfy the condition and match.