Skip to content

Commit d1ddca6

Browse files
committed
handle certain out of order states in spec migration
1 parent 10f0a19 commit d1ddca6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SpiffWorkflow/bpmn/util/diff.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,7 @@ def migrate_workflow(diff, workflow, spec, reset_mask=None):
218218

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

0 commit comments

Comments
 (0)