Conditions

A condition determines whether a Task, Module or Run Book Job should be executed, skipped or failed. A condition determines to which settings a Task, Module or Run Book Job in a Job must comply before it is executed. A condition contains one or more expressions that determine whether the condition can be satisfied and defines what action should be taken based on this. Conditions are optional.

  • Task conditions determine whether a Task in a Module should be executed, skipped or failed. Task conditions can be set when configuring Tasks and Modules.
  • Module conditions determine whether a Module in a Project should be executed, skipped or failed. Module conditions can be set when configuring Projects.
  • Job conditions determine whether a Job in a Run Book should be executed, skipped or failed. Job conditions can be set when configuring Run Books. When configuring Job conditions, only the expression types Date Time, Parameter and Status of Previously Executed Job are available.

Example

For example, a Module could contain the following:

  • Task Export Exchange Mailbox
  • Task Disable Exchange Mailbox
  • Task Send E-mail

If the Task Disable Exchange Mailbox fails, the administrator should receive a warning by e-mail. To achieve this, you can set the following condition on the Conditions tab of the Task Send E-mail:

  • Expression: Status of previously executed Task = Failed.
  • If this condition is FALSE then: skip this Task
  • If this condition is TRUE then: execute this Task

Configuration

Expressions

  • Condition expressions can be based on the following operands:
    • Computer Function
    • Date Time
    • Environment Variable
      • File Version
      • Product Version
      • File Exists
      • Folder Exists
    • Fully Qualified Domain Name
    • Operating System
      • Bit Version
      • Suite
      • Type
      • Version
    • Processor Architecture
    • Status of previously executed Task/Job

When configuring a condition, you can use several operators. See Pattern Matching: wildcards and operators for an overview.

Conditions based on existence of file or folder

When basing the value of a condition expression on the existence or version of a file or folder:

  • You cannot use functions in the Operand field.
  • You can use parameters and global Variables in the Operand field.
  • It is possible to use environment variables in the Operand field: right-click and select Replace folder names with their associated environment string.

Validation

When you select the validation rule (all expressions or at least one), you can validate the individual expressions and show the condition results (True C_icon_true, False C_icon_false, Unknown C_icon_unknown)

  • Validation is done on the current machine at configuration.
  • Validation is done on the target Agent at run-time.

If condition is True/False then

You can configure the action that needs to be performed when the condition results in True or False:

  • Execute this Job
  • Skip this Job
  • Skip this Job and all remaining Jobs in this Run Book
  • Execute this Job, but skip all remaining Jobs in this Run Book
  • Allow to set a parameter value based on the results of the condition. For example, if you configure a Change Service Parameters Task to restart a certain service on a number of Agents, this service can have a different name, depending on the operating system of the Agent. By letting the condition result set the correct parameter value (for example, the Windows Firewall services SharedAccess or mpssvc), the Task will restart the correct service on each Agent.

After configuring the expressions, you need to define whether all expressions in the condition need to be satisfied, or at least one. You also need to define which action should be carried out if the expression has or has not been met:

  • Fail this Task (only available if you configure a Task): The Task will show a Failed status in the Job history.
  • Skip this Task/Module/Job: Skips the Task, Module, or Job and continues with the next.
  • Skip this Task/Module/Job and all remaining Tasks/Modules/Jobs in this Module/Project/Run Book: Skips this Task, Module or Job, and all remaining Tasks, Modules, or Jobs in the Module, Project, or Run Book.
  • Execute this Task/Module/Job: Executes the Task, Module, or Job.
  • Execute this Task/Module/Job, but skip all remaining Tasks/Modules/Jobs: Executes the Task, Module, or Job and skips all remaining Tasks, Modules, or Jobs.
  • Set parameter: Sets a specific parameter when the condition is met. For example, if you configure a Change Service Parameters Task to restart a certain service on a number of Agents, this service can have a different name, depending on the operating system of the Agent. By letting the condition result specify the correct parameter value (for example, the Windows Firewall services SharedAccess or mpssvc), the Task will restart the correct service on each Agent.

To check the validity of the condition on your computer click Validate.

Execution

When Projects or Run Books are executed, all conditions will be evaluated, including Task and Module conditions. The Task details of a Job show information about (satisfied) conditions as they existed during execution of the Job.

  • In Run Books, it is not possible to use parameter values from a CSV file in conditions based on parameters whose values are based on other parameters. See Using parameter values from a CSV file.
  • The use of global Variables in Run Book parameters, Run Book conditions and Run Book evaluators is not supported.
  • The use of Parameters that get its value from a function (eg: a registry value data or IP address) in Run Book conditions is not supported. These conditions should be placed on the module or project level that is referenced in the Run Book job, or linked Parameters should be used to pass values from the module/project level to Run Book level.