Item10007: Implement initial state and transition for workflow-controlled topics

pencil
Priority: Enhancement
Current State: Needs Developer
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: WorkflowPlugin
Branches:
Reported By: AaronFuleki
Waiting For:
Last Change By: CrawfordCurrie
It would be very, very, very nice to have a state transition that fires when topics are first put under workflow control. The form and notification functions of workflow transitions are very powerful, and many workflows need them at their first state, just as much (if not more) than at later states.

As noted in Support.Question689, workflow-controlled topics really don't get all of the benefits of workflow control until they experience their first state transition. At that point META:WORKFLOW.name is assigned a value, a form can be attached, and notifications can be fired off.

We've worked around this with all kinds of creative solutions, cron jobs, etc., but it would make a lovely standard feature.

Perhaps this could be made option by just using reserved keywords for the pre-created state and the transition that fires on creation (make those prefs in case someone was already using those names in one of their workflows). If your transition table describes a transition from the reserved, faux-creation state to the first real state listed in your state table, then you get the "creation" transition. If not, the plugin behaves as it always has.

-- AaronFuleki - 11 Nov 2010

I second this need. Thanks for documenting this Aaron, I can take it off my todo list.

Another possible way to add control is to allow a transition state to be fired off via a URL so that redirectto can be used to modify state after creating a topic.

-- KiltBear - 26 Jan 2011

We're currently faking it by overriding the view template to check the workflow state, and then using some javascript to submit the workflow transition form, with help text in case that fails or javascript isn't available.

It's pretty kludgey, but it works for now. We've seen one or two cases where users have done a double submit on accident, so I may scrape together some jQuery that tries to prevent that.

Overall, it would just be all kinds of awesome if a transition event could fire when topics enter workflow control. At last count, about 80% of our current use cases require this.

-- AaronFuleki - 27 Jan 2011

It would be extremelly usefull. It would elliminate an (unnecessary) stage in the workflow.

-- StefanosKouzof - 01 Feb 2011

To document my workaround and save folks the time:

  1. the template topic for the app has the %META:WORKFLOW{name="NEW" LASTTIME_NEW="0000-00-00 - 00:00" LASTTIME_WAIT="0000-00-00 - 00:00"}% embedded in it
  2. I run the following quick and dirty shell script every hour


#!/bin/bash
cd /blahblahblah/foswiki/data/SomeWeb/
NEWPRODS=`fgrep -l 'META:WORKFLOW{name="NEW"' TVP0*.txt`
for newprod in $NEWPRODS
do
   newprod2=`basename $newprod .txt`
   curl -u -s user:password https://my.complete.tld/bin/rest/WorkflowPlugin/changeState \
    -d topic=SomeWeb.$newprod2 \
    -d WORKFLOWACTION=Some%20Action%20%perform \
    -d WORKFLOWSTATE=NEW
done

-- KiltBear - 04 Feb 2011

Sounds reasonable. Needs a developer to do it properly.

-- Main.CrawfordCurrie - 24 Nov 2017 - 10:27
 

ItemTemplate edit

Summary Implement initial state and transition for workflow-controlled topics
ReportedBy AaronFuleki
Codebase
SVN Range
AppliesTo Extension
Component WorkflowPlugin
Priority Enhancement
CurrentState Needs Developer
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r6 - 24 Nov 2017, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy