...
JS7 offers a number of strategies for error handling that are explained with the following articles:
No.Use Case | Workflow | History | Notification | User Intervention | Documentation |
---|
No. | Job Error | Job Warning | Order Stops | Order Continues | Order Finishes | Order Successful | Order Failed |
| Resume Order | Suspend Order | Cancel Order |
|
---|
1 | yes | no | yes | no | no |
yesno- | yes | yes | yes | yes |
|
2 | yes | no | no | yes | no |
yesno- | yes | no | no | no |
|
3 | yes | no | no | no | yes | no | yes | yes | no | no | no |
|
4 | yes | no | no | no | yes | yes | no | yes | no | no | no |
|
5 | yes | no | no | no | yes | no | yes | yes | no | no | no |
|
6 | no | yes | no | yes | no | yes | no | yes | no | no | no |
|
Use Cases
Use Case 1: Job error makes an 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.
- The History outcome is not determined: as the order remains in the workflow. The History outcome will be determined from later User Intervention.
- Notifications can optionally be sent.
- User Interventions include:
- Resume Order: The order will be continued at the same, at a previous or at a later Workflow Instruction
- Suspend Order: The order will be suspended and will be resumed or cancelled later on.
- Cancel Order: The order will be cancelled and the History outcome will indicate the failed order execution.
Code Block |
---|
title | Example for default error handling |
---|
linenumbers | true |
---|
collapse | true |
---|
|
job1
job2
job3 |
Explanation:
- If any of
job1
, job2
or job3
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.
Use Case 2: Job error lets an order continue
In this scenario a job error is caught and is handled in a way that lets the order continue.
- 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 |
---|
title | Example for catching a job error |
---|
linenumbers | true |
---|
collapse | true |
---|
|
Try
job1
job2
Catch
Catch-End
job3 |
Explanation:
- if any of
job1
or job2
in the Try block raises an error then the empty Catch block lets the order continue. - Leaving the Catch block the order will continue with
job3
.
Code Block |
---|
title | Example for catching a job error by use of a recovery job |
---|
linenumbers | true |
---|
collapse | true |
---|
|
Try
job1
job2
Catch
job2a
Catch-End
job3 |
Explanation:
- if any of
job1
or job2
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 with job3
. - 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.
Use Case 3: Job error makes an order finish
x
xx
Resources