• Stars
    star
    134
  • Rank 269,430 (Top 6 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created over 15 years ago
  • Updated almost 15 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A lightweight workflow engine application for Django based web-applications
Django Workflow Application v0.1 (alpha)

(c) 2009 Nicholas H.Tollervey (http://ntoll.org/contact)

See the file LICENSE.txt for the licensing terms and conditions.

This Django application provides a workflow engine for use in your 
web-application. This work is an abstraction of / extraction from a workflow
engine built for an HR application.

Currently only the models have been "extracted". Commented doctests can be 
found in tests.py. I've also created some templates for generating .dot files
for processing by Graphviz. See: http://twitpic.com/7xiz7 for example output.
See the urls.py for paths to use to display the .dot file and resulting .png
image.

To make things easy I've described each model below and made up a couple of 
"user stories" to illustrate how stuff fits together (an Applicant Tracking 
System used by HR and a simple issue tracker for filing bugs, feature requests 
and whatnot). 

I realise the examples might be a tad contrived but I always find that thinking
about tangible examples relating to data models is always helpful.

The order that I describe the tables follows the code outline.

Role - defines what sort of users are associated with different aspects of the
workflow. In the HR project these roles might include: 'HR Consultant', 'Hiring
Manager', 'Interviewer' or 'Assessor'. In the issue tracker these might simply 
be 'Core Developer', 'Release Manager' or 'Tester'. The State and Transition 
models have a many-to-many relationship with Role to indicate what sort of 
person has permission to view a state or use a transition. The Event model has a
many-to-many relationship with Role to indicate who is participating in the
event.

Workflow - names / describes a workflow. In the HR project workflows might be:
'Generic Hiring Process', 'Executive Hiring Process' or 'Employee Appraisal'. In
the issue tracker these might include: 'Bug Report', 'Feature Request' or
'Release Lifecycle'. A workflow can be in one of three states that defines the
life of a workflow: definition -> active -> retired. A workflow can only be
changed when it has the state 'definition' (where changed means states and
transitions added or removed). A workflow can only be used when it has the state
'active'. When a workflow is no longer useful, or is found to contain errors
then it is marked as 'retired'. Why take so much trouble over this? Imagine the
mess that could ensue if a 'live' workflow were changed and states were deleted
or orphaned. Furthermore, retired workflows could be "cloned" as the basis of
new workflows in the 'definition' state. 

State - represents a specific state that a thing can be in. In the HR project
examples might be: 'Open for applications', 'Final shortlisting', 'Employee
Interviews'. In the issue tracker we might have: 'Open', 'Rejected', 'Awaiting
Approval'. Put simply a state is a description of a node in a directed graph. 
Only one state can be marked as 'is_start_state' for each workflow but many can
be marked as 'is_end_state' (indicating the workflow has been completed). Roles
associated with each state indicate *who* has access to the thing when in this
state.

Transition - defines how a workflow can move between states. They *should* be
given "active" names. For example, in the HR project transitions might be:
'Publish Vacancy' (leading to the 'Open for applications' state), 'Publish
applications' (leading to the 'Final shortlisting' state) or 'Publish
meeting slots' (leading to 'Employee Interviews'). The issue tracker transitions
are probably more obvious 'Submit issue' (leads to 'Open' state), 'Reject'
(leads to 'Rejected') and 'Propose new feature' (leads to 'Awaiting Approval').
Put simply, a transition is an edge in a directed graph. Roles associated with
each transition indicate *who* can use the transition to move the workflow to a
new state.

EventType - just defines the name of a type of event. Examples might be:
meeting, assessment, interview, deployment test, feature freeze and so on.

Event - is a specification for something that is supposed to happen whilst in
a state. In the HR project events might be: 'Meeting to approve job
specification', 'Meeting of review board' or 'Contact all managers conducting
employee interviews'. The issue tracker might have: 'Check for duplicate issue',
'Check unit tests pass on staging server'. The roles field indicates *who* is to
participate in the event. I've also included an is_mandatory flag. An event can
be associated with many EventTypes.

WorkflowActivity - is a core model to link "things" to workflows in a similar way
to User objects having a profile. Vacancy and Issue instances in the HR and
issue tracker examples should reference a WorkflowManager. The WorkflowManager
simply references an active Workflow and contains created_on and completed_on
timestamps. The various methods associated with this model should be used move
through the life of the workflow.

Participant - links django.contrib.auth.models.User instances to a Role and 
WorkflowManager. This way we know that user 'Joe Blogs' has the role 'Hiring 
Manager' for the duration of the WorkflowManager that is using the 'Executive
Hiring Process' workflow. We might also know that jtauber is Release Manager 
during the lifetime of the WorkflowManager for Pinax1.0 that follows the Release 
Lifecycle workflow.

WorkflowHistory - simply links up the WorkflowManager, State, Transition and
Events to the State, Participant, a descriptive note and a timestamp enabling 
us to track how the workflow has progressed (with the most recent being the 
current state). Examples might be: Pinax1.0 WorkflowManager, "RC1" state, 
"Prepare Release Candidate" transition, jtauber, 2009-11-5.

As always, comments, ideas, suggestions and improvements are most welcome.

More Repositories

1

drogulus

A programmable peer-to-peer data store built for simplicity, security, openness and fun (and designed to withstand nuclear war).
Python
200
star
2

foox

Creates species counterpoint using genetic algorithms (in Python).
Python
131
star
3

uflash

A module and command to easily flash Python onto the BBC's micro:bit device.
Python
93
star
4

microformats

A simple Django application that makes it easy to integrate and use Microformats in your web-application.
Python
57
star
5

programming-with-micropython

Code from the O'Reilly book of the same name.
Python
48
star
6

microfs

A simple command line tool and module for interacting with the simple filesystem on the BBC micro:bit.
Python
37
star
7

microrepl

A REPL client for MicroPython running on the BBC micro:bit.
Python
30
star
8

p4p2p

A small and simple framework for making peer-to-peer applications.
Python
19
star
9

code-dojo

Code required *before* the London Code Dojo
Python
13
star
10

paperchase

A simple game set in both the "paper" and "real" world. Created for PyWeek 25.
Python
11
star
11

arrr

A module and utility to turn English into Pirate speak.
Python
11
star
12

programmer_pythonical

The PyconUK Song!
10
star
13

tweetdreams

Uses Markov chains to generate new tweets based on past tweets.
Python
10
star
14

Adafruit_CircuitPython_Radio

Simple byte and string based inter-device communication via BLE.
Python
10
star
15

textsmith

A multi-user collaborative platform for creating and inhabiting text based literary worlds.
Python
9
star
16

upyed

HTML
9
star
17

RESTProvider

REST Provider for Android
Java
8
star
18

FluidDB.NET

A library for connecting to FluidDB from .NET
C#
8
star
19

chckn

Chicken chicken chicken chicken. Chicken chicken: chicken!
Python
7
star
20

IssueTracker

A very simple Django based issue tracking system written to demonstrate my Workflow application
Python
6
star
21

being_together

A poetic expression of an aspiration for being together. An alternative to, and definitely not, a code of conduct.
6
star
22

dojomaze

Python
5
star
23

aimlbot

Old and no longer under active development.
C#
5
star
24

bitbotcode

The driver and controller code for radio controlled bit:bit robots.
Python
5
star
25

pride_and_prejudice_and_python

A silly Jupyter notebook to demonstrate text generation with n-grams and Markov chains.
Jupyter Notebook
5
star
26

flow

Flow is a javascript application for writing javascript based applications within FluidDB. Let the circularity ensue...
JavaScript
5
star
27

fluiddb.py

A very thin wrapper around FluidDB's RESTful API. Originally based upon sanxyin's fluiddb.py found here: http://bitbucket.org/sanxiyn/fluidfs
Python
5
star
28

bookreader

A simple book reading application built on Fluidinfo using just client-side Javascript.
Python
4
star
29

python-native-editor

A Chrome App based native editor.
HTML
4
star
30

xmppComponent

A simple todo list application written as an XMPP component. For the purposes of demonstrating XMPP in the London Python Code Dojo.
Python
4
star
31

FUZZYMANDIAS

A poem dedicated to @voidspace with apologies to Horace Smith :-)
4
star
32

presentations

Presentations I have made
JavaScript
3
star
33

pocketFluidDB

An example of an javascript application for FluidDB that can be hosted on FluidDB
JavaScript
3
star
34

pyconuk-education-sprint-2012

The results of the education sprint from PyconUK 2012
3
star
35

delicious2fluid

Exports from Delicious and imports into FluidDB
Python
3
star
36

BFD

Big Friendly Datastore (organic collaboration on data, from the ground up).
Python
3
star
37

LondonPythonCodeDojo

Digital assets for organisers of the London Python Code Dojo
3
star
38

checklistDSL

A very simple DSL for specifying checklists that turn into interactive web-forms.
Python
3
star
39

cityrhythm

A musical representation of footfall data provided by Leeds City Council through the medium of Brass Band
JavaScript
3
star
40

doitreatthisimmigrant

Automatically detects if a doctor in the UK should treat an immigrant asking for treatment.
2
star
41

numberwang

A module and utility to recreate the gameshow "Numberwang" in Python (for educational purposes).
Python
2
star
42

fluidroid

Android library for connecting to Fluidinfo
2
star
43

ntoll.github.io

My homepage / blog
JavaScript
2
star
44

openprism

OpenPrism is just like the NSA's PRISM project - but opt-in.
JavaScript
2
star
45

penelope1

Penelope's first program
1
star
46

PyProad

Thin wrapper around Amazon's Product Advertising API
Python
1
star
47

nhsdtraining

Training notes for Python project development, especially with Django web framework.
JavaScript
1
star
48

PyMerryChristmas

A simple interactive Christmas card written in Python with the Pygame library. For the purposes of learning about Pygame.
Python
1
star
49

pyintro

Materials for the PyconUK "Introduction to Python" tutorial.
JavaScript
1
star
50

epubible

Currently a very shonky script to make a customised epub version of the bible from data stored in Fluidinfo. Incomplete and buggy!
Python
1
star
51

sneakywumpus

A sneaky Hunt the Wumpus clone written in the London Python Code Dojo
Python
1
star
52

build-yourself-a-pyscript

Slides for PyCon US 2023 presentation
JavaScript
1
star
53

event_log

A simple Django application that logs events and generates timelines
Python
1
star
54

traffic_flowmageddon

A goofy game for PyWeek 26 (October 2018)
Python
1
star
55

roddy

Generates compositions based upon musical analysis.
Makefile
1
star
56

fluidrefreshmentdb

A simple self-hosted javascript application for FluidDB that runs almost anywhere
JavaScript
1
star
57

hscic_apiomatic

Scrapes HSCIC website and builds a list of JSON objects for each dataset and key indicator found therein.
Python
1
star