Lane owner and error event updates (#1574)

* Lane owner and error event updates

* updates

* issues fix

* fix image ref

* Update docs/Building_Diagrams/pools_and_lanes.md

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

* Update docs/Building_Diagrams/pools_and_lanes.md

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

* Lane owners fix

* remove sartograpy emails in favor of example

---------

Co-authored-by: burnettk <burnettk@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-05-23 23:48:52 +05:00 committed by GitHub
parent b92cebc9ff
commit b5ad4dc6ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 59 additions and 6 deletions

View File

@ -95,14 +95,13 @@ The process kicks off with an action that requires fetching specific employee de
![Error Event](images/error_event_example3.png) ![Error Event](images/error_event_example3.png)
Prior to the service task's execution, one potential error ID (`error_0`) is defined to handle `error_0`, identified as an "Invalid Schema" error. Prior to the service task's execution, one potential error ID is defined as `Error_1`.
4. **Error Boundary Event**: 4. **Error Boundary Event**:
![Error Event](images/error_event_example5.png) ![Error Event](images/error_event_example5.png)
Attached to the service task, this event catches `error_0` ("Invalid Schema"), setting an alternative path for error handling. Attached to the service task, this event catches `Error_1`, setting an alternative path for error handling. The error details are stored in a variable named `err1`.
The error details are stored in a variable named `err0`.
5. **Manual Tasks for Error Handling and Success Path**: 5. **Manual Tasks for Error Handling and Success Path**:

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -63,7 +63,7 @@ Specifically, the process manages a list of composers, their names, and genres,
] ]
``` ```
3. **Multi-Instance Task - Edit Composer**: This task is configured as a parallel multi-instance task that iterates over the `composers` array created by the previous script task. It allows for the editing of each composer's information within the array. 3. **Multi-Instance Task - Edit Composer**: This task is configured as a multi-instance task that iterates over the `composers` array created by the previous script task. It allows for the editing of each composer's information within the array.
![Multi_instance_example](images/multiinstance_ex.png) ![Multi_instance_example](images/multiinstance_ex.png)

View File

@ -70,7 +70,7 @@ Remember that each pool requires Lane configuration, even if it contains just a
| --- | --- | --- | | --- | --- | --- |
| ![participant_sales](images/participant_lane_1.png) | **Name:** Manager | A concise and descriptive label that accurately represents the owner and role of the Lane. | | ![participant_sales](images/participant_lane_1.png) | **Name:** Manager | A concise and descriptive label that accurately represents the owner and role of the Lane. |
| ![data_object_pools](images/data_object_pools_1.png) | **ID:** lane_manager | A distinct ID to differentiate each Lane, especially when there are multiple. | | ![data_object_pools](images/data_object_pools_1.png) | **ID:** lane_manager | A distinct ID to differentiate each Lane, especially when there are multiple. |
---
### Example: Using Lanes and Pools for Petty Cash Request Process ### Example: Using Lanes and Pools for Petty Cash Request Process
This example demonstrates the application of Lanes and pools in a BPMN diagram, specifically designed to handle a petty cash request process within an organization. This example demonstrates the application of Lanes and pools in a BPMN diagram, specifically designed to handle a petty cash request process within an organization.
@ -109,3 +109,57 @@ This message informs the requester of the approval status, including the approve
This BPMN diagram effectively uses Lanes and pools to structure a petty cash request process, ensuring that responsibilities are clearly assigned and the workflow is logically organized. This BPMN diagram effectively uses Lanes and pools to structure a petty cash request process, ensuring that responsibilities are clearly assigned and the workflow is logically organized.
---
### Assigning Lane Owners
Assigning lane owners correctly in BPMN workflows is important for ensuring that tasks are routed to the appropriate personnel or departments within an organization.
Lets discuss the methods for assigning lane owners:
#### Methods to Assign Lane Owners:
1. **Using Script Tasks**:
- Script tasks enable dynamic assignment of lane owners within the workflow. You can specify the lane owners directly in the workflow logic, ensuring that tasks are routed correctly based on current operational needs or specific conditions.
- **Example**:
```python
# Script task to assign lane owners
lane_owners = {
"Reviewer": ["user1@example.com", "user2@example.com"]
}
```
- This script explicitly sets who the lane owners are for the 'Reviewer' lane. The names provided in the dictionary map directly to the users responsible for this lane.
2. **Assigning User Groups**:
- In cases where script tasks are not used for direct assignments, lane owners can be specified by utilizing predefined user groups within DB.
- **How to Configure User Groups**:
- User groups can be assigned in the system configuration, often in a YAML file, which defines which users belong to specific groups. More information [in admins and permissions section](https://spiff-arena.readthedocs.io/en/latest/DevOps_installation_integration/admin_and_permissions.html#setting-up-admin-in-config-yaml)
- **Example YAML Configuration**:
```yaml
groups:
admin:
users:
- user1@spiffworkflow.org
- user2@spiffworkflow.org
reviewers:
users:
- user3@spiffworkflow.org
- user4@spiffworkflow.org
```
- This configuration shows how different user roles, such as admins and reviewers, are populated with specific users.
#### Practical Application in a BPMN Model:
In a typical BPMN workflow, lane assignments are crucial for managing who performs various tasks within the process. For example, a process might involve several departments or roles, each represented by a lane in the workflow model.
- **Process Start**
- The process begins and an initial script task sets the lane owners. Below BPMN model effectively demonstrates a comprehensive workflow leading to a dynamic assignment of reviewers in the "Script Task: Get Reviewers"
![Lane Owners](images/lane_owners.png)
- **Task Execution**:
- As tasks are executed, the workflow engine checks the `lane_owners` dictionary to determine which users are responsible for tasks in specific lanes.
- If a lane owner is not set using a script task and no explicit assignment is provided, the engine queries the group name to determine potential task owners from DB.
```{admonition} Note
⚠ Specifying a user group in the `lane_owners` dictionary in script task does not require it to previously exist in the database.
```