act_eventCount variable

The act_eventCount variable is an integer equal to the number of events that have been accepted by a rule.

Details

For a duplicate rule, the value of the act_eventCount variable is the total number of accepted events, which includes both the original event and any duplicates. For all other rule types, the value is the same as the size of the event list, which can be obtained through the act_eventList variable using the act_eventList.size() method.

The act_eventCount and act_eventList variables are not valid within a timer rule because a timer rule does not process events.

If a rule is defined with a grouping key, the act_eventCount, act_eventList, and act_threshold variables are not valid within the following expression contexts:
  • Life cycle actions
  • <filteringPredicate> within <activateOnEvent> or <deactivateOnEvent> within <activationInterval>
  • <computedValue>
This is because in this case, the rule variables apply only to a rule instance, and rule instances do not exist at the time that these expressions are run.

Coding example

The following code accesses the act_lib variable to obtain the number of events that have been accepted by a rule:
int eventCt = act_lib.getIntVariable(IACTLibrary.EVENTCOUNT);