Extension:Workflow, Dunkley 2009

Wiki-based workflow
Wiki-based workflow is a means of organising tasks into categories to be used as a blackboard system (a.k.a space-based architecture, shared nothing architecture or Tuple space). This is achieved in the wiki by establishing the workflow methodology as a set of best practices defining all aspects of the way the wiki is to be used, and an established resource of structured content to support that way of working.

Here is an example taken from the Wikipedia article which describes the system in terms of Human roles working together on a project.
 * A group of specialists are seated in a room with a large blackboard. The specialists are working as a team to brainstorm a solution to a problem, using the blackboard as the workplace for cooperatively developing the solution. The session begins when the problem specifications are written onto the blackboard. The specialists all watch the blackboard, looking for an opportunity to apply their expertise to the developing solution. When someone writes something on the blackboard that allows another specialist to apply her expertise, she records her contribution on the blackboard, hopefully enabling other specialists to then apply their expertise. This process of adding contributions to the blackboard continues until the problem has been solved.


 * A blackboard system enables this flexible brainstorming style of interaction between diverse software specialists. Each of these specialists scans the changes to the blackboard, and posts an updated partial solution based on the state of the blackboard whenever its own internal conditions for doing so are met. These partial solutions cause other knowledge sources to update their portions of the solution on the blackboard until eventually an answer is found. In this fashion, the specialists work together to solve the problem.

The Workflow extension
The idea of this extension is to have an automated mechanism behind being able to move articles through categories contained within a workflow without the need to have to manually edit and change the categorization accordingly. Additionally the number of articles within each category in the workflow should be identified so people can instantly recognise where potential bottlenecks are occuring for any instance of a workflow. To do this a parser function called   has been created which allows the article to become part of a specified sequence of "states" which can be quickly cycled through without needing to edit the containing article. Client side Javascript is used to update the parser function automatically and log the event in the Special:RecentChanges once a new state has been selected for more than a split second. Articles which are part of one or more such sequences (workflows) will exhibit extended catlinks information to show their current position within each workflow.

The extension also creates a special page called Special:Workflow which is still in development. It will allow various operations such as categorisation and updating workflow-state, to be performed on selections of articles. The current discussion, including a list of initially supported operations is at OrganicDesign:Special talk:Workflow.

Installation
To install this extension, copy OrganicDesign:Extension:.php and save into your extensions directory or in a subdirectory thereof. The file then needs to be included in your LocalSettings.php file as usual. Also, a new namespace must be created which all articles describing workflow lists should use. Here's an example configuration.

Usage
For examples of this extension see OrganicDesign:Todo / OrganicDesign:Emoticon examples.

Usage Syntax
The idea with the syntax is to enforce a solid convention for the way workflow is approached as an overall system rather than offer flexibility of syntax to suit many diverse uses. The general syntax is as follows:

The parameter represents the current state from the sequence specified in Workflow:Job, if it is not supplied, the first state in the list is assumed. This parameter is updated by the AJAX requests when the state is changed by the client-side JavaScript.

The article Workflow:Job contains a sequential bullet list of article titles each of which forms a specific phase in the workflow. The workflow extension is hard-wired to categorise the article into Category:Title (where "Title" is the currently selected state in the cycle), and to transclude Template:Title. Using the Category and Template name-spaces here is not optional, it is designed to enforce a consistent method usage of the workflow system which is extremely important when using a wiki for organisation. In the example above, the content of Workflow:Job might be as follows: Each of the titles in the list should have a corresponding article in the Category and Template namespaces, if they're missing, they'll show up as red links in the catlinks information so they can easily be created. Also they should have an article in the Main namespace (which will show as red links in the Workflow article if not) which talks about that workflow phase as a concept.
 * Lead
 * Quote
 * In progress
 * Complete
 * Invoiced
 * Paid

By using the Workflow namespace, and enforcing the strict use of Category and Template with that title (in a similar way to how the MediaWiki software uses the Talk namespace in specific way) it allows us to later extend the way other namespaces are used with workflow items, for example to allow phases to contain automation scripts, unit tests or other context-specific meta-data.

CSS Styles
The default format of a workflow is to transclude the article of the current state inside a container which shows the title of the current state linking to the template, and on each side of that a button for shifting the state one forward or backward in its sequence. The style of this container is determined by CSS rules which can be added to your wiki's main.css file, or to the MediaWiki:Common.css article. The ones we use which look render the container shown in the image above are as follows:

Change log

 * Version 0.0.12 (2007-10-27): Ready for use and testing.