Page History
Table of Contents |
---|
Introduction
There can be situations when a given workflow should be processed by a single order only. Any additional orders should wait for the first order to complete and to leave the workflow. This mechanism is called order serialization.
...
- Job parallelism applies to the number of instances of a job that are executed by parallel orders.
- For example, if a workflow includes a number of jobs for which parallelism is limited to 1 task then the following applies:
- With 3 orders entering the workflow the first order will execute
job1
. The remaining orders wait in front ofjob1
. - With
job1
being processed thenorder1
moves on and starts to processjob2
. - At the same time
order2
will start to processjob1
. - With
job1
being processed thenorder2
to moves to processjob2
andorder3
starts to processjob1
.
- With 3 orders entering the workflow the first order will execute
- This means that job parallelism allows any number of orders to be active in a workflow. It limits the number of orders that execute a job in parallel.
- For example, if a workflow includes a number of jobs for which parallelism is limited to 1 task then the following applies:
- Order serialization is intended to make any additional orders wait for a previous order to complete the workflow before they will enter the workflow.
Use of Lock Instruction
Exclusive Use of Lock
The Lock Instruction in this example is used to prevent any additional orders from entering a workflow.
...
- one order is running in the workflow.
- any additional orders wait in front of the workflow.
Shared Use of Lock
The Lock Instructions in this example implement mixed use of limiting and preventing the number of additional orders in different sections of a workflow:
...
- three orders acquire the outer Resource Lock and enter the outer section of the workflow in parallel.
- one order acquires the inner Resource Lock and is running in the workflow's inner section.
- one order is running in the outer section of the workflow.
- one order is waiting in the outer section of the workflow as job parallelism is limited to
1
. - it is guaranteed that only one order at a time will enter the inner section of the workflow.
Error Handling
Starting from the above example, if an error occurs in a job or other instruction the following default behavior applies:
- The order is moved to the outmost Lock Instruction and is set to the failed state.
- The Resource Lock therefore is freed and parallel orders can enter the workflow.
- Users who wish orders to remain with a failing job or other instruction and to continue blocking Resource Locks can apply the JS7 - Options Instruction.
Use of Options Instruction and Lock Instruction
Considering error handling the previous examples allow additional orders to enter a workflow if a previous order fails and is moved to the outmost Lock Instruction in a workflow.
...
Find more examples and details from the JS7 - Options Instruction article.
Display feature availability | ||
---|---|---|
|
Exclusive Use of Lock
The example applies to use of a single lock in shared mode.
...
- one order is remaining in the workflow in a failed state with
job2
. - any additional orders wait in front of the Lock Instruction.
Shared Use of Lock
The example implements mixed use of limiting and preventing the number of additional orders in different sections of a workflow:
...
- the Options Instruction spawns any instructions in the workflow.
- the outer Lock Instruction spawns subsequent jobs and other instructions in the workflow.
- the
pdSerialLockMulti
Resource Lock is used in shared mode to allow a number of parallel orders.
- the
- the inner Lock Instruction spawns a section of the workflow that should be used by single order only.
- the
pdSerialLockSingle
Resource Lock is used in exclusive mode to prevent access by parallel orders.
- the
- the
job2
job is assumed to fail with return code3
.
In the Workflows view at run-time the workflow looks like this:
- one order is remaining in the workflow in a failed state with
job2
. - any additional orders wait in front of the inner Lock Instruction.
Further Resources
...