Execute
The Execute task (execute
) allows user to run any program as separate process.
By default, the execute
task raises an error only if it detects an error when starting the requested process.
To raise errors and warnings depending onthe process exit code, the optional attributes error
and warning
can be used. When one of those attributes is defined, the task raises an error or warning depending on the exit code as follows:
- if error threshold is defined and the exit code is greather than the errors threshold, an error is raised and the task completed
- if warning threshold is defined and the exit code is greather than the warning threshold, a warning is raised and the task completed
The following attributes configure the task:
Attribute | Type | Purpose | Default |
---|---|---|---|
error | integer | error exit code threshold | |
warning | integer | warning exit code threshold |
The following elements configure the task:
Element | Purpose |
---|---|
program | Program to be executed. If not in PATH, fullname must be provided |
args | Arguments to provide to the program |
Example
<job multithread="false">
<execute>
<program>ianus.exe</program>
<args>SQLvsSQL_TableCompare.xml</args>
</execute>
<execute>
<program>git</program>
<args>status</args>
</execute>
<execute name="ERROR" error="0">
<program>%IANUS_HOME%\bin\Debug\%IANUS_DOTNET_VERSION%\ianus.exe</program>
<args>MyJob.xml</args>
</execute>
</job>
Status codes
Status | Status code | Description |
---|---|---|
Ready | -1 | Task is initialized, but not yet started |
Running | -2 | Task is running |
Success | 0 | Task completed successfully |
Warnings | 1 | Task completed with warnings |
Errors | 2 | Task completed with errors |
Aborted | 9 | Task cannot be executed |