|Version 4 (modified by GoFlow administrator, 8 years ago) (diff)|
(Ongoing translation assisted by Google translate, be indulgent please)
GoFlow User Guide
GoFlow is a django component which adds workflow features to a django project.
We'll learn here how to use this module, starting with a very simple "Hello world" django project, and then gradually add features.
Create a directory, and copy the directory goflow to this directory (you can also place it in any directory in your PYTHONPATH).
In what follows, the use of relative paths, while the Django documentation advocates the use of absolute paths, is voluntary. This is done in order to simplify expressions and to be platform independant (and it works, at least under Windows.)
1. Project "Hello World"
We will discover the workflow engine with a very simple application based on a process workflow with a single activity (a single activity, no transition: the simplest possible). This activity is to receive a message (for example, "Hello world").
- Start by creating a project django empty (or use an existing project)
Django admin-startproj myproj
- Add the following applications in the file settings.py
INSTALLED_APPS = ( ... 'django.contrib.admin' 'goflow.workflow' 'goflow.instances' )The workflow application contains the "static" model data (modeling process), and the instances application contains the dynamic part or runtime.
- Setting up the database part of the settings file, for example like this:
DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = 'data.sqlite'
- Add the following two lines in the urls.py file:
urlpatterns = patterns ('', ... # Uncomment this for admin: (r '^ admin /', include ( 'django.contrib.admin.urls')), (r '^ workflow /', include ( 'goflow.urls')), )
- Create now the database server and start it as this:
python manage.py syncdb - pythonpath =.. python manage.py runserver - pythonpath =..
We can now open the console admin http://localhost:8000/admin, and discover the data models introduced by GoFlow:
we can also discover the GoFlow Dashboard, which has the status of workflows using a "back-office", http://localhost:8000/workflow
We will now create a process workflow.
- Return to the admin console, add an entity Process; screen below is shown:
- Take the title "Hello world", and a description
- Register using the Save button and continue editing: there is an activity End was added automatically.
- Create an initial activity, by clicking on the icon "+" in the field Initial activity: take a title, set the process on the current process "Hello world", leave the default values for other fields.
We have to create our first process workflow:
We have specified no application in our business, we will see that it is not necessary to begin to "play" with our application.
Indeed, when an activity is not associated with an application, a special application is still invoked, to simulate this activity: a panel is simply presented to the user, displaying the name and description of activity . A history of workflow is also displayed. A OK button allows you to complete the activity.
Before you start implementing our process workflow, it lacks one thing: allow the current user (admin for example) to instantiate the process.
- Add a group named Hello world, give him permission can_instantiate on the content type workflow.process, and save
- Add this group to the current user: this allows the user to instantiate the process Hello world.
Everything is now ready to execute our workflow: go on the dashboard http://localhost:8000/workflow. You will find our process and its definition, and other information on the roles and permissions
- Click on the link start a simulation instance under the process Hello world
Bugrev 21: name of process with a white
TO BE CONTINUED