Testing conditions
Prior to deploying a Trigger, you can test your Condition Expression (if one is configured) against sample data to see if the condition logic functions as expected. This is particularly useful when you have a complex Condition Expression.
To test the Condition Expression, navigate to the Conditions tab when adding or editing a Trigger, then click Test Expression
. A Test Expression
dialog displays.
At the top of the page the Expression
configured in the Conditions tab is displayed in an editable Test Expression
textbox. Below that are all the Parameters that can be configured in the Condition Expression based on the Trigger Event type
configured in the Parameters
tab of the Trigger
When you click on the textbox of any parameter in the list, a description of the parameter and valid values (if applicable) that you are allowed to enter are displayed. This is depicted in the above image, to the right of DomainName. Only enter test values for the parameters set in the Test Expression. Any parameter values entered that are not specified in the Test Expression are ignored when the test is run. In the above image, you can test the Expression by entering values for MonitorName and DayofWeek.
Click Test
when you are ready to test your parameter values.
If the values you enter result in the Test Expression evaluating to true, a message box displays stating
Condition evaluates to 'true'. Actions will be executed
. This means that the Trigger will execute in the future (when the Trigger event occurs) when the parameters consist of the values you entered.If the values you enter result in the Test Expression evaluating to false, a message box displays stating
Condition evaluates to 'false'. Actions will not be executed
. This means that the Trigger willnot
execute in the future (when the Trigger event occurs) when the parameters consist of the values you entered.
Modifying the Test Expression
The Test Expression can be modified, if desired. You can change or delete an existing parameter, or add a new parameter.
After modifying the Test Expression, you can adjust your test parameter values. Once the changes are made, click Test to evaluate the modified Test Expression. If you inadvertently enter invalid syntax or an invalid parameter in the Test Expression, an error displays under the Test Expression textbox. See an example in the image below.
If you click the Close button before correcting or removing the invalid portion of the Test Expression, the following will occur:
Focus returns to the Conditions dialog.
The "Override Expression" feature is automatically enabled.
The message:
Switching to Override mode. Trigger expression test failed
is displayed.
To save the Trigger, you must first correct or remove the invalid parameter within the Expression. If you try to save the Trigger with an invalid parameter, the system will prevent the action and display the error message: Trigger expression test failed
.
If you click Close after correcting the invalid portion of the Test Expression (or, if the Test Expression was never invalid):
Focus returns to the Conditions dialog.
The Conditions Expression, as displayed in the Expression Builder and the Expression textbox, are automatically updated to match the change you made in the Test Expression dialog.
In the image below, the Test Expression was modified where OR Year = 2025
was added to the original expression. Test values were then entered for MonitorName, Hour, and Year. When Test is clicked, the condition evaluates to true because either the MonitorName is equal to LocalDirMon and Hour is equal to 13 (this is false) - or the Year is equal to 2025. Since the Year equals 2025, the condition evaluates to true, meaning if the parameter values are equal to what is specified below at the time of the Trigger, the Trigger will run.
When Close is clicked, focus returns to the Conditions dialog. The Test Expression update (adding OR Year = 2025
) is automatically applied to the Expression Builder and Expression textbox.