[Zope-CMF] programmatically change workflow state
Tres Seaver
tseaver@zope.com
Mon, 27 Aug 2001 07:33:48 -0400
Gitte Wange wrote:
> On Wednesday 15 August 2001 13:25, Florent Guillaume wrote:
>
>>>Does this look correct ? It's a bit DCWorkflow-centric unfortunately,
>>>because WorkflowTool doesn't expose any method to force a state change.
>>>
>>Oops, I just found WorkflowTool.setStatusOf ... I guess it answers this
>>part of the question :-)
>
> I just tried this because I am attaching a memer picture for each member. And
> it want it to have status=pending when it has been added (so the members
> don't have to find the picture object themselves and submit it).
>
> But there are no pending reviews afterwards and when I try to view the
> picture object I get an error.
>
> So .. any good hints??
>
> All I have done was to change the security of the method setStatusOf in the
> WorkflowTool module (from private to public) and then call it.
> Something I have missed ?
'setStatusOf' was private because it was intended to be called
only by other "machinery"; you likely want 'doActionFor', passing
the "transition name", as 'setStatusOf' is supposed to pass more
data than you are probably using.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com