Run Conditions
Run Conditions
A Run condition can be added to an activity´s configuration to dynamically make it run or not during execution of a workflow. The run condition consists of a PowerShell statement that returns ‘true’ or ‘false’. The activity will only be executed when the run condition evaluates as ‘true’.
Configuration Levels
A run condition can be configured on three levels. Depending on level, configuration is made at the Activity admin, the Workflow admin, or the Service admin view. Service level configuration will always override both workflow and activity level configuration, and workflow level configuration will always override activity level configuration.
Run Conditions and Disabled Activities
An activity can be disabled in a specific workflow or service, which is indicated by the disable button in front of the activity name in the Workflow and Service admin views. When an activity is disabled, any defined run condition will not be used. When a run condition is defined and in use, a red dot will be added to the enable
button.
Request Monitor
A run condition will be evaluated during execution of each activity. Logs including the evaluation result will be available in the Request monitor view. Open the details of the activity and click the Logs tab.
When a run condition is configured for an activity, a Run condition tab will appear when viewing the activity in the Request monitor view. Click the tab to view the run condition. Setting the option Bypass run conditions = Yes will result in that that the activity will run regardless of the run condition.
Run Conditions Tab
Configuration of run conditions is set on the Run configuration tab. Guidance on how to find the tab at each level is shown below.
Activity Admin
- Click View to open the activity details.
- Click the Run condition tab.
Workflow Admin
- Click View to open the workflow details.
- On the Activities tab, click View to open the details of an activity.
- Click the Run condition tab.
Service Admin
- Click View to open the service details.
- On the Workflows tab, click View to open the workflow details.
- On the Activities tab, click View to open the details of the activity.
- Click the Run condition tab.
The image below shows the Run condition tab via the Service admin view.
A run condition can contain any PowerShell statement that evaluates as either ‘true’ or ‘false’.
Link to Workflow Parameter
A value from a parameter in the workflow can be linked into the run condition. In the edit component, start typing the parameter name in the text box and select an alternative in the list that appears.
Group Conditions
Clauses can be grouped by clicking the Group conditions checkbox between two clauses. Grouped clauses will be evaluated together before being compared to other clauses/groups. Grouping are only needed in combination with the Or operator.
Test Condition
To test a configured run condition, click Test condition to open the Test run condition dialog box. If the run condition contains tokens, values for those can be added manually before running the test. Values are not loaded dynamically since the test is performed in an isolated scope.
To run the test, click . Test result is either true, false, or a PowerShell exception.
Reset
Click Reset to delete the run condition for the current configuration level. Configuration will then be inherited from a higher configuration level