ventilate prose

This commit is contained in:
burnettk 2024-06-25 17:59:34 -04:00
parent e1f944de51
commit d72080c9d5
No known key found for this signature in database
16 changed files with 80 additions and 44 deletions

View File

@ -203,7 +203,8 @@ By incorporating these validations into SpiffWorkflow forms, you can create inte
#### Scenario Overview
Workflow processes often require the enforcement of minimum and maximum date constraints to align with operational timelines or project deadlines. This scenario demonstrates the configuration of both `minimumDate` and `maximumDate` validations within a form, ensuring that selected dates fall within a specific period defined by other date fields in the workflow.
Workflow processes often require the enforcement of minimum and maximum date constraints to align with operational timelines or project deadlines.
This scenario demonstrates the configuration of both `minimumDate` and `maximumDate` validations within a form, ensuring that selected dates fall within a specific period defined by other date fields in the workflow.
#### JSON Schema Configuration:
@ -423,7 +424,8 @@ This will automatically validate that the max value cannot be less than the min
### Adding a New Button for Repeating Sections in Forms
Nested forms or repeating sections are designed to collect an array of objects, where each object represents a set of related information. For instance, in a task management form, you might need to collect multiple tasks, each with its title and completion status.
Nested forms or repeating sections are designed to collect an array of objects, where each object represents a set of related information.
For instance, in a task management form, you might need to collect multiple tasks, each with its title and completion status.
This structure can be represented in the form's schema as follows:

View File

@ -121,4 +121,4 @@ Please see the [implementing files themselves](https://github.com/sartography/sp
| refresh_permissions | Adds permissions using a dictionary. |
| set_user_properties | Sets given user properties on the current user. |
| times_executed_by_user | Returns the number of times the user has started an instance of the current process model. |
| user_has_started_instance | Returns a boolean indicating if the user has started an instance of the current process model. |
| user_has_started_instance | Returns a boolean indicating if the user has started an instance of the current process model. |

View File

@ -12,9 +12,11 @@ If you have a use case where you need to store data and access it from multiple
All of these mechanisms work well in SpiffWorkflow, so the choice will depend on your storage and performance requirements.
## Types of Data Store
### KKV Data Store in BPMN
Key-Key-Value (KKV) Data Stores extend the traditional key-value model by introducing an additional key layer. This structure enables more complex and hierarchical data storage solutions, making them particularly suited for BPMN (Business Process Model and Notation) processes that manage multifaceted data relationships.
Key-Key-Value (KKV) Data Stores extend the traditional key-value model by introducing an additional key layer.
This structure enables more complex and hierarchical data storage solutions, making them particularly suited for BPMN (Business Process Model and Notation) processes that manage multifaceted data relationships.
- **Structure**: A KKV data store organizes data into two levels of keys before reaching the actual value, e.g., `Genre -> Movie -> Attributes`. This structure is particularly beneficial for categorizing and accessing nested data efficiently.
@ -22,7 +24,7 @@ Key-Key-Value (KKV) Data Stores extend the traditional key-value model by introd
#### BPMN Integration
Integrating KKV data stores within BPMN diagrams involves modeling tasks that interact with the data store for CRUD (Create, Read, Update, Delete) operations.
Integrating KKV data stores within BPMN diagrams involves modeling tasks that interact with the data store for CRUD (Create, Read, Update, Delete) operations.
Here's how to depict such interactions using a BPMN example focused on movie data management:
@ -65,7 +67,8 @@ After running the process, You can view the new movies data in data store:
### JSON Data Store
In BPMN (Business Process Model and Notation), incorporating a JSON file as a data store offers a versatile method for managing structured data throughout a process. A JSON data store is structured file or set of files that uses the JSON format to store data.
In BPMN (Business Process Model and Notation), incorporating a JSON file as a data store offers a versatile method for managing structured data throughout a process.
A JSON data store is structured file or set of files that uses the JSON format to store data.
#### JSON Data Store: Gatorade Flavors
@ -149,4 +152,4 @@ This JSON array contains various Gatorade flavors, each with attributes for `nam
![JSON data_store](images/DataStore_JSON_Output.png)
By integrating a JSON data store within a BPMN process, workflows can dynamically manage and interact with structured data.
By integrating a JSON data store within a BPMN process, workflows can dynamically manage and interact with structured data.

View File

@ -101,7 +101,8 @@ Prior to the service task's execution, one potential error ID is defined as `Err
![Error Event](images/error_event_example5.png)
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`.
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`.
5. **Manual Tasks for Error Handling and Success Path**:

View File

@ -1,9 +1,12 @@
# Exclusive Gateways Example
## Overview
Exclusive Gateways in BPMN serve as decision points that dictate the flow of a process based on conditional logic. This example demonstrates the use of an Exclusive Gateway to manage conditional routing following user input from a form.
Exclusive Gateways in BPMN serve as decision points that dictate the flow of a process based on conditional logic.
This example demonstrates the use of an Exclusive Gateway to manage conditional routing following user input from a form.
## Process Steps
![User Task](images/exclusivegatewayexample.png)
1. **User Task: Show User Form**
@ -58,6 +61,6 @@ Exclusive Gateways in BPMN serve as decision points that dictate the flow of a p
After manual task, marks the completion of the process through end event.
Therefore, Exclusive Gateways are critical in BPMN for managing decisions within the workflow that require conditional logic based on user input or other process variables.
Therefore, Exclusive Gateways are critical in BPMN for managing decisions within the workflow that require conditional logic based on user input or other process variables.
They ensure that the process flow is correctly directed based on specific conditions, preventing incorrect executions and ensuring that the process adapts dynamically to varying inputs.
They ensure that the process flow is correctly directed based on specific conditions, preventing incorrect executions and ensuring that the process adapts dynamically to varying inputs.

View File

@ -105,9 +105,11 @@ If a data object is to be used within a multi-instance subprocess, ensure that i
### Loops
Standard loops in Business Process Model and Notation (BPMN) are a fundamental mechanism to model repetitive tasks within a workflow. These loops allow for the execution of a specific task or sequence of tasks repeatedly until a predefined condition is met, mirroring traditional loop constructs found in programming languages.
Standard loops in Business Process Model and Notation (BPMN) are a fundamental mechanism to model repetitive tasks within a workflow.
These loops allow for the execution of a specific task or sequence of tasks repeatedly until a predefined condition is met, mirroring traditional loop constructs found in programming languages.
### Key Concepts
![Loop Configuration](images/Loop_Settings.png)
1. **Loop Marker**: A visual indicator (a small loop symbol) placed at the bottom center of an activity to denote that the activity is subject to repeated execution.
@ -117,7 +119,8 @@ Standard loops in Business Process Model and Notation (BPMN) are a fundamental m
### Implementing a Standard Loop
To model a standard loop in BPMN, determine the activity or sequence of activities that need to be executed repeatedly. The next steps are:
To model a standard loop in BPMN, determine the activity or sequence of activities that need to be executed repeatedly.
The next steps are:
1. **Configure the Loop Characteristics**:
- Add the loop marker to the activity symbol.
@ -129,7 +132,8 @@ To model a standard loop in BPMN, determine the activity or sequence of activiti
### Example: Incrementing a Counter
Consider a process designed to increment a counter variable until it reaches a specific value. This scenario is effectively managed using a standard loop in BPMN.
Consider a process designed to increment a counter variable until it reaches a specific value.
This scenario is effectively managed using a standard loop in BPMN.
#### Process Overview

View File

@ -2,11 +2,12 @@
## Overview
This example illustrates the use of parallel gateways in BPMN models to manage and synchronize concurrent tasks effectively.
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.

View File

@ -72,12 +72,14 @@ Remember that each pool requires Lane configuration, even if it contains just a
| ![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
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.
The process is structured around different tasks allocated to lane and pools, emphasizing role-based access and task execution.
#### BPMN Diagram
![Lanes and Pools Example](images/lanes_pools_example_1.png)
**Process Flow:**
@ -104,7 +106,8 @@ After approval, the workflow returns to the Requester Lane for final confirmatio
Your petty cash request for {{amount}} has been approved by {{approved_by}}
```
This message informs the requester of the approval status, including the approved amount and the name of the approver. After manual task, marks the end of the process.
This message informs the requester of the approval status, including the approved amount and the name of the approver.
After manual task, marks the end of the process.
![Lanes and Pools Example](images/lanes_pools_example_4.png)
@ -113,7 +116,8 @@ This BPMN diagram effectively uses Lanes and pools to structure a petty cash req
## Managing Approval Processes for Designated Group Users
One common requirement in workflow management is creating an approval process where any user can initiate a request, but only a designated group can grant approval. A specific challenge arises when the initiator is also a member of the approval group and should not approve their own request.
One common requirement in workflow management is creating an approval process where any user can initiate a request, but only a designated group can grant approval.
A specific challenge arises when the initiator is also a member of the approval group and should not approve their own request.
Let's consider a typical approval process where:
@ -151,11 +155,12 @@ This solution automatically adjusts the approvers list to exclude the initiator,
---
## 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.
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**:
@ -187,7 +192,9 @@ Lets discuss the methods for assigning lane owners:
- 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.
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"

View File

@ -40,6 +40,7 @@ Editing Process Models locally is another perfectly good option, depending on yo
* Each webhook call from the git remote will result in a git pull in the backend.
## Editing Process Models locally
Rather than editing your process models on a shared server, you can choose to make all process model changes locally.
There are other guides for running SpiffWorkflow on your local computer, so follow the one that you prefer (docker compose or native).
Then, when your process model repo is configured as you desire, you can run it in a read only mode on your shared environments like dev, staging, and prod.

View File

@ -500,4 +500,4 @@ For example:
- **MAYBE Status**: Indicates that the task still exists within SpiffWorkflow. While these tasks could be omitted for clarity, retaining them provides a complete picture of the workflow's execution.
Viewing task instance history in SpiffWorkflow is now more streamlined and informative, thanks to recent updates.
Users can effectively track each task's execution, status, and timing, gaining insights into the workflow's overall performance.
Users can effectively track each task's execution, status, and timing, gaining insights into the workflow's overall performance.

View File

@ -379,7 +379,8 @@ can I resolve this?
**Answer:**
Yes, SpiffWorkflow is well-suited for integrating with external systems, including CRM platforms. SpiffWorkflow can interact with these systems through various mechanisms to enhance your workflow capabilities.
Yes, SpiffWorkflow is well-suited for integrating with external systems, including CRM platforms.
SpiffWorkflow can interact with these systems through various mechanisms to enhance your workflow capabilities.
**Key Integration Features:**
@ -394,7 +395,8 @@ Yes, SpiffWorkflow is well-suited for integrating with external systems, includi
**Example and Resources**:
For practical implementation, refer to examples and guides available on SpiffWorkflows documentation site, such as the [external services integration example](https://spiffdemo.org/process-groups/examples:2-in-depth:2-2-external-services). This resource provides detailed steps on how to set up and utilize Service Tasks for calling external APIs.
For practical implementation, refer to examples and guides available on SpiffWorkflows documentation site, such as the [external services integration example](https://spiffdemo.org/process-groups/examples:2-in-depth:2-2-external-services).
This resource provides detailed steps on how to set up and utilize Service Tasks for calling external APIs.
By adjusting the return value of your script task's `execute` method and understanding the underlying mechanics of task state management in SpiffWorkflow, you can effectively control the flow of your workflow processes.
### **40: Event Design in SpiffWorkflow**
@ -469,4 +471,4 @@ To retrieve data from a REST endpoint using a service task (`serviceTaskOperator
**Q:** Why do I receive different behaviors when running the same service task in SpiffWorkflow library vs. SpiffArena?
**A:**
In SpiffWorkflow library, service tasks do not have built-in functionality and are essentially placeholders that require external implementations to function. In contrast, SpiffArena requires connectors to be set up for service tasks to function, which might lead to errors if the connectors or their configurations are incorrect. Errors such as "invalid syntax" typically occur when expressions (like URLs) are not properly formatted.
In SpiffWorkflow library, service tasks do not have built-in functionality and are essentially placeholders that require external implementations to function. In contrast, SpiffArena requires connectors to be set up for service tasks to function, which might lead to errors if the connectors or their configurations are incorrect. Errors such as "invalid syntax" typically occur when expressions (like URLs) are not properly formatted.

View File

@ -93,6 +93,7 @@ There are various reasons for terminating a process instance such as the instanc
![suspend](images/terminated.png) |
## Reset a Process
> **Step 1: Find the active Process Instance**
> **Step 2: Navigate to the active User Task**
@ -107,29 +108,32 @@ Ensure the status has changed from *user_input_required* to *suspended*
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.**
> **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.**
> **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.**
> **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
> **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.
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> ✅ From this point onward, the remaining part of the process can smoothly proceed.
</aside>

View File

@ -5,7 +5,6 @@ It has API documentation available at `/v1.0/ui` generated by openapi ([example
## Layers
```mermaid
graph LR
Controllers -- delegate work to --> Services
@ -14,8 +13,9 @@ Models -- access --> DB[(DB)]
```
### Controllers / routes
Requests come in through the controller layer.
An example controller is src/spiffworkflow_backend/routes/health_controller.py
An example controller is src/spiffworkflow_backend/routes/health_controller.py.
In order to know which controller a request should go to, src/spiffworkflow_backend/api.yml is used by the connexion library.
For example, in api.yml, a GET of /status is mapped to spiffworkflow_backend.routes.health_controller.status, where status is a function in health_controller.py.
Controllers can use services (preferred) and models (allowed) to do their work, but they can never use another controller.
@ -29,30 +29,36 @@ Services are allowed to use models, but models are not allowed to use Services.
Services cannot use controllers.
Keeping calls flowing in a single direction makes things easier to understand and avoids circular imports.
* We have a general notion that services should not call other services (or at
least it must be calls in a single direction. if you call serviceB with serviceA,
then serviceB cannot call serviceA)
* Services should get called by routes.
* We have a general notion that services can call models, but models should
not call services (again, to avoid circular dependencies)
- We have a general notion that services should not call other services (or at
least it must be calls in a single direction. If you call serviceB with serviceA,
then serviceB cannot call serviceA)
- Services should get called by routes.
- We have a general notion that services can call models, but models should
not call services (again, to avoid circular dependencies)
### Models
Models are how flask code interacts with the database
## Database
Backend uses the sqlalchemy library to connect to a required relational database.
This database can be one of MySQL, PostgreSQL, or SQLite.
All of these database engines are tested in CI.
## Serialization
When serializing models to json:
* avoid json.dumps when you are creating json. use jsonify (a flask thing) instead
* avoid marshmallow when possible and instead use @dataclass on your model
* if you need to represent your object in a very custom way (the default dataclass columns are not working out), write a method called serialized on your model (this is used by the default serializer)
- avoid json.dumps when you are creating json. use jsonify (a flask thing) instead
- avoid marshmallow when possible and instead use @dataclass on your model
- if you need to represent your object in a very custom way (the default dataclass columns are not working out), write a method called serialized on your model (this is used by the default serializer)
## Exceptions
Do not define BlahError (exceptions) inside other classes.
All exception classes should be defined in 1) one file, if there are not too many or 2) files that contain only other exception class definitions, again to avoid circular imports.
## Deployment
The gunicorn web server is used to serve the application in the default Dockerfile.

View File

@ -25,13 +25,13 @@ You can specify what data is required as well as how the form should look.
We haven't deeply integrated this library, but it is used by the system that caches permission calls.
## Layers
```mermaid
graph LR
Routes -- delegate work to --> Services
```
### Routes
When the browser sees a URL like /hithere, it will render a route component to handle the request.

View File

@ -1,6 +1,7 @@
# Technical Overview
## Components
```mermaid
graph TD
subgraph spiff-arena

View File

@ -9,6 +9,7 @@ There are few options here:
Please pick the one that best fits your needs.
## 1. Use the default make task
You can set up a full development environment for SpiffWorkflow like this:
```sh
git clone https://github.com/sartography/spiff-arena.git