def deserialize_workflow(self, s_state, **kwargs): wf_spec = self.deserialize_workflow_spec(s_state['wf_spec'], **kwargs) workflow = Workflow(wf_spec) # data workflow.data = s_state['data'] # last_task workflow.last_task = s_state['last_task'] # outer_workflow #workflow.outer_workflow = find_workflow_by_id(remap_workflow_id(s_state['outer_workflow'])) # success workflow.success = s_state['success'] # workflow workflow.spec = wf_spec # task_tree workflow.task_tree = self._deserialize_task(workflow, s_state['task_tree']) # Re-connect parents for task in workflow.get_tasks(): task.parent = workflow.get_task(task.parent) return workflow
def deserialize_workflow(self, s_state, **kwargs): wf_spec = self.deserialize_workflow_spec(s_state['wf_spec'], **kwargs) original_root = wf_spec.task_specs['Root'] workflow = Workflow(wf_spec, deserializing=True) new_root = wf_spec.task_specs['Root'] assert original_root is new_root # attributes workflow.attributes = s_state['attributes'] # last_task workflow.last_task = s_state['last_task'] # outer_workflow #workflow.outer_workflow = find_workflow_by_id(remap_workflow_id(s_state['outer_workflow'])) # success workflow.success = s_state['success'] # workflow workflow.spec = wf_spec # task_tree old_root_task = workflow.task_tree workflow.task_tree = self._deserialize_task(workflow, s_state['task_tree']) assert old_root_task is workflow.task_tree return workflow
def deserialize_workflow(self, s_state): wf_spec_class = get_class(s_state['workflow']) wf_spec = wf_spec_class() workflow = Workflow(wf_spec) workflow.attributes = s_state['attributes'] workflow.last_task = s_state['last_task'] workflow.success = s_state['success'] tasks = [self.deserialize_task(workflow, serialized_task) for serialized_task in s_state['task_tree']] workflow.task_tree = [task for task in tasks if task.task_spec.name == 'Root'][0] workflow.spec = wf_spec return workflow
def deserialize_workflow(self, s_state, **kwargs): wf_spec = self.deserialize_workflow_spec(s_state['wf_spec'], **kwargs) workflow = Workflow(wf_spec) # attributes workflow.attributes = s_state['attributes'] # last_task workflow.last_task = s_state['last_task'] # outer_workflow #workflow.outer_workflow = find_workflow_by_id(remap_workflow_id(s_state['outer_workflow'])) # success workflow.success = s_state['success'] # workflow workflow.spec = wf_spec # task_tree workflow.task_tree = self._deserialize_task(workflow, s_state['task_tree']) return workflow