Skip to content

Commit

Permalink
add state check to send_event
Browse files Browse the repository at this point in the history
  • Loading branch information
essweine committed Apr 19, 2024
1 parent 96b581a commit 76eb9e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SpiffWorkflow/bpmn/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def catch(self, event):
def send_event(self, event):
"""Allows this workflow to catch an externally generated event."""

tasks = self.get_tasks(catches_event=event)
tasks = self.get_tasks(state=TaskState.NOT_FINISHED_MASK, catches_event=event)
if len(tasks) == 0:
raise WorkflowException(f"This process is not waiting for {event.event_definition.name}")
for task in tasks:
Expand Down

0 comments on commit 76eb9e6

Please sign in to comment.