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

Method find_ancestor

SpiffWorkflow/task.py:198–211  ·  view source on GitHub ↗

Search for an ancestor that has a task with a spec of the specified name. Args: spec_name (str): the name of the spec associated with the task Returns: `Task`: the first result (or None, if no matching task was found)

(self, spec_name)

Source from the content-addressed store, hash-verified

196 return self.parent.is_descendant_of(task)
197
198 def find_ancestor(self, spec_name):
199 """Search for an ancestor that has a task with a spec of the specified name.
200
201 Args:
202 spec_name (str): the name of the spec associated with the task
203
204 Returns:
205 `Task`: the first result (or None, if no matching task was found)
206 """
207 if self.parent is None:
208 return None
209 if self.parent.task_spec.name == spec_name:
210 return self.parent
211 return self.parent.find_ancestor(spec_name)
212
213 def _add_child(self, task_spec, state=TaskState.MAYBE):
214 """Adds a new child and assigns the given TaskSpec to it.

Callers 7

_find_tasksMethod · 0.80
_startMethod · 0.80
_update_hookMethod · 0.80
_get_activated_tasksMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected