Version 3 (modified by 17 years ago) ( diff ) | ,
---|
(Ongoing translation assisted by Google translate, be indulgent please)
GoFlow User Guide
GoFlow is a django component(project to provide application modules to another project django) to add workflow features to a project django.
We'll learn here to use this module, starting a project django very simple ("Hello world"), then gradually adding features.
Prerequisite
Create a directory, and copy the directory goflowin this directory (you can also place it in any directory PYTHONPATH).
Note:
In what follows, using filenames on, while the documentation Django advocates the use of absolute paths, this is voluntary, in order to simplify expressions and to be neutral vis-à-vis the platform (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 application workflow contains the "static" model data (modeling process), and application forums contains the dynamic part, or runtime.
- Setting up the party's database file settings, for example like this:
DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = 'data.sqlite'
- Add the following lines 2 in 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 starting with:
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.
- Save
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