act_location variable

The act_location variable is a string that identifies the location, within the rule hierarchy, of an expression.

Details

The location is a fully qualified name that indicates the position of the expression in the rule hierarchy. It has the form identifier.identifier...., where each occurrence of identifier is one of the following:
  • The value of the name attribute for an XML element that is in the respective hierarchy.
  • For elements that occur multiple times in a rule block or rule and have no name attribute: the XML element that contains the expression, followed by an index number in brackets. This index number indicates the position of the expression within its containing element. The counter for assigning index numbers begins with 0 rather than 1. Therefore, if an element is contained within the third <action> element, for example, the index number is shown as action[2].
These identifiers are in descending order from the highest level rule block to the lowest level element that contains the expression.

Coding example

The following code accesses the act_lib variable to obtain the location of the expression:
String location = act_lib.getStringVariable(IACTLibrary.LOCATION);

Examples of the location that is returned from the variable

The following values are examples of the location that is returned from the act_location variable.
ruleBlockA.ruleA.eventSelector[3].filteringPredicate
This expression is contained within the following:
  • The rule block with a name attribute value of ruleBlockA
  • The rule with a name attribute value of ruleA
  • The fourth <eventSelector> element
  • The <filteringPredicate> element
ruleBlockA.ruleA.onDetection.action[5]
This expression is contained within the following:
  • The rule block with a name attribute value of ruleBlockA
  • The rule with a name attribute value of ruleA
  • The <onDetection> element
  • The sixth <action> element
ruleBlockA.ruleA.variableA.varInitializer
This expression is contained within the following:
  • The rule block with a name attribute value of ruleBlockA
  • The rule with a name attribute value of ruleA
  • The variable with a name attribute value of variableA
  • The <varInitializer> element