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

Method run

SpiffWorkflow/task.py:335–358  ·  view source on GitHub ↗

Execute the task. Call's the task spec's `TaskSpec.run` method and checks the return value. If the return value is - `True`: mark the task COMPLETE - `False`: mark the task in ERROR - `None`: mark the task STARTED Returns: bool: the valu

(self)

Source from the content-addressed store, hash-verified

333 self.task_spec._on_ready(self)
334
335 def run(self):
336 """Execute the task.
337
338 Call's the task spec's `TaskSpec.run` method and checks the return value.
339
340 If the return value is
341 - `True`: mark the task COMPLETE
342 - `False`: mark the task in ERROR
343 - `None`: mark the task STARTED
344
345 Returns:
346 bool: the value returned by the `TaskSpec`'s run method
347
348 See `TaskState` for more information about states.
349 """
350 start = time.time()
351 retval = self.task_spec._run(self)
352 if retval is None:
353 self._set_state(TaskState.STARTED)
354 elif retval is False:
355 self.error()
356 else:
357 self.complete()
358 return retval
359
360 def cancel(self):
361 """Cancels the item if it was not yet completed; recursively cancels its children."""

Callers 15

run_task_from_idMethod · 0.80
run_nextMethod · 0.80
update_workflowMethod · 0.80
start_workflowMethod · 0.80
docTest.pyFile · 0.80
do_next_unique_taskMethod · 0.80
do_next_named_stepMethod · 0.80
testCorrelationMethod · 0.80
testResetToTopMethod · 0.80

Calls 4

_set_stateMethod · 0.95
errorMethod · 0.95
completeMethod · 0.95
_runMethod · 0.80

Tested by 15

do_next_unique_taskMethod · 0.64
do_next_named_stepMethod · 0.64
testCorrelationMethod · 0.64
testResetToTopMethod · 0.64
testParallelConditionMethod · 0.64
set_dataMethod · 0.64
testLoopMaximumMethod · 0.64
testLoopConditionMethod · 0.64