One problem with handling exceptions is that the name of the rule set is not readily available the way the name of the rule is. As a result it may not be obvious which rule set an exception is originating in. With the introduction of rule set variables it is now possible to create a string rule set variable that contains the name of the rule set. The name of the rule set can then be included in the logging of the exception by referencing the rule set variable.
To create a string rule set variable that contains the name of a rule set:
- Open the rule set in Rule Builder.
- Open the Manage Variables Editor: in Rule Builder, from the Edit menu, select Manage Variables.
- In the Manage Variables Editor, select the Rule Set Variables tab.
- Click the Add Variables button.
- In the Name column, type
- In the Data Type column, select String.
- In the Current Value column, type the actual name of the rule set.
- Click OK.
Anywhere an exception is logged or reported, the
#Rule_Set_Name variable can now be referenced to include the name of the rule set.
For example, to include the rule set name in an email subject line, the Subject parameter of the Send Email action could be:
Rule set: %#Rule_Set_Name% rule: %triggerEvent.RuleName% failed
A limitation of this approach is that you are responsible for keeping the value of the variable accurate because the name of the rule set stored in the variable does not get updated automatically when the rule set is renamed or copied.