Skip to content

Commit

Permalink
Merge pull request #412 from sartography/bugfix/missing-data-output
Browse files Browse the repository at this point in the history
Restrict task search in subprocess updates
  • Loading branch information
essweine authored May 21, 2024
2 parents 6d18cb8 + 9116958 commit d9cd100
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions SpiffWorkflow/bpmn/specs/mixins/subworkflow_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions SpiffWorkflow/bpmn/util/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand All @@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion SpiffWorkflow/bpmn/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d9cd100

Please sign in to comment.