[Zope-CMF] Re: Workflow question

Tres Seaver tseaver at zope.com
Thu Jun 10 09:37:32 EDT 2004


Miles Waller wrote:
> Hi,
> 
> At the moment I have a simple private/publish workflow (not a 
> DCWorkflow, but on the filesystem).  Any user can edit anything that's 
> private, but once they press 'publish' it's locked: they or another user 
> must retract it before further changes can be made.  This all works 
> great, and in the workflow history you can see who retracted and 
> published it, and when.
> 
> However, I also want to record in the history each time the object is 
> changed.  So if User X edits something 5 times, then publishes it, the 
> history will show 5 edits and a publish.  An edit involves a call to the 
> object's 'edit' method, and I read in the list about how wrapping this 
> as a 'workflow method' could be used to do what I want, but then on the 
> same line how awful they were!!
> 
> So, does anyone know what the 'correct' way to go about doing this would 
> be?

Wrapping a "normal" edit method in a WorkflowMethod has two effects 
which occur on each invocation:

   - As you are hoping, it creates a workflow history record.

   - As you may not want, it triggers automatic workflow transitions.

WorkflowMethods are not as well tested as they should be, because we 
removed them from the "core" content objects, due to the overhead and
conceptual skew they induced (e.g., they muddle up responsibilities a
bit).

Another scheme would be to add code to your POST-handling skins which 
manually recorded the workflow history info.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com




More information about the Zope-CMF mailing list