Exemplo n.º 1
0
vartest = {'vartest':'hello vartest!'}

# Create the workflow.
workflow = Workflow(spec)
# Execute until all tasks are done or require manual intervention.
# For the sake of this tutorial, we ignore the "manual" flag on the
# tasks. In practice, you probably don't want to do that.

#workflow.complete_all(halt_on_manual=False)
workflow.dump()

#workflow.get_dump()
#workflow.complete_next(halt_on_manual=False)
#workflow.get_dump()
workflow.complete_next()

condition_keys = []
tasks = workflow.get_tasks(Task.READY)
for t in tasks:
    print(t.get_name())

user_selct = {'confirmation':'yes'}
task_data_dict = user_selct.copy()

for t in tasks:
    print("Ready:",t.task_spec.name)
    if hasattr(t.task_spec,"cond_task_specs"):
        for cond,name in t.task_spec.cond_task_specs:
            for cond_unit in cond.args:
                print("cond_unit",cond_unit)
def run_workflow(spec):
    wflow = Workflow(spec)
    for _ in range(0, 4):
        wflow.task_tree.dump()
        print '----'
        wflow.complete_next(False)
Exemplo n.º 3
0
def run_workflow(spec):
    wflow = Workflow(spec)
    for _ in range(0, 4):
        wflow.task_tree.dump()
        print '----'
        wflow.complete_next(False)