def deserialize_workflow_spec(self, s_state, **kwargs): spec = WorkflowSpec(s_state['name'], filename=s_state['file']) spec.description = s_state['description'] # Handle Start Task spec.start = None del spec.task_specs['Start'] start_task_spec_state = s_state['task_specs']['Start'] start_task_spec = StartTask.deserialize(self, spec, start_task_spec_state) spec.start = start_task_spec spec.task_specs['Start'] = start_task_spec for name, task_spec_state in s_state['task_specs'].iteritems(): if name == 'Start': continue task_spec_cls = get_class(task_spec_state['class']) task_spec = task_spec_cls.deserialize(self, spec, task_spec_state) spec.task_specs[name] = task_spec for name, task_spec in spec.task_specs.iteritems(): task_spec.inputs = [ spec.get_task_spec_from_name(t) for t in task_spec.inputs ] task_spec.outputs = [ spec.get_task_spec_from_name(t) for t in task_spec.outputs ] assert spec.start is spec.get_task_spec_from_name('Start') return spec
def deserialize_workflow_spec(self, s_state, **kwargs): spec = WorkflowSpec(s_state['name'], filename=s_state['file']) spec.description = s_state['description'] # Handle Start Task spec.start = None del spec.task_specs['Start'] start_task_spec_state = s_state['task_specs']['Start'] start_task_spec = StartTask.deserialize(self, spec, start_task_spec_state) spec.start = start_task_spec spec.task_specs['Start'] = start_task_spec for name, task_spec_state in s_state['task_specs'].iteritems(): if name == 'Start': continue task_spec_cls = get_class(task_spec_state['class']) task_spec = task_spec_cls.deserialize(self, spec, task_spec_state) if name in spec.task_specs: assert spec.task_specs[name] is task_spec spec.task_specs[name] = task_spec for name, task_spec in spec.task_specs.iteritems(): task_spec.inputs = [spec.get_task_spec_from_name(t) for t in task_spec.inputs] task_spec.outputs = [spec.get_task_spec_from_name(t) for t in task_spec.outputs] assert spec.start is spec.get_task_spec_from_name('Start') return spec
def _deserialize_arg(self, s_state): arg_type, arg = s_state if arg_type == 'Attrib': return self._deserialize_attrib(arg) elif arg_type == 'spiff:value': return arg arg_cls = get_class(arg_type) return arg_cls.deserialize(self, arg)
def deserialize_workflow_spec(self, s_state, **kwargs): spec = WorkflowSpec(s_state['name'], filename=s_state['file']) spec.description = s_state['description'] for name, task_spec_state in s_state['task_specs'].iteritems(): task_spec_cls = get_class(task_spec_state['class']) task_spec = task_spec_cls.deserialize(self, spec, task_spec_state) if name in spec.task_specs: assert spec.task_specs[name] is task_spec spec.task_specs[name] = task_spec for name, task_spec in spec.task_specs.iteritems(): task_spec.inputs = [ spec.get_task_spec_from_name(t) for t in task_spec.inputs ] task_spec.outputs = [ spec.get_task_spec_from_name(t) for t in task_spec.outputs ] assert spec.start is spec.get_task_spec_from_name('Start') return spec