class FailingProcess(Process): start = tasks.Start() def fail(self): raise ValueError("Boom!") edges = ((start, fail), )
class FailingWorkflow(models.FailingWorkflowState): start = tasks.Start() def fail(self): raise ValueError("Boom!") edges = ((start, fail), ) class Meta: proxy = True
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), )
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
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), )
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
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