This plugin is a rewrite of the TWiki:Plugins.WorkflowPlugin by TWiki:Main.ThomasWeigert, which supports much the same functionality except a couple of the macros (%WORKFLOWLASTTIME_State%
, %WORKFLOWLASTVERSION_State%
) and the use of TWikiForms in states. However, it does support concurrent reviewing and notifications on state change, which is not supported by the Workflow plugin. It was decided to spin this off seperatly as it is not backwords compatible.
This plugin only applies if the topic is under approval control. This means the preference setting APPROVALDEFINITION
must be set. This should point to a topic that describes the approval flow (the approval definition topic).
The approval definition topic must contain one state table and one transition table. The state table must be before the transition table. Both tables are described below.
The state table must come before the transition table, and has three columns:
State | Allow Edit | Message |
---|---|---|
REJECTED | This document is waiting to be sent to the Stage Reviewers for review. | |
WAITINGFORREVIEW | Main.UserTwo, Main.UserThree | This document is waiting to be reviewed by the Stage Reviewers. |
REVIEWED | This documented has been reviewed. It is now waiting to be sent to the Stage Approvers for approval. | |
WAITINGFORAPPROVAL | Main.UserTwo, Main.UserThree | This document is waiting to be approved by the Stage Approvers. |
APPROVED | Main.UserOne | This document has been approved! No more actions can be carried out on this document. |
Each row in the table defines a state where:
%SEARCH%
, %INCLUDE%
, etc), and
In our example we have defined five states. REJECTED is the default state, as it is first in the table.
Everyone is allowed to edit the topic in the REJECTED or the REVIEWED state. WAITINGFORREVIEW and WAITINGFORAPPROVAL are resricted to Main.UserTwo and Main.UserThree, and APPROVED is rescrited to just Main.UserOne.
Note: Admins will always be able to edit the topic, as with any topic in TWiki.
The transition table consists of five columns, and an example is shown below:
State | Action | Next State | Allowed | Notify | Sign Off's (%) |
---|---|---|---|---|---|
REJECTED | Send For Review | WAITINGFORREVIEW | Main.UserOne | yes | |
WAITINGFORREVIEW | Reviewed | REVIEWED | Main.UserTwo, Main.UserThree, Main.UserFour | 50% | |
WAITINGFORREVIEW | Rejected | REJECTED | Main.UserTwo, Main.UserThree, Main.UserFour | 0% | |
REVIEWED | Send For Approval | WAITINGFORAPPROVAL | Main.UserOne | ||
WAITINGFORAPPROVAL | Approved | APPROVED | Main.UserTwo, Main.UserThree, Main.UserFour | 50% | |
WAITINGFORAPPROVAL | Rejected | REJECTED | Main.UserTwo, Main.UserThree, Main.UserFour | 0% |
Each row in this table defines a transition from one state to another state:
%SEARCH%
, %INCLUDE%
, etc),
The example defines the flow as pictured to the right. When the topic is in either the 'REJECTED' state or the 'REVIEWED' state, only Main.UserOne can push the topic through to the next state. If the topic is in the state 'WAITINGFORREVIEW', there will be two actions that can be carried out on the topic. The first is 'Reviewed', which pushes the topic into the 'REVIEWED' state. This has a sign off percentage of 50%, which in this case requires two of the users to review this state before the topic can go to the 'REVIEWED' state. The second action is 'Rejected', which only requires one person to push the topic back to the 'REJECTED' state. This is the same situation for 'WAITINGFORAPPROVAL'.
When the state of the topic is changed from 'REJECTED' to 'WAITINGFORREVIEW', an email notification will be sent to Main.UserTwo, Main.UserThree and Main.UserFour, letting them know that the state has changed and that they are next to approve the state. A copy of the email will also be sent to Main.UserOne, and to anyone listed in the ADDITIONALNOTIFY
preference (see ApprovalPlugin#Preferences).
Note: Admins may disable all notifications by setting the $TWiki::cfg{Plugins}{ApprovalPlugin}{DisableNotify}
setting to 1
.
The ADDITIONALNOTIFY
preference can also be set in the definition topic. This can be a comma-seperated list of people who should be notified on each state change (if the 'Notify' column contains a 'yes'). For example:
You may also set your own preferences in the definition topic, which can be referenced in the controlled topic by using %APPROVAL{"pref" name="..."}%
. For example, in the definition topic set:
You can then use %APPROVAL{"pref" name="APPROVALNOTICE"}%
in any topic under control.
The controlled topic must have the APPROVALDEFINITION
set to a approval definition topic (see ApprovalPlugin#The_Approval_Definition_Topic).
As well as the APPROVALDEFINITION
setting, the topic may also contain the APPROVALHISTORYFORMAT
setting. The defines the format of the history, which is updated after each state change. This may also be set in a WebPreferences topic, or in TWikiPreferences. The format will expand the variables $state
, $wikiusername
, $date
, $quot
and $n
, with the same meaning as in FormattedSearch. The default setting is:
The plugin will expand any %APPROVAL{"action"}%
tags found in the controlled topic. The tag must have one of the actions listed below:
Parameters | Comment |
---|---|
"statemessage" |
This will display the message for the current state, as defined in the state table. |
"transition" |
Displays the transition form, which is used to change the state. |
"history" |
Displays the approval history of the topic. |
"pref" name="..." |
Displays the named preference set in the approval topic (see ApprovalPlugin#Preferences). |
"reviewedby" |
Shows who has already reviewed the current state. |
There is an example of an approval definition topic and a document under control in the Sandbox web. The links are below:
Note The examples will only work if the plugin is installed and enabled.
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running.
Like many other TWiki extensions, this module is shipped with a fully automatic installer script written using the BuildContrib.
configure
interface (Go to Plugins->Find More Extensions) .zip
or .tgz
archives
perl <module>_installer
)
configure
and enable the module, if it is a plugin.
,v
files in your existing install (take care not to lock the files when you check in)
File: | Description: |
---|---|
data/TWiki/ApprovalPlugin.txt |
Documentation |
data/Sandbox/ControlledTopicExample.txt |
Example controlled topic |
data/Sandbox/ApprovalDefinitionExample.txt |
Example definition topic |
lib/TWiki/Plugins/ApprovalPlugin.pm |
Perl module |
lib/TWiki/Plugins/ApprovalPlugin/Approval.pm |
Perl Module |
lib/TWiki/Plugins/ApprovalPlugin/State.pm |
Perl Module |
lib/TWiki/Plugins/ApprovalPlugin/Transition.pm |
Perl Module |
lib/TWiki/Plugins/ApprovalPlugin/Config.spec |
Spec file for configure |
templates/approvalnotify.tmpl |
Notification template |
tools/convert.pl |
Coverts topics from TWiki:Plugins.WorkflowPlugin to the ApprovalPlugin (see comments in script) |
pub/TWiki/ApprovalPlugin/ApprovalFlow.png |
Approval flow diagram |
Plugin Author(s): | TWiki:Main.AndrewRJones |
Copyright: | © 2007-2009 TWiki:Main.AndrewRJones © 2008-2010, TWiki:TWiki.TWikiContributor |
License: | GPL (Gnu General Public License) |
Plugin Release: | 1.0 |
Plugin Version: | 19415 (2010-09-01) |
Change History: | |
2010-09-01: | TWikibug:Item6530: Doc improvements; changed TWIKIWEB to SYSTEMWEB |
01 Apr 2009 | Released as 1.0 |
03 Feb 2009 | Small doc changes; tested on TWiki |
30 Oct 2008 | Small improvements, better code |
12 Sep 2008 | Initial version |
Dependencies: | None |
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/ApprovalPlugin |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/ApprovalPluginDev |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/ApprovalPluginAppraisal |
Related Topics: TWikiPreferences, TWikiPreferences, TWikiPlugins
I | Attachment | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|
![]() |
ApprovalFlow.png | manage | 20.5 K | 01 Sep 2010 - 06:15 | TWikiAdminGroup | Saved by install script |