Add a Run In Parallel Action
Use the Run In Parallel action to run multiple code blocks in parallel or to wait for results in order to produce a combined result.
For API information about this action, see Run in Parallel in the Oracle Visual Builder Page Model Reference.
Use 1: Run Multiple Action Chains in Parallel
To use a Run In Parallel action to just run multiple action chains in parallel:
- Add the action in one of three ways, as explained at the end of Built-In Actions.
- Drop the actions to run for each block in the Add Actions area of the Run in Parallel action. For example, you could make two REST calls and assignments in parallel:
- To add another block of code to run in parallel, you have a few options:
- To add an empty block at the bottom, right-click the Run in Parallel node and click Add Block.
- To add an empty block at a specific position, right-click a block and click Add Block Before or Add Block After.
- To add a block with a specific action, from the Action
palette, drag an action onto the Create Block
drop area (for the last node) or onto the Create Block drop line (if
it's not the last node).
Description of the illustration jsac-run-parallel-add-third-block.png
Description of the illustration jsac_parallel_add_block.png
- To duplicate a block, right-click the block and click Duplicate. This saves time because you can modify a copied block instead of recreating it from scratch.
Use 2: Run Multiple Action Chains in Parallel to Produce a Combined Result
To use a Run In Parallel action to produce a combined outcome from the results of multiple action chains:
- Add the Run In Parallel action in one of three ways, as explained at the end of Built-In Actions.
- For the Store Result In property, provide a name for the array that will hold the result from each block. The first block's result is stored at index 0, the second block's result is stored at index 1, and so on.
- Drop the actions to run for each block in the Add Action area of the Run in Parallel action.
- To add another block of code to run in parallel, you have a few
options:
- To add an empty block at the bottom, right-click the Run in Parallel node and click Add Case.
- To add an empty block at a specific position, right-click a block and click Add Block Before or Add Block After.
- To add a block with a specific action, from the Action
palette, drag an action onto the Create Branch
area (for the last node) or onto the Create
Function drop line (if it's not the last node).
Description of the illustration jsac-run-parallel-add-third-block.png
Description of the illustration jsac_parallel_add_block.png
- To duplicate a block, right-click the block and click Duplicate. This saves time because you can modify a copied block instead of recreating it from scratch.
- Drop a Return action at the end of each block to return its result in the array that was named using the action's Store Result In property:
An array is returned by the Run in Parallel action (
empInfo
for this example, set in step 2): the first element contains the first block's result, the second contains the second block's result, and the third contains the third block's result.