from uliweb.manage import make_simple_application app = make_simple_application(apps_dir='./apps') CoreWFManager.reset() storage = WFDatabaseStorage() CoreWFManager.set_storage(storage) workflow_spec = CoreWFManager.get_workflow_spec('TestWorkflow') workflow_spec.on("enter", event_log) workflow_spec.on("ready", event_log) workflow_spec.on("executed", event_log) workflow_spec.on("completed", event_log) print "--------Workflow Spec Dump ----------------------" workflow_spec.dump() workflow = Workflow(workflow_spec) print "---------START-------------------" workflow.start() workflow.run_next() workflow.run_next() workflow.run_next() workflow.run_next() workflow.run_next() print "---------RUN-------------------" workflow.task_tree.dump() workflow_id = workflow.get_id() print "............", workflow_id
app = make_simple_application(apps_dir='./apps') CoreWFManager.reset() storage = WFDatabaseStorage() CoreWFManager.set_storage(storage) workflow_spec = CoreWFManager.get_workflow_spec('TestWorkflow') workflow_spec.on("enter", event_log) workflow_spec.on("ready", event_log) workflow_spec.on("executed", event_log) workflow_spec.on("completed", event_log) print "--------Workflow Spec Dump ----------------------" workflow_spec.dump() workflow = Workflow(workflow_spec) print "---------START-------------------" workflow.start() workflow.run_next() workflow.run_next() workflow.run_next() workflow.run_next() workflow.run_next() print "---------RUN-------------------" workflow.task_tree.dump() workflow_id = workflow.get_id() print "............", workflow_id