act_event variable

The act_event variable provides access to methods that apply to the current event.

Details

Because a timer rule does not process events, the act_event variable within a timer rule applies only to the events that activate or deactivate the rule.

The act_event variable applies within the <onActivation> and <onDeactivation> actions only if an event activated or deactivated the rule. Otherwise, this variable is null.

Coding example

The following code accesses the act_event variable to obtain the hostname attribute of an event:
String host = act_event.getStringAttribute("hostname");

Methods that can be accessed

The methods to which the act_event variable provides access are defined in the IEvent interface, as shown in Table 1.
Table 1. IEvent interface with corresponding methods and location of Javadoc method descriptions
Interface Methods Location of Javadoc method descriptions
IEvent
  • get
  • getAttribute
  • getBooleanAttribute
  • getByteAttribute
  • getShortAttribute
  • getIntAttribute
  • getLongAttribute
  • getFloatAttribute
  • getDoubleAttribute
  • getStringAttribute
  • set
  • getTimeStamp
  • setTimeStamp
  • getType
  • getOriginal
com.ibm.correlation.IEvent