Parameters: workflow_spec (`WorkflowSpec`): the spec that describes this workflow deserializing (bool): whether this workflow is being deserialized
(self, workflow_spec, deserializing=False)
| 45 | """ |
| 46 | |
| 47 | def __init__(self, workflow_spec, deserializing=False): |
| 48 | """ |
| 49 | Parameters: |
| 50 | workflow_spec (`WorkflowSpec`): the spec that describes this workflow |
| 51 | deserializing (bool): whether this workflow is being deserialized |
| 52 | """ |
| 53 | self.spec = workflow_spec |
| 54 | self.data = {} |
| 55 | self.locks = {} |
| 56 | self.last_task = None |
| 57 | self.success = True |
| 58 | self.tasks = {} |
| 59 | self.completed = False |
| 60 | |
| 61 | # Events. |
| 62 | self.completed_event = Event() |
| 63 | |
| 64 | if not deserializing: |
| 65 | self.task_tree = Task(self, self.spec.start, state=TaskState.FUTURE) |
| 66 | self.task_tree.task_spec._predict(self.task_tree, mask=TaskState.NOT_FINISHED_MASK) |
| 67 | logger.info('Initialized workflow', extra=self.collect_log_extras()) |
| 68 | self.task_tree._ready() |
| 69 | |
| 70 | def is_completed(self): |
| 71 | """Checks whether the workflow is complete. |
nothing calls this directly
no test coverage detected