Skip to content

Commit

Permalink
handle certain out of order states in spec migration
Browse files Browse the repository at this point in the history
  • Loading branch information
essweine committed Jul 12, 2024
1 parent 10f0a19 commit d1ddca6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SpiffWorkflow/bpmn/util/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,7 @@ def migrate_workflow(diff, workflow, spec, reset_mask=None):

default_mask = TaskState.READY|TaskState.WAITING
for task in list(workflow.get_tasks(state=reset_mask or default_mask, skip_subprocesses=True)):
task.reset_branch(None)
# In some cases, completed tasks with ready or waiting children could get removed
# (for example, in cycle timer). If a task has already been removed from the tree, ignore it.
if task.id in workflow.tasks:
task.reset_branch(None)

0 comments on commit d1ddca6

Please sign in to comment.