[Zope-CMF] DCWorkflow question

Dieter Maurer dieter@handshake.de
Wed, 20 Mar 2002 20:26:28 +0100


Bert Vanderbauwhede writes:
 > I'm trying to implement a workflow where the creator of a document is
 > (automatically) warned by e-mail that the document will expire within a
 > certain amount time. I've tried to do this by adding a transition to the
 > 'published' state, with following properties:
 > - Destination state: (remain in state)
 > - Trigger type: automatic
 > - Script (before): mail_expiration (this script sends the mail)
 > - Guard expression: python:container.check_expiration(here) (this checks
 >     whether the expiration date is approaching)
 > 
 > But it doesn't work. What am I doing wrong? Is there anyone who has done a
 > thing like this before?
The stock Zope does not have a timer that can automatically activate
objects.

Under Unix, you can use Xron to periodically check for things to do,
or you can use an external periodic script to check for work
and execute it.

 > Another question: there is a trigger type 'initiated by WorkflowMethod'.
 > What does this do?
It's the workflow integration for direct method calls. This is one
use case:

     You have objects with an "edit" method.

     "edit" should only be possible, when the object is in specific
     workflow states and in these cases, the state should be
     affected by calling "edit".

     You solve this, by wrapping the "edit" method in
     a "WorkflowMethod". It will check whether the state
     is acceptable and later advance the state as specified
     by the corresponding transition.


Dieter