computedThreshold element

The <computedThreshold> element is valid only for the threshold rule. It contains an expression that is called as each event is received and that computes the threshold value based on the current event and on any other events that have matched the event selection criteria for the rule. The expression returns the computed threshold value to be stored in a variable that is defined for the rule. The rule then uses the computed threshold value to compare against the defined threshold value.

Details

Refer to Variables for information about the variables that can be used in expressions. The use of certain variables is dependent on the context of the expression.

Attributes

<computedThreshold> has the following attributes:

Table 1. Attributes of the <computedThreshold> element
Name Description Data type Required?
expressionLanguage Identifies the programming language in which the expression is written. Because the Java™ programming language is the only supported expression language, the only valid value for this attribute is java. xsd:NMTOKEN Yes
threshold Defines the threshold value that is to be met. This defined threshold value must be a string representation of a numeric value that can be converted to a data type that is valid for the rule variable. xsd:string Yes
assignTo Identifies the name of the variable that holds the computed threshold value that is returned from this expression. This variable must already be defined for the rule (at the rule set, rule block, or rule level) using the <variable> element. It must be defined as one of the following numeric data types:
  • java.lang.Double
  • java.lang.Float
  • java.lang.Integer
  • java.lang.Long
  • java.lang.String
If the variable is defined at the rule set or rule block level, it is not reinitialized after the rule pattern is matched.
xsd:NMTOKEN Yes
thresholdComparison Defines the operator for comparing the computed threshold value to the defined threshold value. The valid values for this operator are:
  • lessThan
  • lessThanOrEqualTo
  • greaterThan
  • greaterThanOrEqualTo
xsd:string Yes

Contained within

<computedThreshold> is contained within the following element:

Contains

<computedThreshold> contains no elements.

Related concepts
Expressions