Skip to content
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

do not execute boundary events in catch #312

Merged
merged 1 commit into from
Apr 10, 2023

Conversation

essweine
Copy link
Contributor

@essweine essweine commented Apr 7, 2023

This is a fairly minor change, but required lots of test updates.

Boundary events were formerly being run from catch; ideally tasks should only run through an explicit call. To fix boundary events, I had to also update subworkflow tasks not to immediately move to ready when the subworkflow completes (also a net positive since it removes a special case transition).

However, this means that they need to be updated before they become ready, and then they need to be run, which required lots of updates to our tests.

@sonarcloud
Copy link

sonarcloud bot commented Apr 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@burnettk
Copy link
Contributor

burnettk commented Apr 8, 2023

if i replace, in backend's pyproject.toml:

SpiffWorkflow = {git = "https://github.com/sartography/SpiffWorkflow", rev = "main"}

with:

SpiffWorkflow = {git = "https://github.com/sartography/SpiffWorkflow", rev = "bugfix/run-boundary-events-from-engine-steps"}

and run poetry update SpiffWorkflow, then i get this when i run tests in backend:

FAILED tests/spiffworkflow_backend/unit/test_process_instance_processor.py::TestProcessInstanceProcessor::test_properly_saves_tasks_when_running - IndexError: list index out of range
FAILED tests/spiffworkflow_backend/unit/test_process_instance_processor.py::TestProcessInstanceProcessor::test_it_can_loopback_to_previous_bpmn_subprocess_with_gateway - assert 0 == 1
FAILED tests/spiffworkflow_backend/unit/test_process_model.py::TestProcessModel::test_can_run_process_model_with_call_activities_when_in_same_process_model_directory - AssertionError: assert 'waiting' == 'complete'
FAILED tests/spiffworkflow_backend/unit/test_process_model.py::TestProcessModel::test_can_run_process_model_with_call_activities_when_not_in_same_directory - AssertionError: assert 'waiting' == 'complete'
FAILED tests/spiffworkflow_backend/unit/test_process_model.py::TestProcessModel::test_can_run_process_model_with_call_activities_when_process_identifier_is_not_in_database - AssertionError: assert 'waiting' == 'complete'

the assertion that fails in test_can_run_process_model_with_call_activities_when_in_same_process_model_directory is:

assert process_instance.status == "complete" # and the instance is waiting instead of complete.

it seems like when a call activity is run with this branch in backend, activities inside of the called activity can all complete successfully, but the call activity itself (the caller) gets stuck in waiting instead of completing.

@essweine
Copy link
Contributor Author

essweine commented Apr 8, 2023

If you refresh waiting tasks, they should change to ready. I changed this in many of the spiffworkflow unit tests, and you probably have to do that in the spiffworkflow-backend tests too. Instead of the subworkflow completion event automatically changing the task's state, it now happens via the _update method (which is really where the update should have been done all along).

@essweine essweine merged commit 98a1b37 into main Apr 10, 2023
@essweine essweine deleted the bugfix/run-boundary-events-from-engine-steps branch April 10, 2023 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants