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

Method cancel

SpiffWorkflow/workflow.py:206–223  ·  view source on GitHub ↗

Cancels all open tasks in the workflow. Args: success (bool): the state of the workflow Returns: list(`Task`): the cancelled tasks

(self, success=False)

Source from the content-addressed store, hash-verified

204 task.task_spec._update(task)
205
206 def cancel(self, success=False):
207 """Cancels all open tasks in the workflow.
208
209 Args:
210 success (bool): the state of the workflow
211
212 Returns:
213 list(`Task`): the cancelled tasks
214 """
215 self.success = success
216 self.completed = True
217 logger.info(f'Workflow cancelled', extra=self.collect_log_extras())
218 cancelled = []
219 for task in TaskIterator(self.task_tree, state=TaskState.NOT_FINISHED_MASK):
220 cancelled.append(task)
221 for task in cancelled:
222 task.cancel()
223 return cancelled
224
225 def set_data(self, **kwargs):
226 """Defines the given attribute/value pairs."""

Callers

nothing calls this directly

Calls 2

collect_log_extrasMethod · 0.95
TaskIteratorClass · 0.85

Tested by

no test coverage detected