예제 #1
0
def main():
    def event_log(event):
        print " -> spec %s, %s" % (event.task.get_name(), event.type)

    CoreWFManager.reset()
    workflow_spec = CoreWFManager.get_workflow_spec("SplitWorkflow")
    workflow_spec.on("executed", event_log)
    workflow_spec.on("enter", event_log)
    workflow_spec.on("ready", event_log)
    workflow_spec.on("completed", event_log)
    workflow = Workflow(workflow_spec)
    workflow.start()
    workflow.run()
    def setup(self):

        import os
        locate_dir = os.path.dirname(__file__)
        os.chdir(locate_dir)
        os.chdir('test_project')
        from uliweb.manage import make_simple_application
        app = make_simple_application(apps_dir='./apps')

        spec_dir = "test_project/apps/specapp/workflow_specs/"

        CoreWFManager.reset()
        storage = WFConfigStorage()
        config_file = join(dirname(__file__), spec_dir + "TestWorkflow.spec")
        storage.load_config_file(config_file)
        CoreWFManager.set_storage(storage)
    def setup(self):
        
        import os
        locate_dir = os.path.dirname(__file__)
        os.chdir(locate_dir)
        os.chdir('test_project')
        from uliweb.manage import make_simple_application
        app = make_simple_application(apps_dir='./apps')

        spec_dir = "test_project/apps/specapp/workflow_specs/"
        
        CoreWFManager.reset()
        storage = WFConfigStorage()
        config_file = join(dirname(__file__), spec_dir + "TestWorkflow.spec")
        storage.load_config_file(config_file)
        CoreWFManager.set_storage(storage)
예제 #4
0
    def setup(self):

        locate_dir = os.path.dirname(__file__)
        os.chdir(locate_dir)
        os.chdir('test_project')
        self.reset_database()
        manage.call('uliweb syncspec')
        self.path = os.getcwd()

        from uliweb.manage import make_simple_application
        app = make_simple_application(apps_dir='./apps')

        print app
        from uliweb import settings
        print settings.SPECS
        from redbreast.core.spec import WFDatabaseStorage

        CoreWFManager.reset()
    def setup(self):
        
        locate_dir = os.path.dirname(__file__)
        os.chdir(locate_dir)
        os.chdir('test_project')
        self.reset_database()
        manage.call('uliweb syncspec')
        self.path = os.getcwd()

        from uliweb.manage import make_simple_application
        app = make_simple_application(apps_dir='./apps')
        
        print app
        from uliweb import settings
        print settings.SPECS
        from redbreast.core.spec import WFDatabaseStorage
        
        CoreWFManager.reset()
예제 #6
0
def main():
    CoreWFManager.reset()
    workflow_spec = CoreWFManager.get_workflow_spec('MultiChoiceWorkflow')

    count = [0, 0, 0]
    for i in range(0, 100):
        workflow = Workflow(workflow_spec)
        workflow.start()
        workflow.run()       

        flows = workflow.get_data("flows")
        for flow in flows:
            if flow == "A":
                count[0] = count[0] + 1
            elif flow == "B":
                count[1] = count[1] + 1
            elif flow == "C":
                count[2] = count[2] + 1

    print count
예제 #7
0
def main():

    def event_log(event):
        print " -> spec %s, %s" % (event.task.get_name(), event.type)
    
    CoreWFManager.reset()
    workflow_spec = CoreWFManager.get_workflow_spec('ChoiceWorkflow01')

    count = [0, 0]
    for i in range(0, 100):
        workflow = Workflow(workflow_spec)
        workflow.start()
        workflow.run()       

        flow = workflow.get_data("flow")
        if flow == "A":
            count[0] = count[0] + 1
        else:
            count[1] = count[1] + 1

    print "flow A: %d" % count[0]
    print "flow B: %d" % count[1]
from redbreast.core.spec import CoreWFManager
from redbreast.core.spec import *
from redbreast.core import Workflow, Task
from os.path import dirname, join

def event_log(event):
    print " --> spec %s, %s" % (event.task.get_name(), event.type)

CoreWFManager.reset()
storage = WFConfigStorage()
CoreWFManager.set_storage(storage)

config_file = join(dirname(__file__), "data/Sandbox2.config")
storage.load_config_file(config_file)

workflow_spec = CoreWFManager.get_workflow_spec('TestWorkflow')
#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()
print "---------RUN-------------------"
workflow.task_tree.dump()
        
 def setup(self):
     CoreWFManager.reset()
예제 #10
0
from redbreast.serializable import Workflow, Task
import os
from os.path import dirname, join


def event_log(event):
    print " --> spec %s, %s" % (event.task.get_name(), event.type)


locate_dir = os.path.dirname(__file__)
os.chdir(locate_dir)
os.chdir('test_project')
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()
 def setup(self):
     CoreWFManager.reset()