MCPcopy
hub / github.com/sartography/SpiffWorkflow / send_event

Method send_event

SpiffWorkflow/bpmn/workflow.py:134–145  ·  view source on GitHub ↗

Allows this workflow to catch an externally generated event.

(self, event)

Source from the content-addressed store, hash-verified

132 self.refresh_waiting_tasks()
133
134 def send_event(self, event):
135 """Allows this workflow to catch an externally generated event."""
136
137 if event.target is not None:
138 self.catch(event)
139 else:
140 tasks = self.get_tasks(state=TaskState.NOT_FINISHED_MASK, catches_event=event)
141 if len(tasks) == 0:
142 raise WorkflowException(f"This process is not waiting for {event.event_definition.name}")
143 for task in tasks:
144 task.task_spec.catch(task, event)
145 self.refresh_waiting_tasks()
146
147 def get_events(self):
148 """Returns the list of events that cannot be handled from within this workflow."""

Callers 2

testBpmnMessageMethod · 0.80

Calls 4

catchMethod · 0.95
refresh_waiting_tasksMethod · 0.95
WorkflowExceptionClass · 0.90
get_tasksMethod · 0.80

Tested by 2

testBpmnMessageMethod · 0.64