[Zope-CMF] Re: [dev] WorkflowMethod (aka WorkflowAction)

Yuppie schubbe at web.de
Wed Oct 22 12:28:11 EDT 2003


Hi!


Florent Guillaume wrote:

>>In CMFDefault the WorkflowMethod machinery is broken in many ways:
>>
>>1.) Only a random selection of methods is wrapped:
>>Event.edit(), File.edit(), Image.edit(), Link.edit() and 
>>Document.setFormat()
> 
> 
> One could add other methods yet.

If 2.) is fixable and it makes sense at all.

>>2.) WorkflowMethod (=WorkflowAction) doesn't seem to work well with 
>>WebDAV. There are some comments like that:
>>         """
>>         used to be:  editMetadata = WorkflowAction(_editMetadata)
>>         Need to add check for webDAV locked resource for TTW methods.
>>         """
> 
> 
> Dunno.

I guess there was a reason to remove the wrappers. Does anybody know?

>>3.) WorkflowMethod doesn't seem to work well with Interfaces:
>>The wrapper modifies the interface so verifyClass doesn't work.
>>
>>4.) Some broken use cases were discussed in this thread:
>><http://mail.zope.org/pipermail/zope-cmf/2003-January/016843.html>
>>
>>Is there a way to fix that machinery (and does it make sense) or could 
>>we just remove the wrappers from the methods listed above?
> 
> 
> Note that Tres provided an important use case in
>   http://mail.zope.org/pipermail/zope-cmf/2003-January/017123.html
> which means that the current behavior has to stay.

To trigger the workflow machinery a simple notify method should be 
sufficient. Tres also mentioned the downside of hard-wired wrappers.

> The wrappers are meant to provide examples, CMFDefault is an example
> after all. Do they do any harm? It's very nice to get lists of 'edit'
> actions in the workflow history if you have an edit action designed
> for this.

Examples should work. The lessons you can learn from CMFDefault are:
- WorkflowMethods are cruft. If they are in your way, just remove the 
wrappers. (as done for the WebDAV changes)
- Add reindexObject() to your methods. "Wrapping your method as a 
WorkflowMethod no longer guarantees reindexing." (Well, if you have no 
workflow tool the wrapper will reindex your object a second time, but 
who wants to remove the workflow tool?)

I stumbled over WorkflowMethods while trying to understand the 
reindexing machinery. As mentioned here, the complexity added by 
WorkflowMethods could make sense:
<http://mail.zope.org/pipermail/zope-cmf/2001-June/007284.html>
The current implementation just adds useless and confusing complexity.

> On the other hand you could fix the methods that are not yet wrapped
> 
> What I'd do is add a new triggger type to DCWorkflow,
> TRIGGER_WORKFLOW_METHOD_MANDATORY, a new wrapper, and a way to deal with
> it from CMFCore...
> 
> In this way parametrization of the transition could be done simply from
> DCWorkflow, assuming the method is wrapped.

Well. For me it looks like an either-or decision. At least regarding 
reindexing. I'm not sure it's worth to fix WorkflowMethods.


Cheers,
	Yuppie






More information about the Zope-CMF mailing list