本文整理汇总了Python中SpiffWorkflow.Workflow.dump方法的典型用法代码示例。如果您正苦于以下问题:Python Workflow.dump方法的具体用法?Python Workflow.dump怎么用?Python Workflow.dump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpiffWorkflow.Workflow
的用法示例。
在下文中一共展示了Workflow.dump方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testRunWorkflow
# 需要导入模块: from SpiffWorkflow import Workflow [as 别名]
# 或者: from SpiffWorkflow.Workflow import dump [as 别名]
def testRunWorkflow(self):
filename = os.path.join(os.path.dirname(__file__), 'xml/openwfe/workflow1.xml')
wf_specs = self.reader.parse_file(filename)
wf_spec = wf_specs[0]
for name in wf_spec.task_specs:
wf_spec.task_specs[name].reached_event.connect(self.on_reached_cb)
wf_spec.task_specs[name].completed_event.connect(on_complete_cb, self.taken_path)
workflow = Workflow(wf_spec)
try:
workflow.complete_all()
except:
workflow.dump()
raise
path = [( 1, 'Start'),
( 2, 'concurrence_1'),
( 3, 'task_a1'),
( 4, 'task_a2'),
( 5, 'if_condition_1'),
( 6, 'task_a3'),
( 7, 'if_condition_1_end'),
( 8, 'if_condition_2'),
( 9, 'task_a5'),
(10, 'if_condition_2_end'),
( 3, 'task_b1'),
( 4, 'task_b2'),
( 5, 'concurrence_1_end'),
( 6, 'task_c1'),
( 7, 'task_c2'),
( 8, 'End')]
assert_same_path(self, path, self.taken_path)
示例2: _runWorkflow
# 需要导入模块: from SpiffWorkflow import Workflow [as 别名]
# 或者: from SpiffWorkflow.Workflow import dump [as 别名]
def _runWorkflow(self, wf_spec):
taken_path = {'reached': [],
'completed': []}
for name, task in wf_spec.task_specs.iteritems():
task.reached_event.connect(on_reached_cb, taken_path['reached'])
task.completed_event.connect(on_complete_cb, taken_path['completed'])
# Execute all tasks within the Workflow.
workflow = Workflow(wf_spec)
self.assert_(not workflow.is_completed(), 'Workflow complete before start')
try:
workflow.complete_all()
except:
workflow.dump()
raise
self.assert_(workflow.is_completed(),
'complete_all() returned, but workflow is not complete\n'
+ workflow.task_tree.get_dump())
#workflow.task_tree.dump()
assert_same_path(self, self.expected_path, taken_path['completed'])