[Zope-CMF] Re: A better CMFworkflow

Phillip J. Eby pje@telecommunity.com
Mon, 09 Jul 2001 12:14:18 -0500


At 06:53 PM 7/9/01 +0200, Ulrich Eck wrote:
>
>I can still not relly figure out how this should work, if e.g. something
>depends
>on some other part of the workflow to be finished, if these parts in
>different
>workflows (A document and a corresponding news-item for example, where
>the news-item can only or must be created when the Document is published)

This is what "guard" expressions are for.  You can create scripts in the
script part which check for these things to exist, and return a true or
false value that can be used in a transition guard.

However, since nothing happens to a workflow-covered object unless a
transition/action is initiated, you may need to have all objects
participating in a workflow perform a "nudge" action on each other when
they change.  That is, sub-workflow transitions should include a call to an
action on the parent workflow instance, so that the parent's guard rules
have a chance to trigger.

You might literally make a workflow transition called "nudge" or "poll",
which does nothing to the current workflow state.  The idea is that nudging
has no effect, but any "automatic" transitions from the current state will
automatically occur afterwards.  (Actually, there may exist an API in
DCWorkflow to do this without making a fake transition, but I'm not aware
of it.)

Alternatively, you can put the rules about how the parent workflow should
progress into the child workflow, but it's probably not generally a good
idea since usually one wants to share child workflow schemas among multiple
parent workflow schemas, and thus the child does not/should not know how
the parent workflow operates, except that it is part of one.