cannot find the process workflow - helloword in the workflow list

73 Views Asked by At

Hi i am new to django and trying to run the sample process in http://docs.viewflow.io/viewflow_quickstart.html

but cannot find the process in the process list.

env lib:

env lib

process list is empty:

process list is empty

flow.py

from viewflow import flow from viewflow.base import this, Flow from viewflow.flow.views import CreateProcessView, UpdateProcessView

from .models import HelloWorldProcess

from viewflow import frontend

@frontend.register class HelloWorldFlow(Flow): process_class = HelloWorldProcess

start = (
    flow.Start(
        CreateProcessView,
        fields=["text"]
    ).Permission(
        auto_create=True
    ).Next(this.approve)
)

approve = (
    flow.View(
        UpdateProcessView,
        fields=["approved"]
    ).Permission(
        auto_create=True
    ).Next(this.check_approve)
)

check_approve = (
    flow.If(lambda activation: activation.process.approved)
    .Then(this.send)
    .Else(this.end)
)

send = (
    flow.Handler(
        this.send_hello_world_request
    ).Next(this.end)
)

end = flow.End()

def send_hello_world_request(self, activation):
    print(activation.process.text)
0

There are 0 best solutions below