本文整理汇总了Python中SpiffWorkflow.Workflow.attributes方法的典型用法代码示例。如果您正苦于以下问题:Python Workflow.attributes方法的具体用法?Python Workflow.attributes怎么用?Python Workflow.attributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpiffWorkflow.Workflow
的用法示例。
在下文中一共展示了Workflow.attributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: deserialize_workflow
# 需要导入模块: from SpiffWorkflow import Workflow [as 别名]
# 或者: from SpiffWorkflow.Workflow import attributes [as 别名]
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
示例2: deserialize_workflow
# 需要导入模块: from SpiffWorkflow import Workflow [as 别名]
# 或者: from SpiffWorkflow.Workflow import attributes [as 别名]
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
示例3: deserialize_workflow
# 需要导入模块: from SpiffWorkflow import Workflow [as 别名]
# 或者: from SpiffWorkflow.Workflow import attributes [as 别名]
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