diff --git a/SpiffWorkflow/bpmn/specs/mixins/subworkflow_task.py b/SpiffWorkflow/bpmn/specs/mixins/subworkflow_task.py index 05384011..97c71a0c 100644 --- a/SpiffWorkflow/bpmn/specs/mixins/subworkflow_task.py +++ b/SpiffWorkflow/bpmn/specs/mixins/subworkflow_task.py @@ -85,7 +85,7 @@ def __init__(self, wf_spec, bpmn_id, subworkflow_spec, **kwargs): def copy_data(self, my_task, subworkflow): - start = subworkflow.get_next_task(spec_name='Start') + start = subworkflow.get_next_task(subworkflow.task_tree, skip_subprocesses=True, spec_name='Start') if subworkflow.spec.io_specification is None or len(subworkflow.spec.io_specification.data_inputs) == 0: # Copy all task data into start task if no inputs specified start.set_data(**my_task.data) @@ -106,7 +106,7 @@ def update_data(self, my_task, subworkflow): # Copy all workflow data if no outputs are specified my_task.data = deepcopy(subworkflow.last_task.data) else: - end = subworkflow.get_next_task(spec_name='End') + end = subworkflow.get_next_task(subworkflow.task_tree, skip_subprocesses=True, spec_name='End') # Otherwise only copy data with the specified names for var in subworkflow.spec.io_specification.data_outputs: if var.bpmn_id not in end.data: diff --git a/SpiffWorkflow/bpmn/util/task.py b/SpiffWorkflow/bpmn/util/task.py index e3aa4937..9d5f86cf 100644 --- a/SpiffWorkflow/bpmn/util/task.py +++ b/SpiffWorkflow/bpmn/util/task.py @@ -41,11 +41,11 @@ def _catches_event(task): class BpmnTaskIterator(TaskIterator): - def __init__(self, task, end_at_spec=None, max_depth=1000, depth_first=True, skip_subpprocesses=False, task_filter=None, **kwargs): + def __init__(self, task, end_at_spec=None, max_depth=1000, depth_first=True, skip_subprocesses=False, task_filter=None, **kwargs): task_filter = task_filter or BpmnTaskFilter(**kwargs) super().__init__(task, end_at_spec, max_depth, depth_first, task_filter) - self.skip_subpprocesses = skip_subpprocesses + self.skip_subprocesses = skip_subprocesses def _next(self): @@ -64,7 +64,7 @@ def _next(self): # Do not descend into a completed subprocess to look for unfinished tasks. if ( subprocess is None - or self.skip_subpprocesses + or self.skip_subprocesses or (task.state >= TaskState.FINISHED_MASK and self.task_filter.state <= TaskState.FINISHED_MASK) ): subprocess_tasks = [] diff --git a/SpiffWorkflow/bpmn/workflow.py b/SpiffWorkflow/bpmn/workflow.py index 1a132d76..a6ab8f38 100644 --- a/SpiffWorkflow/bpmn/workflow.py +++ b/SpiffWorkflow/bpmn/workflow.py @@ -112,7 +112,7 @@ def catch(self, event): """ if event.target is not None: # This limits results to tasks in the specified workflow - tasks = event.target.get_tasks(skip_subpprocesses=True, state=TaskState.NOT_FINISHED_MASK, catches_event=event) + tasks = event.target.get_tasks(skip_subprocesses=True, state=TaskState.NOT_FINISHED_MASK, catches_event=event) else: self.update_collaboration(event) tasks = self.get_tasks(state=TaskState.NOT_FINISHED_MASK, catches_event=event)