-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/fix-multiple-message-start-events #1005
Conversation
…tart events that do not match w/ burnettk
…message-start-events
WalkthroughThe recent updates to the SpiffWorkflow backend and its tests introduce enhanced handling of BPMN message events, particularly focusing on processes with multiple message start events. These changes include the ability to start processes based on specific user messages, improved import functionalities, and the addition of a new method to cancel non-matching start events. Furthermore, a new BPMN process example and a test have been added to ensure that messages trigger the correct start event when multiple options are available, addressing issues related to process instance creation loops caused by message events. Changes
Assessment against linked issues
The code changes effectively address the primary concerns highlighted in issue #1003. The introduction of a method to cancel non-matching start events and the adjustment to start processes based on specific user messages directly tackle the issue of looped creation of instances and ensure that incoming messages trigger the correct process logic. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 2
Configuration used: .coderabbit.yaml
Files selected for processing (3)
- spiffworkflow-backend/src/spiffworkflow_backend/services/message_service.py (4 hunks)
- spiffworkflow-backend/tests/data/multiple_message_start_events/multiple-message-start-events.bpmn (1 hunks)
- spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_message_service.py (2 hunks)
Additional comments: 3
spiffworkflow-backend/src/spiffworkflow_backend/services/message_service.py (2)
- 56-56: The
start_process_with_message
method now accepts auser
parameter instead ofmessage_instance
. Ensure all calls to this method throughout the codebase have been updated accordingly.Verification successful
The verification process confirms that all calls to the
start_process_with_message
method within the codebase have been updated to pass auser
parameter, aligning with the changes mentioned. This includes both the implementation and unit tests, ensuring consistency with the updated method signature.* 127-141: The `_cancel_non_matching_start_events` method correctly cancels start events that do not match the intended start event. However, ensure that this logic does not inadvertently cancel events that should be triggered under valid conditions.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for calls to start_process_with_message and ensure they now pass a user parameter. rg "start_process_with_message\(" --type pyLength of output: 486
spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_message_service.py (1)
- 190-209: The test
test_can_send_to_correct_start_event_if_there_are_multiple
correctly sets up a scenario to test the new functionality. Ensure that the test covers all relevant cases, including negative scenarios where a message should not trigger a start event.
Fixes #1003
This updates MessageService to cancel all start events that do not match the start event that matches the trigger. This allows only the intended message instance to get created and allows SpiffWorkflow ignore any undesired start events that could cause it to not correctly return the waiting events.
Summary by CodeRabbit
New Features
Tests