Functions for context

Context functions are used for complex event evaluation by a filter condition or an event rule condition.

Operators

Table 1. Operators for event context
Operator Format Returns a Boolean value of true if . . .
event follows this event follows variable1 There is at least one previous occurrence of the event or action specified in variable1
event follows after this event follows variable1 after variable2 There is at least one occurrence of the event or action specified in variable1 after the date and time specified in variable2
event follows before this event follows variable1 before variable2 There is at least one occurrence of the event or action specified in variable1 before the date and time specified in variable2
event follows within this event follows variable1 within variable2 There is at least one occurrence of the event or action specified in variable1 within the duration specified in variable2
event is present this event is present The event has previously occurred
event is present after this event is present after variable1 The event occurred after the date and time specified in variable1
event is present before this event is present before variable1 The event occurred before the date and time specified in variable1
event is present within this event is present within variable1 The event occurred within the time period (duration) specified in variable1

Functions

Table 2. Functions for event context
Function name How function is expressed Returns Variable1 can be Variable2 can be
event or action occurs all occurrences of variable1 The number of times the referenced event or action in variable1 has occurred in the context.

The number includes the current instance.

event or action
event or action occurs after all occurrences of variable1 after variable2 The number of times the referenced event or action in variable1 has occurred in the context after the date and time specified in variable2.

The number includes the current instance.

event or action date
event or action occurs before all occurrences of variable1 before variable2 The number of times the referenced event or action in variable1 has occurred in the context before the date and time specified in variable2.

The number includes the current instance.

event or action date
last occurrence of an event last occurrence of variable1 The date and time for the last occurrence of the event or action in variable1. event or action  
event or action occurs within duration past occurrences of variable1 within variable2 The number of times the referenced event or action in variable1 has occurred in the context in the duration specified in variable2.

The number excludes the current instance.

event or action duration
event occurs after all occurrences of this event after variable1 The number of times the referenced event in the event rule has occurred in the context after the date and time specified in variable1.

The number includes the current instance.

date  
event occurs before all occurrences of this event before variable1 The number of times the referenced event in the event rule has occurred in the context before the date and time specified in variable1.

The number includes the current instance.

date  
event occurs in duration past occurrences of this event within variable1 The number of times the event referenced in the event rule has already occurred in the context in the duration specified in variable1

The number excludes the current instance.

duration  
Note: When a time-delayed event rule is evaluated, or a time-delayed action is fired, the event or the action is no longer the current instance, and is included in the count when evaluating "past occurrences" functions.

How occurrences are counted

Each time an event enters the context, it is counted. For example, the first time it enters the context, the occurrences count is 1 and the second time it enters, the occurrences count is 2. Conditions must be created accordingly, as shown in the following examples:

Table 3. How occurrences are counted.
This condition Value
all occurrences of this event is more than 0 true as soon as the first instance of this event enters the context, and continues to be true.
all occurrences of this event is 1 true when the first instance of the event enters the context, but is not true again.
all occurrences of this event is more than 1 true when the second instance of the event enters the context, and continues to be true.
all occurrences of this event is 0 Never true.