Skip to content

Commit

Permalink
fix recursion error in inclusive gateway check
Browse files Browse the repository at this point in the history
  • Loading branch information
essweine committed Jul 19, 2024
1 parent c62a76d commit 8e000c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions SpiffWorkflow/bpmn/specs/mixins/inclusive_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,13 @@ def _check_threshold_unstructured(self, my_task):
# Handle the case where there are paths from active tasks that must go through waiting inputs
waiting_inputs = [i for i in self.inputs if i not in completed_inputs]

checked = []
# This will go back through a task spec's ancestors and return the source, if applicable
def check(spec):
def check(spec):
checked.append(spec)
for parent in spec.inputs:
return parent if parent in sources else check(parent)
if parent not in checked:
return parent if parent in sources else check(parent)

# Start with the completed inputs and recurse back through its ancestors, removing any waiting tasks that
# could reach one of them.
Expand Down

0 comments on commit 8e000c0

Please sign in to comment.