[Zope-CMF] Query about DCWorkflow

John Morton jwm@plain.co.nz
Wed, 26 Jun 2002 13:54:47 +1200


On Tue, 25 Jun 2002 05:08, mcolli@SyscomCipher.com.ar wrote:
> Hi,
>
> I have installed DCWorkflow product and I have seen the examples available
> but when I try to create my own workflow from one existing I can not define
> some of the things as appear in the examples: For example the 'destination
> state' when you define a transition. Is there any place I should go in
> order to define this kind of things?.

The destination state pulldown menu for a particular transition will list all 
the states you've already defined under the states tab for the workflow.

Here's how I generally go about putting together a new workflow:

1) Draw up a state diagram with the notes as states and the arcs as 
transitions. I usually do this on paper, then do a good copy in dia or some 
other diagram tool, so I have an image to go with the documentation. I 
usually spot several corner cases in the process.

2) Start by creating an example DCworkflow, rather than a new one, as it's 
faster to delete all the states and transitions than it is to create all the 
standard review_state variables.

3) In the permissions tab, select all the permissions that you want the 
workflow to govern.

4) Define any extra variables that you need.

5) Set up the states for your workflow, one for each node in your state 
diagram. Try to stick to the standard names for a publication workflow, as 
some badly behaved products have states like 'published' hardcoded into
their searches (ie CalendarTool, last I looked). Set up the permissions on 
the states now, as well. I find that using aquisition for the site visible 
states, and using explicit permissions for the private and interim states 
works well. Reviewer roles should either have view permissions on every state 
or you should change the appropriate skins to take them somewhere sensible 
after a transtion or they'll end up with an ugly access denied page after 
sending some content back to private state.

6) Set up any scripts that you'll need for transtions - pre and post 
transition scripts and ones to handle complex guard conditions. Just set up 
skeletons for now, if you haven't though through all the details.

7) Create your transtions from all the arcs on your state diagram. You should 
be able to pick the right destination state as all your states are already 
defined, and set up the right scripts to run, as you've defined those as 
well. It's worth noting that the guards are or'ed - if any guard matches, the 
transition can occur. You can specify more than one permission, role or 
expression by seperating them with a semicolon.

That about covers it. By working in this order, you tend to step through the 
creation process one tab at a time, rather than switching back and forth. I 
find it tends to be faster and less confusing that way.

John