[Zope-PTK] CMF Dogbowl: workflow Proposal

Kent Polk kent@goathill.org
17 Mar 2001 00:23:14 GMT


Ok Shane, I'm finally getting to the point of being able to answer
some of your questions regarding your workflow proposal at:
 http://cmf.zope.org/Members/hathawsh/workflow_proposal

As I mentioned, there are several new workflow objects that I'm
trying to implement, and I'm starting with 'RequestItem'. I see
this as a base class that is similar to a NewsItem except that it
adds a list of 'recipients' (for lack of a better name yet). What I
want is to follow your suggestion:

 - it should be possible to index objects based on their workflow
   status. This would allow the creation of "workflow queues", or
   user task lists.

Since I couldn't determine how to add a different sort of action
other than a review-* action, I thought I'd just try adding a
recipient list attribute to the RequestItem class (as with self.text
& self.description). However that doesn't appear to help much
because I can't get portal_catalog.searchResults() to provide the
new attribute with object returned by:

<dtml-let requestitems="portal_catalog.searchResults(meta_type='Request Item',
  sort_on='Date', sort_order='reverse', review_state='pending')">

I was considering how to hack 'recipients' into the cataloging but
that looks like a really bad way to do it. 'recipients' really needs
your:

 getCatalogVariablesFor(self, ob)
    Invoked by portal_catalog. Allows workflows to add variables
    to the catalog based on workflow status, making it possible to
    implement queues. Returns a mapping containing the catalog
    variables that apply to ob.

and

 listActions(self, info)
    Invoked by the portal_actions tool. Allows workflows to include
    actions to be displayed in the actions box. Object actions are
    supplied by workflows that apply to the object. Global actions
    are supplied by all workflows. Returns the actions to be
    displayed to the user.

Correct?

Now. This brings up the issue  of whether or not a RequestItem is
a document-sort-of-object, and whether its actions are review-*
actions.

I'm thinking that a RequestItem needs 
 ?-private,  (essentially the same as review-private)
 ?-pending,  (essentially the same as review-pending)
 ?-accepted, (corresponds loosely to review-published if you compare
              the Reviewer role to a hypothetical Recipient Role)

 ?-completed  Many workflow objects need to be retired. They don't
	      continue to exist as a document-sort-of-object does,
	      but shouldn't be deleted.  You simply don't want to
	      see them any more in your normal portal view.

However, it appears to me that review-* actions are pretty hard-coded
into the CMF at this point.

Comments?

BTW, being able to add discussions to a RequestItem is pretty cool. :^)
That stands to alleviate the old Return-Receipt-To problem.