You are reading the documentation for an outdated Corteza release. 2024.9 is the latest stable Corteza release.

Parallelism

This section provides some examples on how you should perform tasks in parallel.

Unconditional parallelism

Unconditional parallelism should be used when two or more branches of execution should be done in parallel regardless of the state.

To achieve this, use the fork gateway gatewayParallel where each outbound branch defines one branch of parallel execution.

If any of the branches defines the termination step termination, the entire workflow will be terminated.

The screenshot outlines a basic example of unconditional parallel execution.
Figure 1. The screenshot outlines a basic example of unconditional parallel execution.

You can find the source code for the workflow here.

Unconditional parallel segment

A parallel segment is where the workflow transitions from sequential execution into parallel execution and back into sequential execution.

Unconditional parallelism should be used when two or more branches of execution should be done in parallel regardless of the state.

To achieve this, use the fork gateway gatewayParallel where each outbound branch defines one branch of parallel execution. Terminate the parallel segment by using the join gateway gatewayParallel.

If any of the branches defines the termination step termination, the entire workflow will be terminated.

The screenshot outlines a basic example of unconditional parallel execution.
Figure 2. The screenshot outlines a basic example of unconditional parallel execution.

You can find the source code for the workflow here.

Conditional parallelism

conditional parallelism should be used when two or more branches of execution should be done in parallel regardless of the state.

To achieve this, use the fork gateway gatewayParallel where each outbound branch defines one branch of parallel execution.

If any of the branches defines the termination step termination, the entire workflow will be terminated.

The screenshot outlines a basic example of conditional parallel execution.
Figure 3. The screenshot outlines a basic example of conditional parallel execution.

You can find the source code for the workflow here.

Conditional parallel segment

A parallel segment is where the workflow transitions from sequential execution into parallel execution and back into sequential execution.

conditional parallelism should be used when two or more branches of execution should be done in parallel regardless of the state.

To achieve this, use the fork gateway gatewayParallel where each outbound branch defines one branch of parallel execution. Terminate the parallel segment by using the join gateway gatewayParallel.

If any of the branches defines the termination step termination, the entire workflow will be terminated.

The screenshot outlines a basic example of conditional parallel execution.
Figure 4. The screenshot outlines a basic example of conditional parallel execution.

You can find the source code for the workflow here.