0

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)
Paolo Mossini
  • 1,064
  • 2
  • 15
  • 23
parvez
  • 1
  • 1
  • did your your user have flow view permission? – kmmbvnr Oct 27 '20 at 03:23
  • yes , i think so as this is the super user which we create after executing migration using command manage.py createsuperuser as explained in http://docs.viewflow.io/viewflow_quickstart.html – parvez Oct 27 '20 at 11:38

0 Answers0