act_event 變數

act_event 變數可讓您存取適用於目前事件的方法。

詳細資訊

因為計時器規則不處理事件,所以計時器規則中的 act_event 變數僅適用於啟用或停用規則的事件。

只有當事件啟用或停用規則時,act_event 變數才適用於 <onActivation> 及 <onDeactivation> 動作。否則,此變數為空值。

編碼範例

下列程式碼將存取 act_event 變數,以取得事件的 hostname 屬性:
String host = act_event.getStringAttribute("hostname");

可存取的方法

act_event 變數可讓您存取的方法是在 IEvent 介面中定義,如表 1所示。
表 1. 含有相對應的方法及 Javadoc 方法說明位置的 IEvent 介面
介面 方法 Javadoc 方法說明的位置
IEvent
  • get
  • getAttribute
  • getBooleanAttribute
  • getByteAttribute
  • getShortAttribute
  • getIntAttribute
  • getLongAttribute
  • getFloatAttribute
  • getDoubleAttribute
  • getStringAttribute
  • set
  • getTimeStamp
  • setTimeStamp
  • getType
  • getOriginal
com.ibm.correlation.IEvent