[Zope-CMF] [DCWorkflow] active workflows

Dieter Maurer dieter at handshake.de
Fri Jan 7 08:26:33 EST 2005


I have a need for "active" workflows, i.e. workflows where transitions
can happen automatically after some time has expired.
I plan to extend DCWorkflow to support this.

Currently, my concept looks like this:

  States are extended by optional scripts "script_on_entry"
  and "script_on_exit".

  If defined, "script_on_entry" is executed when a transition
  enters the state (after the transition's 'script_after').

  If defined, "script_on_exit" is executed when a transition
  leaves the state (before the transition's 'script_before').

I plan to use this extension as follows to implement an
"active" state:

  Such a state has
  
   * variables "initial_delay" and "repeated_delay",

   * a special transition "probe" that remains in state and
     has a "script_before" "reschedule"

   * a "script_on_entry" "schedule" and a "script_on_exit"
     "unschedule"

   * at least one automatic transition that can leave the state

  The "*schedule" scripts use a scheduling service to
  schedule the "probe" transition after
  "initial_delay" (for 'schedule') and 'repeated_delay' (for 'reschedule').
  'unschedule' cancels the scheduling request.

  The scheduling service calls "probe" at the given time.
  This reschedules and then checks for automatic
  transitions. If one is electable and leaves the state,
  the schedule request is canceled.


What do you think about this approach?


Is the DCWorkflow extension interesting enough to become
part of the official sources?


-- 
Dieter


More information about the Zope-CMF mailing list