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

Method get_next_task

SpiffWorkflow/workflow.py:108–124  ·  view source on GitHub ↗

Returns the next task that meets the iteration conditions, starting from the root by default. Parameters: first_task (`Task`): search beginning from this task Notes: Other keyword args are passed directly into `get_tasks_iterator` Returns:

(self, first_task=None, **kwargs)

Source from the content-addressed store, hash-verified

106 return [t for t in self.get_tasks_iterator(first_task, **kwargs)]
107
108 def get_next_task(self, first_task=None, **kwargs):
109 """Returns the next task that meets the iteration conditions, starting from the root by default.
110
111 Parameters:
112 first_task (`Task`): search beginning from this task
113
114 Notes:
115 Other keyword args are passed directly into `get_tasks_iterator`
116
117 Returns:
118 `Task` or None: the first task that meets the conditions or None if no tasks match
119 """
120 iter = self.get_tasks_iterator(first_task, **kwargs)
121 try:
122 return next(iter)
123 except StopIteration:
124 return None
125
126 def get_tasks_iterator(self, first_task=None, **kwargs):
127 """Returns an iterator of Tasks that meet the conditions specified `kwargs`, starting from the root by default.

Callers 15

run_nextMethod · 0.95
copy_dataMethod · 0.80
start_workflowMethod · 0.80
copy_dataMethod · 0.80
update_dataMethod · 0.80
testCollaborationMethod · 0.80
testBpmnMessageMethod · 0.80
testCorrelationMethod · 0.80

Calls 1

get_tasks_iteratorMethod · 0.95