Manage Condition Sets and Conditions

Top  Previous  Next

Condition sets and the included conditions are "global", which means that once a condition set or a condition is defined, it can be selected by one or more jobs and/or tasks.

 

Only one condition set can be selected by a unique job or task but a condition set can have many conditions which form a final result.

 

A condition set or a condition is defined either from the main menu Manage -> Manage conditions dialog or from the Add job/Edit job menu under the Conditions tab.

 

With conditions, the internal flow of tasks included in a job or the job itself, can be controlled. Conditions are different kinds of "checks" which are evaluated before a job or a task is launched. One common condition could be if the previous task returns an error based on the exit code. The outcome of the condition evaluation results in an action. The action could be to exit the job because of the previous "failure".

 

Conditions are also evaluated before Notifications. If a condition check returns false then neither the job/task nor the notification is run. Thus the basic flow now looks like:

 

_img20

Condition set and conditions

The evaluation of a condition set can only result in one action. Several conditions may be specified for one condition set. The condition set includes the following settings:

Description
A set of conditions
Action based on different condition matching options
A waiting time before performing the action or between retries

 

The condition set criteria determine how the results of all included conditions are evaluated.

The following condition set criteria are valid:

On Match All - all conditions returned a "match"
On Match Any - one or more conditions returned a "match"
On Match None - none of the conditions returned a "match"
On Match Error - the condition check failed in some way, i.e. if an "access denied" occurred while checking a file condition

 

One or more conditions may be included in one condition set.

A condition uses the following settings:

Condition type
Condition Active
Condition type parameters (dependent of the selected condition type)

 

Condition types

Each condition type uses specific associated parameters.

The following condition types exist:

VisualCron -
File -
Folder -
Process -

 

Actions

The following actions exist:

Wait - wait a specified time (always available)
Continue -Run task or job if match
Next - Run next task in queue (skip current)
Retry - Wait specified time and re-run current task
Exit - Exit current job
Run job - Run specified job (exits existing job, runs specified job)
Run task - Run specified task in current job, after completion it continues with next in order

 

Run task notes: When Run task is used VisualCron tries to find the specified task within the current job. If found it runs that task and tasks that may follow, in order. When the task does not reside within the current job VisualCron only runs the task alone and no following tasks. If you need changes to this behaviour then please contact support.

 

Wait notes: The wait for each action is a pause between the actual condition check and the action. It can be used in several ways but is most commonly used with the "Retry" action. For example, you want to check if a file exists, but the condition check fails to find the file and thus the result is "Match None". With this result you want to Retry (check again if the file exists) and by the wait parameter you add a pause between each check.

 

The Wait action is not used at the first check when using the "Retry" action. This means that it won't pause before the first check, but on the following retries. For other action types, the "Wait" action is always used independent on if it is the first time or not.

 

How the Actions affect jobs and tasks

The actions has different effects on jobs and tasks. The simple reason for that is that Jobs by themselves have no connection to each other like the tasks, which are internally connected within a job.

Actions affecting a job condition:

Continue - continues running job
Next - exits job
Retry - wait and recheck condition
Exit - exits job
Run job - exits job try to run other job
Run task - exits job, runs single task

 

Actions affecting a task condition:

Continue - continues running task
Next - runs next task (if existing)
Retry - wait and recheck condition
Exit - exits job
Run job - exits job and runs job x
Run task - if job is the same as this current job then it tries to run the task within the job process else it starts a new job and runs the specified task there

 

Default values

When a condition set is added these default values are set and can be configurable:

MatchAll - Continue
MatchAny - Continue
MatchNone - Exit
MatchError - Exit

 

Handling of errors

By default, all errors that occur in the condition check leads to the "Exit" action.

Example of errors the can occur:

The condition points to a job or task that doesn't exist
An error occurs in a condition check
"Access denied" on file or folders

 

Note: Task flow only makes sense when using Run tasks in order. Task conditions are only checked on jobs which has the setting Run tasks in order on.