Fixing a bug with navigation where elements went missing past exclusive gateways on subsequent forks.

This commit is contained in:
Dan Funk 2020-05-16 15:33:06 -04:00
parent 7d3f139633
commit 43bf8f5337
3 changed files with 24 additions and 4 deletions

8
Pipfile.lock generated
View File

@ -783,7 +783,7 @@
"spiffworkflow": {
"editable": true,
"git": "https://github.com/sartography/SpiffWorkflow.git",
"ref": "661902387021f7130ae27fa35434eb3b2c138610"
"ref": "29afbcd69d7bb266c7b08962b5f0b36fdbc4636b"
},
"sqlalchemy": {
"hashes": [
@ -912,10 +912,10 @@
},
"more-itertools": {
"hashes": [
"sha256:5dd8bcf33e5f9513ffa06d5ad33d78f31e1931ac9a18f33d37e77a180d393a7c",
"sha256:b1ddb932186d8a6ac451e1d95844b382f55e12686d51ca0c68b6f61f2ab7a507"
"sha256:558bb897a2232f5e4f8e2399089e35aecb746e1f9191b6584a151647e89267be",
"sha256:7818f596b1e87be009031c7653d01acc46ed422e6656b394b0f765ce66ed4982"
],
"version": "==8.2.0"
"version": "==8.3.0"
},
"packaging": {
"hashes": [

View File

@ -93,6 +93,9 @@ def __get_workflow_api_model(processor: WorkflowProcessor, next_task = None):
spiff_task = processor.bpmn_workflow.get_task(nav_item['task_id'])
if 'description' in nav_item:
nav_item['title'] = nav_item.pop('description')
# fixme: duplicate code from the workflow_service. Should only do this in one place.
if ' ' in nav_item['title']:
nav_item['title'] = nav_item['title'].partition(' ')[2]
else:
nav_item['title'] = ""
if spiff_task:

View File

@ -162,6 +162,23 @@ class TestTasksApi(BaseTest):
self.assertEquals("yes", nav[2]['title'])
self.assertEquals("NOOP", nav[2]['state'])
def test_navigation_with_exclusive_gateway(self):
self.load_example_data()
workflow = self.create_workflow('exclusive_gateway_2')
# get the first form in the two form workflow.
workflow_api = self.get_workflow_api(workflow)
self.assertIsNotNone(workflow_api.navigation)
nav = workflow_api.navigation
self.assertEquals(7, len(nav))
self.assertEquals("Task 1", nav[0]['title'])
self.assertEquals("Which Branch?", nav[1]['title'])
self.assertEquals("a", nav[2]['title'])
self.assertEquals("Task 2a", nav[3]['title'])
self.assertEquals("b", nav[4]['title'])
self.assertEquals("Task 2b", nav[5]['title'])
self.assertEquals("Task 3", nav[6]['title'])
def test_document_added_to_workflow_shows_up_in_file_list(self):
self.load_example_data()