Skip to main content

Global - Conditions​

A Condition Set is a group of checks, called conditions, that the Server runs at the start of a Job run, before its first Task, or just before a Task starts. The combined result of the checks selects an action: run the Job or Task, skip it, check again after a wait, stop, or start another Job or Task. Use a Condition Set when a Job or Task should run only if something is true at that moment, for example when a file exists, a process is running or a Variable has a certain value.

Condition Sets are global objects. You create a set once and can use it in any number of Jobs and Tasks. Each Job and each Task uses one Condition Set or none.

This page describes the Manage Conditions window, where you create and maintain Condition Sets, and explains when the Server evaluates a set. These pages describe the parts of a set and how to use it:

note

Condition Sets are separate from the Job Condition and Task Condition of a Flow entry on the Flow tab of a Job or Task. Those decide whether that Flow entry's action runs. See Job - Flow and Task - Flow.

Set up a Condition Set​

  1. Go to Server -> Global objects -> Conditions, and click Add on the Condition set toolbar.
  2. On the Main settings tab, enter a Description that says what the set checks. See Conditions - Main Settings.
  3. On the Conditions tab, add one condition for each check. See Conditions - Conditions.
  4. On the Actions tab, choose the action for each result. With one active condition, the result is always On Match All, On Match None or On Match Error. On Match Any needs at least two active conditions. See Conditions - Actions.
  5. Click OK.
  6. Open the Job or Task, and on its Conditions tab check Use for the set. Make sure that no other Use box is checked, and save the Job or Task.
  7. To see how the set behaves, check Extended debug logging on the set's Main settings tab, and run the Job with Run Job -> With Conditions -> From first Task. This is a real run: if the set lets the Job continue, its Tasks run. A Variable condition writes its result to the log only when the Server-wide Extended debug logging is checked, see Condition - Variable.

Manage Conditions window​

Server -> Global objects -> Conditions

The Global objects group of the Server ribbon with Conditions highlighted, and the Manage Conditions window it opens. In the window, Add is highlighted on the Condition set toolbar, and a Condition Set named Example 1 is expanded to show one condition

The list shows each Condition Set as a row with its Description. Expand a set to see its conditions. Each condition is shown with the icon of its condition type and its Description.

The toolbar is in two parts:

  • Condition set toolbar: Add, Edit, Clone and Delete for Condition Sets, a filter box and Clear filter
  • Conditions toolbar: Add, Edit, Clone and Delete for the conditions of the selected set, Audit log, a filter box and Clear filter

Type in a filter box to show only the sets, or only the conditions, whose Description contains that text. Clear filter empties the filter box next to it.

Add, Edit and Clone on the Condition set toolbar open the Add/Update condition set window. Add on the Conditions toolbar adds a condition to the selected Condition Set, and Edit, Clone and Delete there work on the selected condition. A condition that you add, edit or delete in this window is saved on the Server as soon as you click OK in the Add/Edit condition window, or confirm the deletion.

Audit log opens the audit log for Condition Sets. See Objects - Audit Log.

Right-click a row to open the shortcut menu. It has the toolbar commands (Add Condition set, Edit Condition set, Clone Condition set, Delete Condition set, Add Condition, Edit Condition, Clone Condition, Delete Condition and Audit log), and also:

warning

When you delete a Condition Set with Delete or Delete Condition set and the set is in use, the confirmation says how many objects use it. Deleting the set does not remove it from those Jobs and Tasks. Open Object relations before you delete a set, and choose another set for those Jobs and Tasks first. For what happens to a Job or Task whose set is gone, see Errors and missing Condition Sets.

Add/Update condition set window​

The Add/Update condition set window has three tabs:

Click OK to save the Condition Set.

Choose the Condition Set for a Job or Task​

The Conditions tab of the Job window and of the Task window shows the same list and toolbars as the Manage Conditions window, with an extra Use column. Check Use for the Condition Set that the Job or Task should use. Checking a box clears the box that was checked before. Clicking a checked box clears it, and the Job or Task then has no Condition Set. The Use choice is saved when you save the Job or Task.

When a Condition Set is added while the window is open, its Use box is checked, and the box that was checked before stays checked. This happens for a set that you add or clone on this tab, and for a set that someone adds from another Client. The Job or Task then saves both sets, and the Server uses only one of them, which need not be the new one. Before you save the Job or Task, make sure that only one Use box is checked.

Changes to a Condition Set or its conditions that you make on this tab are saved on the Server at once. Cancel in the Job or Task window does not undo them, and they apply to every Job and Task that uses the set. To change a set for one Job or Task only, clone it, change the copy, check Use for the copy and clear the box of the original.

When the Server evaluates a Condition Set​

  • Job: at the start of each Job run, before its first Task and before its On start Flow entries. Whether the action is applied depends on how the Job was started, see Job - Conditions
  • Task: each time the Task is about to start in a Job run, whether or not the Job has Run Tasks in order checked, and again each time a Flow entry retries the Task. The Task's set is not checked when you run the Task on its own with Run Task, or when the "Run Task" action of another Task's Condition Set starts it. See Task - Conditions

The Server checks the active conditions in the set and combines their results into one of four results, On Match All, On Match Any, On Match None or On Match Error (see Conditions - Conditions). It then applies the action set for that result on the Actions tab (see Conditions - Actions).

warning

When a Condition Set ends a Job before any Task has run, the run is recorded as successful. The Job's On success and On complete Flow entries and the VisualCron Event Triggers that watch this Job's completion can still start other Jobs. See When a Condition Set ends the Job.