Code


Version 6 (modified by anonymous, 7 years ago) (diff)

--

GoFlow: a workflow engine for Django

News:

Sites

  • contact: goflow(at)alwaysdata.net

The Leave workflow application

Follow instructions in the install.txt file included in the goflow distribution. You can then play with the leave demo application. You will find here some details of the leave application implementation.

settings file

standard settings

First, tell Django you want to use the workflow engine:

INSTALLED_APPS = (
    ....
    'django.contrib.workflow',    # uses the workflow engine
    'leavedemo.leave',            # the leave application
)

specific settings

WF_APPS_PREFIX = 'leavedemo'

This is the url prefix for workflow application definition; for example, in the workflow definition the application app1 is mapped on the url /leavedemo/app1

WF_PUSH_APPS_PREFIX = 'leavedemo.leave.pushapplications'

this is the module containing the push applications functions; for example, the push application pushapp1 is a function defined as following in the leavedemo/leave/pushapplications.py module:

def pushapp1(workitem):
    ...
    return aUser

urls.py file

Starting a workflow instance

the start_application is a handler that display a form used to create an instance of the workflow process:

usage:

    (r'^leavedemo/request/$',
     'django.contrib.workflow.applications.start_application',
     {'process_name':'leave', 'form_class':RequestForm, 'template':'start_leave.html'}),

next soon ...

Attachments (3)

Download all attachments as: .zip