Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Job errors and warnings are detected by JS7 from a the job's return code:

  • For Shell Jobs the return code corresponds to the job's exit code.
  • For JVM Jobs the return code is available from the order outcome with the returnCode return variable.

In addition, for Shell Jobs, output that possibly is available from the stderr channel can be used to decide about errors and warnings.

Anchor
detect_job_errors
detect_job_errors
Detect Job Errors

Detect Errors from Job Return Codes

Download workflow example: (upload .json): pdwExitCodeError.workflow.json

Assume a workflow configuration with a job script that terminates with a non-zero exit code configured like thisas follows:

  • Return Code on Success: Return code 0 is specified to signal successful execution of the job. Any other return code signals failed execution. More than one return code can be specified, separated by commacommas.
  • Return Code on Failure: Alternatively one or more return codes can be specified that signal failed execution. Any other return code signals successful execution.
  • If a number of return codes are used to indicate success or failure then
    • they can be specified from a list of comma separated values, for example 1,2,4,8.
    • they can be specified from a range of return codes using two dots between return codes, for example, 1,2..4,8.
  • Negative return codes can be indicated
    • by specifying negative numbers, for example 1,2,4,-1,-2,-4.
    • by specifying a range of negative numbers, for example 1,-1,-2..-4.
  • Some operating systems use 32-bit unsigned integers as exit codes. Therefore positive numbers in the range between 0x80000000 to 0xffffffff are considered negative return codes, for example the values -1 and 4294967295 are considered the same.
  • Jira
    serverSOS JIRA
    columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
    columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
    serverId6dc67751-9d67-34cd-985b-194a8cdc9602
    keyJS-2035

    Jira
    serverSOS JIRA
    columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
    columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
    serverId6dc67751-9d67-34cd-985b-194a8cdc9602
    keyJOC-1463



When an order is added to the workflow, the job will fail and log output will be created like this:

...

Download workflow example: (upload .json): pdwStdError.workflow.json

Assume a workflow configuration with a job script that which creates output in the stderr channel like this:


The "Job Options" tab offers to select allows the Fail on output to stderr checkbox to be selected like this:


When an order is added to the workflow, the job will fail and log output will be created like this:

Anchor
detect_job_warnings
detect_job_warnings
Detect Job Warnings

Detect Warnings from Job Return Codes

...

Assume a workflow configuration with a job script that which terminates with a non-zero exit code and is configured like this:

  • Return Code on Success: Return code 0 is specified to signal successful execution of the job. Any other return code signals failed execution. More than one return code can be specified separated by comma.
  • Return Code on Warning: Return code 1 is specified to signal a warning. A number of return codes can be specified separated by commacommas. Such return codes are considered successful, however, a JS7 - Notification can will be created for jobs that terminate with a return code signaling warnings.
  • Consider explanations on return codes available from chapter Detect Errors from Job Return Codes.


When an order is added to the workflow, the job will terminate successfully and log output will be created like this:

...

Detect Warnings from Output to the stderr Channel

Download workflow example: (upload .json): pdwWarnStderr.workflow.json

Assume a workflow configuration with a job script which creates output in the stderr channel like this:

Image Added


The "Job Options" tab allows the Warn on output to stderr checkbox to be selected like this:

Image Added


When an order is added to the workflow, the job will run successfully and a notification, for example by e-mail, will be created. StatuscolourYellowtitleTODO

Feature Status:

Display feature availability
StartingFromRelease2.4.1

Jira
serverSOS JIRA
columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId6dc67751-9d67-34cd-985b-194a8cdc9602
keyJOC-1363

Resources