[Zope-CMF] programmatically change workflow state

Florent Guillaume fg@nuxeo.com
15 Aug 2001 11:16:28 GMT


I have a product that's in essence a workflow-aware folder (this part is
pretty easy to achieve), whose children must have a workflow state
slaved to the folder's workflow state. So when the folder goes private,
all children go private, same thing for other states.

I use DCWorkflow and a transition script that gets called when the
folder changes state. The script then calls a method in the product,
passing in the workflow, and the method recurses on the children and
calls wf._changeStateOf on them. I also think I'll have to reindex the
children because that's something the WorkflowTool usually does.

Does this look correct ? It's a bit DCWorkflow-centric unfortunately,
because WorkflowTool doesn't expose any method to force a state change.


I tried to play with WorkflowMethod (formerly WorkflowAction) but I
didn't find a way to apply it to my problem.


Thanks,

Florent Guillaume
Nuxeo