How Does VisualCron Work?
This page explains how the VisualCron objects work together when a Job runs. Read it before you build your first Job.
VisualCron works much like the Unix/Linux cron utility, but it can also react to events. It can run a program, or any of its built-in Tasks, at set times, at intervals down to the second, once, or when something happens on the system.
The objects in a Job
Triggers start the Job. A Job can have several Triggers. Time Triggers, Interval Time Triggers and Custom Time Triggers start a Job at a time or interval. Event Triggers start it when something happens, for example when a file is created.
Condition Sets are checks. A Job can have a Condition Set that is evaluated when the Job starts, and each Task can have one that is evaluated just before the Task runs. The result decides whether the Job or Task continues. See Job - Conditions and Task - Conditions.
Tasks do the work. A Job holds one or more Tasks of different types. By default, they run one after another, in the order of the Job's Task list. If Run Tasks in order is unchecked in the Job's settings, VisualCron starts the Tasks without waiting for each one to finish. The Tasks' On success, On error and On complete Flow then runs only Notifications. Other Flow actions, such as a retry, are not carried out. Flow can also change the order. See Job - Tasks and Job - Main Settings.
Flow decides what happens next when a Job or Task starts, succeeds, fails or completes, or runs longer than a set time. A Flow action can continue to the next Task, stop the Job, retry, go to another Task, run another Job, or run a Notification such as an email. See Task - Flow, Job - Flow and Global - Notifications.
What happens when a Job runs
When a Job runs, VisualCron completes these steps:
- A Trigger fires, or you run the Job manually.
- The Job's Condition Set, if any, is evaluated.
- The Job's On start Flow runs.
- Each Task runs. Before it starts, its Condition Set, if any, is evaluated, and then its On start Flow runs.
- When a Task ends, its On success, On error or On complete Flow decides what happens next.
- When the Job ends, its On success, On error or On complete Flow runs.
A Job or Task Flow can also act while the Job or Task is still running, with On running longer than.
When you run a Job manually, the Job's own Condition Set is checked, but its action is applied only if you right-click the Job and select Run Job -> With Conditions, or one of its items From first Task and From this Task. The same applies to Run selected Jobs -> With Conditions. The Condition Sets of its Tasks are always applied. When you run a single Task manually, the Task's own Condition Set is not checked, but the Job's Condition Set is. See Job - Conditions.
Where Tasks run
Each Task run has its own status and output, which you can see in the Client. Most Tasks run inside the VisualCron service. Some Task types start a separate Windows process. Tasks set to run in the foreground run through the Tray Client in a logged-on user's session. For each Task run, VisualCron saves statistics such as how long the Task took.
Running a Job once
If Run once (can be reactivated later) is checked in the Job's settings, the Job is deactivated as soon as it starts. It stays in the Job list, and you can activate it again later. See Job - Main Settings.