In the UNICOREpro client four workflow constructs have been implemented:
DoN: Repeat an action N times
IfThenElse: Execute one of two actions depending on a condition
DoRepeat: Repeat an action until a condition becomes true
HoldJob: Suspend action until a given time/date has expired
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):
ReturnCodeTest. Return code of previously executed task
FileTest: Existence or properties (read/write/execute) of a file
TimeTest: Check of time and date expiration
One and only one of the following conditions have to be enabled in the IfThenElse, DoRepeat, or HoldJob panels.
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
Return code equality
Not only numeric values but also strings may be used for the return code value. However, this is only possible, if the job incarnation at the server site has been setup accordingly which means that the return code from the application is stored in a temporary test file which is evaluated by UNICOREpro.
Successful execution
Not successful execution
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:
The Ignore Failure flag has to be set for the tested task.
IfThenElse-Task only: 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 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:
Exists
Not exists
Readable
Writable
Executable
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.
The TimeTest checks whether a certain time and date has expired. It is enabled by selecting
execution time after
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.
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.
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".
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.
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).
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.