Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item14210: allow override of reminder template by a local topic templ…
…ate. Run as admin user to overcome permission limitations (OK for a cronned task). Add some doc.
  • Loading branch information
cdot committed Jan 20, 2017
1 parent 1a1fa4f commit 22ae343
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion data/System/WorkflowPlugin.txt
Expand Up @@ -14,7 +14,7 @@ For example,
* In a defect tracking data base, defects typically transition through a series of states, from submission to resolution, with different actions available depending on the state of the defect.
* In a journal database, papers must be reviewed and approved by several experts in the field before being allowed to be published.

<nop>WorkflowPlugin lets you associate a state with a topic and then control what other states that the topic can move to. You can define a set of _states_ for controlled topics (e.g. "under revision", "waiting for approval", "approved") and _transitions_ (e.g. "revise", "approve") between these states. Furthermore, you can define which users/groups are permitted to perform specific transistions.
<nop>WorkflowPlugin lets you associate a state with a topic and then control what other states that the topic can move to. You can define a set of _states_ for controlled topics (e.g. "under revision", "waiting for approval", "approved") and _transitions_ (e.g. "revise", "approve") between these states. Furthermore, you can define which users/groups are permitted to perform specific transitions, and generate mail notifications whenever a topic state changes. You can also generate reminders when a topic has been stuck-at a state for longer than a certain time.

A workflow can be associated with a single topic, or with an entire web.

Expand Down Expand Up @@ -173,6 +173,11 @@ A common requirement is to report on the status of topics that are in different
%SEARCH{"META:WORKFLOW.name='APPROVED'" type="query"}%
</verbatim>

---++ Stuck-At Reminders
You may want to be able to issue a notification is a topic is stuck in a state for longer than a given time, to keep the workflow moving. For this the plugin provides the =tools/workflowremind= perl script, which is run on the server - either manually, or using a =cron= job. To find out how this is used, change to the =tools= directory on the server and =perl workflowremind= with no parameters.

The mail sent by this script uses a special template, =templates/mailworkflowremind.tmpl=. You can override this by providing a template topic called =WorkflowRemindTemplate= in the web where the transitioned topic resides.

---++ History and Acknowledgements

This plugin was motivated by [[Foswiki:Main.ThomasWeigert][Thomas Weigert]]'s [[Foswiki:Extensions.WorkFlowAddOn][WorkFlowAddOn]] and its first version (then called !ApprovalPlugin) was written by Thomas Hartkens, albeit it was focused on document approval and control. [[Foswiki:Main.ThomasWeigert][Thomas Weigert]] then merged the functionality of the [[Foswiki:Extensions.WorkFlowAddOn][WorkFlowAddOn]] into this plugin.
Expand Down
6 changes: 4 additions & 2 deletions lib/Foswiki/Plugins/WorkflowPlugin/Mither.pm
Expand Up @@ -27,7 +27,8 @@ my %workflows;
sub mither {
my %options = @_;

my $session = new Foswiki();
# Always run as admin
my $session = new Foswiki( $Foswiki::cfg{AdminUserLogin} );

# Assign SESSION so that Func methods work
$Foswiki::Plugins::SESSION = $session;
Expand Down Expand Up @@ -189,7 +190,8 @@ sub renotifyTransition {
my $currentweb = undef;
my $currenttopic = undef;

my $text = Foswiki::Func::loadTemplate('mailworkflowmither');
my $text = Foswiki::Func::loadTemplate('WorkflowRemindMail')
|| loadTemplate('mailworkflowmither');

my $tofield = join( ', ', @emails );

Expand Down

0 comments on commit 22ae343

Please sign in to comment.