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

Method _set_state

SpiffWorkflow/task.py:291–303  ·  view source on GitHub ↗

Force set the state on a task

(self, value)

Source from the content-addressed store, hash-verified

289 self.workflow._remove_task(task.id)
290
291 def _set_state(self, value):
292 """Force set the state on a task"""
293
294 if value != self.state:
295 elapsed = time.time() - self.last_state_change
296 self.last_state_change = time.time()
297 self._state = value
298 logger.info(
299 f'State changed to {TaskState.get_name(value)}',
300 extra=self.collect_log_extras({'elapsed': elapsed})
301 )
302 else:
303 logger.debug(f'State set to {TaskState.get_name(value)}', extra=self.collect_log_extras())
304
305 def _assign_new_thread_id(self, recursive=True):
306 """Assigns a new thread id to the task."""

Callers 15

stateMethod · 0.95
reset_branchMethod · 0.95
_readyMethod · 0.95
runMethod · 0.95
cancelMethod · 0.95
completeMethod · 0.95
errorMethod · 0.95
_sync_childrenMethod · 0.80
reset_from_task_idMethod · 0.80
_predict_hookMethod · 0.80
_run_hookMethod · 0.80
_update_hookMethod · 0.80

Calls 2

collect_log_extrasMethod · 0.95
get_nameMethod · 0.45

Tested by

no test coverage detected