act_threshold 变量

act_threshold 变量是阈值规则的 <computedThreshold> 或 <eventCountThreshold> 元素上阈值属性的值,该值是已定义的阈值。

详细信息

act_threshold 变量仅在阈值规则中有效。

如果使用组密钥定义规则,则 act_eventCount、act_eventList 和 act_threshold 变量在以下表达式上下文中无效:
  • 生命周期操作
  • <activateOnEvent> 中的 <filteringPredicate>,或 <activationInterval> 中的 <deactivateOnEvent>
  • <computedValue>
这是由于在这种情况下,规则变量仅应用于规则实例,而在这些表达式运行时不存在规则实例。

编码示例

以下代码访问 act_lib 变量来获取已定义的阈值:
int threshold = act_lib.getIntVariable(IACTLibrary.THRESHOLD);