[Zope-CMF] Re: [Zope-PTK] CMF Dogbowl: workflow Proposal

Shane Hathaway shane@digicool.com
Sun, 25 Mar 2001 00:32:09 -0500


Kent Polk wrote:
> The problem is that by the time getDefaultChainFor() is called,
> it's too late. For example, CatalogTool.catalog_object :
>     def catalog_object(self, object, uid):
>         # Wraps the object with workflow and accessibility
>         # information just before cataloging.
>         wf = getattr(self, 'portal_workflow', None)
>         if wf is not None:
>             vars = wf.getCatalogVariablesFor(object)
>         else:
>             vars = {}
>         w = IndexableObjectWrapper(vars, object)
>         ZCatalog.catalog_object(self, w, uid)
> 
> grabs the generic wf before getDefaultChainFor() is even called,
> wf.getCatalogVariablesFor() should call the request_workflow,
> but doesn't.

It does in theory.  WorkflowTool.getCatalogVariablesFor() calls
self.getWorkflowsFor() which calls getDefaultChainFor(), if necessary...
then WorkflowTool.getCatalogVariablesFor() calls
wf.getCatalogVariablesFor() for each workflow in the chain.  There may
be something wrong with the implementation, however.

Shane