diff --git a/crc/services/workflow_processor.py b/crc/services/workflow_processor.py index 8af1a59f..2eba109b 100644 --- a/crc/services/workflow_processor.py +++ b/crc/services/workflow_processor.py @@ -389,10 +389,15 @@ class WorkflowProcessor(object): """ # If the whole blessed mess is done, return the end_event task in the tree + # This was failing in the case of a call activity where we have an intermediate EndEvent + # what we really want is the LAST EndEvent + + endtasks = [] if self.bpmn_workflow.is_completed(): for task in SpiffTask.Iterator(self.bpmn_workflow.task_tree, SpiffTask.ANY_MASK): if isinstance(task.task_spec, EndEvent): - return task + endtasks.append(task) + return endtasks[-1] # If there are ready tasks to complete, return the next ready task, but return the one # in the active parallel path if possible. In some cases the active parallel path may itself be diff --git a/tests/workflow/test_workflow_call_activity_end_event.py b/tests/workflow/test_workflow_call_activity_end_event.py index 78225aa1..3d6a2b07 100644 --- a/tests/workflow/test_workflow_call_activity_end_event.py +++ b/tests/workflow/test_workflow_call_activity_end_event.py @@ -13,7 +13,7 @@ class TestCallActivityEndEvent(BaseTest): # The call activity has 'Call Event' # This should fail, but it passes - self.assertIn('Call Event', first_task.documentation) + #self.assertIn('Call Event', first_task.documentation) # This should pass, but it fails self.assertIn('Main Workflow', first_task.documentation)