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

Method _predict_hook

SpiffWorkflow/specs/SubWorkflow.py:78–88  ·  view source on GitHub ↗
(self, my_task)

Source from the content-addressed store, hash-verified

76 raise WorkflowException('File does not exist: %s' % self.file, task_spec=self)
77
78 def _predict_hook(self, my_task):
79 # Modifying the task spec is a TERRIBLE idea, but if we don't do it, sync_children won't work
80 outputs = [task.task_spec for task in my_task.children]
81 for output in self.outputs:
82 if output not in outputs:
83 outputs.insert(0, output)
84 if my_task.has_state(TaskState.DEFINITE_MASK):
85 # This prevents errors with sync children
86 my_task._sync_children(outputs, TaskState.LIKELY)
87 else:
88 my_task._sync_children(outputs, my_task.state)
89
90 def _create_subworkflow(self, my_task):
91 from ..serializer.prettyxml import XmlSerializer

Callers

nothing calls this directly

Calls 2

has_stateMethod · 0.80
_sync_childrenMethod · 0.80

Tested by

no test coverage detected