Skip to content

Commit

Permalink
prevent cases where no task spec is assigned during migration
Browse files Browse the repository at this point in the history
  • Loading branch information
essweine committed Jul 10, 2024
1 parent a7ddab8 commit 10f0a19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SpiffWorkflow/bpmn/util/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ def migrate_workflow(diff, workflow, spec, reset_mask=None):
The default rest_mask is TaskState.READY|TaskState.WAITING but can be overridden.
"""
workflow.spec = spec
for task in workflow.get_tasks(skip_subprocesses=True):
task.task_spec = diff.alignment.get(task)
for task in workflow.tasks.values():
if diff.alignment.get(task) is not None:
task.task_spec = diff.alignment.get(task)

default_mask = TaskState.READY|TaskState.WAITING
for task in list(workflow.get_tasks(state=reset_mask or default_mask, skip_subprocesses=True)):
Expand Down

0 comments on commit 10f0a19

Please sign in to comment.