Page History
...
- The ForkList Instruction is the dynamic version of the JS7 - Fork / Join Instruction.
- Technically it implements the Fork / Join operation, however, it offers to create the number of branches dynamically from order variables:
- The ForkList Instruction expects an order to provide a ForkList Variable Set that is implemented as a list (array) of values. The list can include primitive values such as strings and it can include any number of keyname/value pairs for variables.
- The ForkList Instruction is designed as a single branch when configuring the workflow with the Configuration View of the JOC Cockpit user interface. Depending on the number of entries provided with a ForkList Variable Set carried by an order the Agent will dynamically create branches for each entry of the Forklist Variable Set.
- The underlying use case suggests that users want to execute the same workflow in parallel for different variable setseach element of a Variable Set.
Workflow Instruction: ForkList
The workflow editor offers to add a ForkList Instruction like this:
Explanation:
- The ForkList Instruction is assigned a Variable Set
countries
that is of typeList
.- Assignment is available when displaying workflow properties and when selecting the ForkList Instruction in the editor panel.
- The Variable Set makes use of one or more variables, the example uses the
countryCode
variable with typeString
. - Any number of variables can be added to a Variable Set.
- When an order is added to this workflow then it has to provide the
countries
Variable Set populated with country codes. - For each element of the Variable Set, i.e. for each country code, JS7 dynamically creates a branch with the ForkList Instruction.
- Child orders are created for each branch that runs in parallel.
- The handling of child orders is the same as for the Fork Instruction.
- A workflow can include any number of ForkList Instructions.
- ForkList Instructions cannot be nested, however, each branch can include e.g. Fork Instructions, Resource Lock Instructions etc.
- More than one ForkList Instruction can use the same Variable Set.
Adding Orders to a Workflow with ForkList Instructions
When adding an order to a workflow that includes a ForkList Instruction then the popup window offers to add any number of elements to the countries
Variable Set.
x
Explanation:
- From this example a single order enters the workflow and is split into three child orders for each country when meeting the ForkList Instruction.
- Jobs in forked branches are running in parallel, i.e. jobs for the three countries specified are parallelized.
Adding Schedules to a Workflow with ForkList Instructions
When creating a schedule for a workflow that includes a ForkList Instruction then users can specify the countries
Variable Set like this.
Explanation:
- This example adds three elements to the
countries
Variable Set and specifies the country codes. - Jobs in forked branches of the workflow are executed in parallel for each country specified.
- It is an option to add a second Variable Set that would result in a second order being created by the schedule.
Overview
Content Tools