Page History
...
Success and Failure Command Script Sourcing
The RED can reference other scripts form the metadata at run-time, this Script Sourcing feature of RED is also available to be used in the Success and Failure Commands, this allows referencing a Host Script from the RED metadata rather than a script that already exists on the operating system.
Example success command using this feature:
| Code Block | ||||
|---|---|---|---|---|
| ||||
python "WSL_SCRIPT_my_python_success_script_CODE" |
...
- Parse the command for RED Tokens
- Write referenced metadata Host Scripts found in any Script Sourcing Tokens to the work directory
- Expand the RED Tokens in the command line, Script Sourcing Tokens are replaced with the full file path of the script
- Set up the environment variables
- Execute the expanded command
Success and Failure Command Output Protocol
Only the exit code of the Success or Failure command is considered by the Scheduler, all output is ignored.
- An exit code of '0' signals a successful execution of the command, this is reported in the Scheduler Job Log in RED
- A non-zero exit code signals a failure executing the command , this is also reported in the Scheduler Job Log in RED
- All output streams are ignored, therefore your script or command should perform it's own logging.
| Info | ||
|---|---|---|
| ||
| A failure in the Success command execution will not in turn mark the job as a failure as all it's tasks have already completed successfully at this point. |