Extension:Workflow

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
Workflow

Release status: beta

WorkflowExtension.jpg
Implementation Parser function
Description Allows dynamic content areas called tags which can be switched between pre-selected states by clicking. The states can contain normal content such as images and categorisation links.
Author(s) Aran Dunkley (Nadtalk)
Last version 1.0.4 (2009-07-09)
MediaWiki >1.6.0
Database changes no
License GPL
Download Workflow.php
Example http://www.organicdesign.co.nz/Workflow_example
Check usage and version matrix; stats

The Workflow extension organizes 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.

Contents

The Workflow extension[edit]

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 {{#Workflow:Name|...}} 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.

Installation[edit]

To install this extension, copy OrganicDesign:Extension:Workflow.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.

$wgUseAjax = true; # Set this if you want the AJAX functionality to work (details below)

include("$IP/extensions/Workflow/Workflow.php");

Usage[edit]

For examples of this extension see OrganicDesign:Workflow example. The general syntax is as follows:

{{#Workflow:Emoticon
 | Smile    = [[Image:Face-smile.svg|75px]]
 | Sad      = [[Image:Face-sad.svg|75px]]
 | Wink     = [[Image:Face-wink.svg|75px]]
 | Kiss     = [[Image:Face-kiss.svg|75px]]
 | Surprise = [[Image:Face-surprise.svg|75px]]
}}

Each of the titles in the list should have a corresponding article in the Category, if they're missing, they'll show up as red links in the catlinks information so they can easily be created.

Watching workflow categories[edit]

The work items are being passed around through workflow categories as work is done and attention is required from different roles. The roles need to be able to watch the categories containing items requiring attention from them. For this reason we developed the CategoryWatch extension which allows roles to be notified by email when articles move in or out of their workflow categories.

Using workflows inside templates[edit]

Workflows can be put inside templates so that all articles that transclude the template exhibit the workflow automatically. This can be done without any changes to the syntax, but in some cases it may be more appropriate for the workflow state to be adjusted via a parameter in the template call rather than by directly updating the category links in the page. This can be done by adding template and parameter parameters as follows:

{{#Workflow:Emoticon|template=Emoticon|parameter=state
 | Smile    = [[Image:Face-smile.svg|75px]]
 | Sad      = [[Image:Face-sad.svg|75px]]
 | Wink     = [[Image:Face-wink.svg|75px]]
 | Kiss     = [[Image:Face-kiss.svg|75px]]
 | Surprise = [[Image:Face-surprise.svg|75px]]
}}

In this example, when the workflow state is changed, no category links will be added or removed, instead the state parameter will be changed in the Emoticon template call in the article.

CSS Styles[edit]

The style of the workflow container is determined by CSS rules which can be added to your wiki's MediaWiki:Common.css article. The ones we use which render the container shown in the image above are as follows:

.workflow {
        width: 100px;
        float: right;
        border: 2px solid #ccc;
        padding: 0;
        margin: 0;
}
.workflow table { width: 100% }
.workflow td { text-align: center }
.workflow-state #content {
        background: white;
        width: 100px;
        height: 80px;
        border-bottom: 2px solid #ccc;
        text-align: center;
        vertical-align: center;
        overflow: hidden;
}
.workflow-state #left,.workflow-state #right {
        width: 20px;
        height: 20px;
        background: #bbb;
        text-align: center;
}
.workflow-state #title {
        background: #ccc;
        text-align: center;
}
.workflow-state .menu a {
        font-size: 10pt;
        font-weight: bold;
        color: white;
        margin: 0;
}
#catlinks a, #catlinks b { padding: 0 5px; }
#catlinks a.current {
        background-color: #3D5270;
        color: white;
}

Ajax[edit]

The Workflow extension can use Ajax technology to allow forms or links to work asyncronously (i.e., not involving a page reload). The content in the server's response can be directed to replace a particular portion of the page identified by its id attribute. Workflow used to use the MooTools JavaScript framework for its Ajax functionality, but now it only requires the inbuilt MediaWiki Ajax functions. These must be enabled by setting $wgUseAjax to true in your LocalSettings.php file before the inclusion of Workflow, as in the following example.

$wgUseAjax = true;
include("$IP/extensions/Workflow/Workflow.php");

  • Note: Workflow ajax functionality requires a version of skins/common/ajax.js from at least MediaWiki 1.8.x.

To Do[edit]

  • Test new 1.0.0 code more thoroughly
  • Split code into i18n etc
  • Move into SVN

Change log[edit]

  • Version 1.0.4 (2009-07-09): Bug fixes by User:VitaliyFilippov
  • Version 1.0.0 (2008-12-01): Simplified usage, dropped namespace and allow to work in templates
  • Version 0.0.12 (2007-10-27): Ready for use and testing.

See also[edit]