Added Parallel Gateway Example and Reset Process (#1811)

* Added Parallel Gateway Example and Reset Process

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Kevin Burnett <18027+burnettk@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Usama Ahmad 2024-06-26 01:37:34 +05:00 committed by GitHub
parent b7128b0929
commit 2b801ae19c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 74 additions and 0 deletions

View File

@ -116,6 +116,12 @@ Since a Parallel Gateway does not dictate the flow based on conditions, it avoid
**Join:** **Join:**
Note that the behavior for a parallel join, also known as a Parallel Gateway merge, is to synchronize and consolidate multiple parallel paths into a single flow. When the process flow reaches the parallel join, it evaluates the completion of all incoming sequence flows from the corresponding parallel split. It ensures that all parallel paths have completed their execution before the process continues along the single outgoing sequence flow after the join. Note that the behavior for a parallel join, also known as a Parallel Gateway merge, is to synchronize and consolidate multiple parallel paths into a single flow. When the process flow reaches the parallel join, it evaluates the completion of all incoming sequence flows from the corresponding parallel split. It ensures that all parallel paths have completed their execution before the process continues along the single outgoing sequence flow after the join.
Check out this detailed parallel gateway example:
```{toctree}
:maxdepth: 1
parallelgatewayexample.md
```
## Event-Based Gateway ## Event-Based Gateway
![event_based_gateway](images/event_based_gateway.png) ![event_based_gateway](images/event_based_gateway.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,27 @@
# Parallel Gateways Example
## Overview
This example illustrates the use of parallel gateways in BPMN models to manage and synchronize concurrent tasks effectively.
Parallel gateways are powerful BPMN elements that split a process flow into multiple independent flows, allowing for simultaneous execution of tasks, and later merging these flows to ensure coordination before moving forward.
### Process Steps
![Parallel Gateway Example](images/parallel_gateway_ex1.png)
1. **Parallel Gateway (Split)**: After the start event, the gateway divides the main flow into two separate paths, enabling tasks to be processed in parallel.
2. **Sequence Flow 1: Script Task [y = 1]**: Assigns the value `1` to variable y. This script task initializes variable y and demonstrates setting a simple variable in one branch of the parallel flow.
3. **Sequence Flow 2: Script Task [z = 2]**: Similar to the first script task, this operation assigns the value `2` to variable `z`. Functions concurrently with the first script task, demonstrating the capability of the BPMN model to handle multiple operations at the same time.
4. **Parallel Gateway (Merge)**: This merging gateway reunites the divergent paths after independent task completion, ensuring all parallel processes are complete before moving forward. It acts as a critical checkpoint in the process to synchronize and consolidate data from multiple sources, ensuring that no task moves forward until all parallel tasks have concluded.
5. **Script Task [x = y + z]**: Computes the sum of `y` and `z` and assigns it to variable `x`.
- **Script**: `x = y + z`
- This script task demonstrates the aggregation or combination of results from parallel tasks, highlighting how data from independent branches can be combined.
After the script task, Signals the successful completion of the process with End Event.
**Output**:
After running the task, it will compute and show the result:
![Parallel Gateway Example](images/parallel_gateway_ex2.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -92,3 +92,44 @@ There are various reasons for terminating a process instance such as the instanc
| Confirm that the status has changed from suspended to 'terminated' | Confirm that the status has changed from suspended to 'terminated'
![suspend](images/terminated.png) | ![suspend](images/terminated.png) |
## Reset a Process
> **Step 1: Find the active Process Instance**
> **Step 2: Navigate to the active User Task**
👤 Note that you need Admin rights to complete the following steps.
> **Step 3: Suspend the Process**
Ensure the status has changed from *user_input_required* to *suspended*
![Reset](images/reset_process2.png)
> **Step 4: Go to the relevant past activity**
Only a previously completed section highlighted in grey can be chosen.
> **Step 5: Select 'View process instance at the time when this task was active.**
![Reset](images/reset_process3.png)
> **Step 6: Observe the task once highlighted in grey should now be yellow.**
A previously completed section is now active and shown in yellow.
> **Step 7: Select 'Reset Process Here icon in the popup window.**
![Reset](images/reset_process5.png)
> **Step 8: "Resume" process instance.**
The process instance should be resumed by selecting the Resume icon next to the Process Instance Id
![Reset](images/reset_process6.png)
> **Step 9: Refresh page**
Wait for Resume action to complete, this may take some time. Refresh the page to ensure it has transitioned to the next activity, replacing the current one.
<aside>
✅ From this point onward, the remaining part of the process can smoothly proceed.
</aside>