Esempio n. 1
0
class FailingProcess(Process):
    start = tasks.Start()

    def fail(self):
        raise ValueError("Boom!")

    edges = ((start, fail), )
Esempio n. 2
0
class FailingWorkflow(models.FailingWorkflowState):
    start = tasks.Start()

    def fail(self):
        raise ValueError("Boom!")

    edges = ((start, fail), )

    class Meta:
        proxy = True
Esempio n. 3
0
class SimpleProcess(Process):
    start_view = views.StartView(fields='__all__')
    start_method = tasks.Start()
    save_the_princess = views.TaskView(fields='__all__')

    def end(self):
        pass

    edges = (
        (start_view, save_the_princess),
        (start_method, save_the_princess),
        (save_the_princess, end),
    )
Esempio n. 4
0
class TestWorkflow(models.TestWorkflowState):
    a = tasks.Start()
    b = tasks.UpdateView()
    c = lambda s, t: s

    not_a_node = lambda s, t: s

    edges = [
        (a, b),
        (b, c),
    ]

    class Meta:
        proxy = True
Esempio n. 5
0
class WaitProcess(Process):
    parallel_task_value = models.PositiveIntegerField(default=0)

    start = tasks.Start()

    wait = tasks.Wait(timedelta(hours=3))

    def end(self):
        pass

    edges = (
        (start, wait),
        (wait, end),
    )
Esempio n. 6
0
class WaitWorkflow(models.WaitWorkflowState):
    start = tasks.Start()

    wait = tasks.Wait(timedelta(hours=3))

    def end(self):
        pass

    edges = (
        (start, wait),
        (wait, end),
    )

    class Meta:
        proxy = True
Esempio n. 7
0
class SimpleWorkflow(models.SimpleWorkflowState):
    start_view = tasks.StartView(fields="__all__", path="custom/postfix/")
    start_method = tasks.Start()
    save_the_princess = tasks.UpdateView(fields="__all__")

    def end(self):
        pass

    edges = (
        (start_view, save_the_princess),
        (start_method, save_the_princess),
        (save_the_princess, end),
    )

    class Meta:
        proxy = True