Task File Elements

There are only two XML elements required in the Task files used by RunJob – the Task and Step elements, with the Task Step being used as a container for the required Step elements.


The Task element is mainly used to provide the container for the steps that make up the run profile, and it is expected that there will only be a single task per run profile.
The Task element has upto two attributes provided to it, the name of the task (mandatory) and the host or IP address of the SQL server hosting the Synchronization Service database (optional).
If a SQL server is specified, RunJob will attempt to connect to the database and enumerate the Run Profiles in order to enable it to verify that all run profiles are actionable prior to starting the run, and an error will occur if one or more run profiles does not exist. If the SQL server is not specified, RunJob will assume that all run profiles are correct and does not attempt to validate them prior to execution, although other tests will still be carried out (e.g. to ensure that any labels used as actions are defined).

Example 1 – Base Task Element

<Task name="Run full cycle">

Example 2 – Task Element with local SQL database

<Task name="Run full cycle" connectTo="Localhost " >	

Example 3 – Task Element with remote SQL database

<Task name="Run full cycle" connectTo="sqlfarm.mysampleco.net" >


Each Step element contains a number of attributes, which are used by RunJob to select the desired behaviour of the Step – the following step types are all valid tasks.

Task Usage
run Starts a named Run Profile
command Executes an arbitrary command
verify Verifies the condition of the nominated Management Agent
set Sets a status flag
unset Clears a status flag
jumpto Jumps to a nominated position in the task
test Tests whether a nominated flag has been set
echo Prints some text to the console
log/warn/alert Prints some text to the event log as a notification / warning / error
noop No Operation – can be used as a placeholder in the task file
end Ends the RunJob gracefully
abort Aborts the RunJob

In addition to the task element which selects the overal behaviour of the step, additional attributes can be added to the step to either provide necessary parameters, label the step (making it available as a jump point) or provide a follow on action based on the results of the step.

Parameter Usage
Task The Task parameter selects which kind of Step operation will be performed
Label The Label Parameter allows another Step to redirect the flow of the Task to this step via its name.
MAName MAName provides the name of the management agent that the task applies to
Profile Profile gives the name of the Run Profile for the task
Command Name (including Path if needed) of an executable to be launched by RunJob.
Params Any Parameters needed for a command being executed by RunJob
Action Defines an Action to be carried out the step on success or failure (see individual tasks for details).
Flag Names a flag for use within a step – for example, by setting, clearing or testing the Flag as part of an Action.
Text Any text to be written to the console – normally from an Echo task.
Verify Items There are a number of elements that can be included in a verify task, please see the detailed description of the Verify Task for details.

Where an Action is defined, this may then require additional parameters to be included:

Action Additional Parameters Usage
Abort N/A Aborts the execution of the current task
Continue N/A Continues the execution of the Task (this is implied if no Action is specified for a run profile)
Set Flag Sets the specified Flag to be true
Unset Flag Sets the specified Flag to be false
Echo Text Writes the specified Text to the console
log/warn/alert Text Sends the specified text to the event log as a notification, warning or error
Label N/A Where a Label Name is provided as the action, this action moves the curent step to be the one bearing the named label.

Last edited Oct 24, 2011 at 4:27 PM by jasonbanks, version 5


No comments yet.