Workflow Constructs

In the UNICORE client four workflow constructs have been implemented:

While DoN depends on an execution counter the workflow of the others is based on one of three conditions (HoldJob only possible with TimeTest condition):

Conditions

One and only one of the following conditions have to be enabled in the IfThenElse, DoRepeat, or HoldJob panels.

ReturnCodeTest




A Return Code Test uses a previously executed task to specify a condition for a workflow task. It is enabled by selecting a comparison from the If-combobox in the panel. The comparison can test for

The checked task is selected in the Task-combobox.

To use the outcome of a task as a condition, one or two additional requirements have to be fulfilled:

FileTest




The status of a file or directory which resides on the remote system in one of the known file systems (Uspace, Home, Root, Temp) can be used as a condition. The FileTest is enabled by choosing one of the available file conditions from the If-combo-box:

The file or directory is specified in the usual way (cf. import/export panels) as a combination of a file system selection from the Location-combo-box and a path.

TimeTest




The TimeTest checks whether a certain time and date has expired. It is enabled by selecting

from the If-combo-box. The requested time and date is specified in the corresponding fields. For the date it is possible to select "Today" which is useful in a loop where a certain task has to be started every day at the same time. The time is entered in local timebut always evaluated on the server in UTC time.

DoN-Task

The DoN task specifies that an action or group of actions is repeated N times, where the number N has to be inserted as a fixed number in the appropriate field of the panel. It is possible to specify sub-jobs in the group of actions and to set dependencies. To add a group of actions, select the DoN icon in the preparation tree and add the actions as usual from the preparation menu.




Iteration counter

The iteration counter is available as an environment variable $UC_ITERATION_COUNTS on the target system and may be used in scripts or filenames in imports/exports, e.g. to re-direct the standard output of one iteration to "output_$UC_ITERATION_COUNTS".

CAUTION: the iteration counter is not propagated to sub-jobs.

DoN-tasks can be nested. The environment variable $UC_ITERATION_COUNTS is composed of the internal counters on each level which are separated by an underscore, e.g. for outer iteration 2 with inner iteration 3 variable $UC_ITERATION_COUNTS will contain the value "2_3".

IfThenElse-Task

The IfThenElse task executes one of two actions (or action groups) depending on a condition. The specification of a condition is explained in the Conditions section.


The Then and Else action groups are added by selecting the corresponding icon in the job preparation tree, and by adding the actions as usual from the preparation menu.

If the IfThenElse-Task uses a ReturnCodeTest a dependency has to exist from the test task to the workflow construct. The dependency might be direct or indirect, i.e. due to a chain of dependencies. The second necessary requirement is that the Ignore Failure flag has to be set for the tested task.

DoRepeat-Task

The DoRepeat task repeats an action or group of actions until a condition (cf. specifications explained in the Conditions section) is fulfilled. If a ReturnCodeTest is specified, the choice of an action for the test is restricted to the actions in the body of the DoRepeat task. An additional requirement is that the Ignore Failure flag has to be set for the tested task.




Nesting of DoRepeat tasks and even nesting of DoN and DoRepeat tasks are possible.

As for the nesting of DoN tasks, the iteration counters are available in the environment variable $UC_ITERATION_COUNTS (cf. previous section Iteration Counter).

HoldJob-Task

The HoldJob task waits until a certain time at a certain date has expired. It may be used to control the start of a dependent action.

A special feature is that the TimeTest has the additional option "forever" in the combo box. This will hold a job until the HoldJob task is resumed explicitly in the Job Monitoring.

But also a HoldJob with a wait "until" specification may be resumed before the time and date has expired. In this case resuming means that the Job Monitoring sends a message to the server to ignore the TimeTest, i.e. the HoldJob task will finish iimmediately and successfully its execution.