Page History
...
JS7 offers a number of strategies for error handling that are explained with the following articlesarticles in this section.
- Error handling includes
- JS7 - How to detect job errors
- JS7 - How to handle job errors
- to decide if a job error can be handled automatically and
- an order can continue in the workflow,
- an order should leave the workflow.
- to decide if a job error requires user intervention,
- to decide if a job error can be handled automatically and
The following matrix shows possible combinations for the handling of job errors and warnings:
Use Case | Job | WorkflowOrder | Order History | Notification | User Intervention | Documentation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
No. | Job On Error | Job On Warning | Order StopsStoppedOrder Continues | Continued | Order FinishesFinished | Order Successful | Order Failed | Optional | Resume Order | Suspend Order | Cancel Order | |||||
Use Case 1 | yes | no | yes | no | no | - | - | yes | yes | yes | yes | |||||
Use Case 2 | yes | no | no | yes | no | - | - | yes | no-no | - | no- | |||||
Use Case 3 | yes | no | no | no | yes | no | yes | yes | no-no | - | no- | |||||
Use Case 4 | yes | no | no | no | yes | yes | no | yes | no-no | - | no- | |||||
Use Case 5 | yesno | no | no | yes | noyes | yes | nono | - | no | 6- | no | yes | no- | yes- | no-yes |
Use Cases
...
Anchor | ||||
---|---|---|---|---|
|
Use Cases
...
Case 1: Job error makes
...
order stop
In this scenario an order stops subsequently to a job error. The order is put in the failed state. This is the default behavior if no workflow instructions for error handling are used.
...
- If any of
job1
,job2
orjob3
raises an error then the order stops and is put in the failed state. - User Intervention is required to resume, to suspend or to cancel the order.
Anchor | ||||
---|---|---|---|---|
|
...
order continue
In this scenario a job error is caught and is handled in a way that lets the order continue .in the workflow:
- The History outcome is not determined: as the order continues in the workflow. The History outcome will be determined from later workflow instructions.
- Notifications can optionally be sent.
- No User Interventions is applied.
...
- if any of
job1
orjob2
in the Try block raises an error then the order will enter the Catch block. - In the Catch block
job2a
is executed.- If
job2a
completes successfully then the order will leave the Catch block and will continue withjob3
. - If
job2a
fails then the order will be put in the failed state, will be stopped and will remain in the Catch block to wait for User Intervention - Consider that Try-Catch instructions can be nested, i.e. in a Catch block another Try-Catch instruction can be used for error handling.
- If
Anchor | ||||
---|---|---|---|---|
|
In this scenario a job error is caught and is handled in a way that makes the order leave the workflow:
- The History outcome is specified to be failed.
- Notifications can optionally be sent.
- No User Interventions is applied.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Try
job1
job2
Catch
Fail (leave workflow)
Catch-End
job3 |
Explanation:
- if any of
job1
orjob2
in the Try block raises an error then the order enters the Catch block. - In the Catch block the Fail instruction makes the order leave the workflow. The Fail instruction can be parameterized to either stop an order or to make an order leave the workflow.
- An order that entered the Catch block will never execute
job3
.
Anchor | ||||
---|---|---|---|---|
|
Similar to use case 3 in this scenario a job error is caught and is handled in a way that makes the order leave the workflow:
- The History outcome is specified to be successful.
- Notifications can optionally be sent.
- No User Interventions is applied.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Try
job1
job2
Catch
Finish
Catch-End
job3 |
Explanation:
- if any of
job1
orjob2
in the Try block raises an
...
x
...
- error then the order enters the Catch block.
- In the Catch block the Finish instruction makes the order leave the workflow.
- An order that entered the Catch block will never execute
job3
.
Anchor | ||||
---|---|---|---|---|
|
In this scenario job errors are considered being warnings based on a selection of job return codes. Such warnings do not require specific error handling, instead the order will continue in the workflow.
- The History outcome is not determined: as the order continues in the workflow. The History outcome will be determined from later workflow instructions.
- Notifications can optionally be sent.
- No User Interventions is applied.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
job1 (return codes: 0=success, 1=warning, >1=error)
job2 (return codes: 0=success, 1=warning, >1=error)
job3 (return codes: 0=success, 1=warning, >1=error) |
Explanation:
- If any of
job1
,job2
orjob3
completes with return code 1 this is considered a warning. Any other non-zero return codes are considered errors. - In case of job warnings the order continues with the next instruction in the workflow.
- No User Intervention is applied.
Resources
Display children header |
---|