[Zope-CMF] More DC workflow questions

John Morton jwm@plain.co.nz
Wed, 15 May 2002 19:23:15 +1200


On Tuesday 14 May 2002 06:14, Florent Guillaume wrote:
> John Morton  <jwm@plain.co.nz> wrote:
> > But I'm still confused about when it all happens, and other things
> > related to workflows:
> >
> >  - When are the so called 'automatic' transitions triggered, and in what
> > order are they processed?
>
> They are checked and triggered after an other transition has been
> followed. So to start the whole process you need a manual transition or
> a workflow method.

After - that makes sense. What order do they get processed in? I expect it 
would be sorted on the id if anything.

> >  - What are 'WorkflowMethod' trigger?
>
> A workflow-wrapped method is a normal method that has the side effect of
> executing a workflow transition (or raising Unauthorized if the guard
> fails).
>
> You get one using for instance:
>         from Product.CMFCore.WorkflowCore import WorklflowMethod
>         def blah(...):
>             ...
>         blah = WorkflowMethod(blah)

That looks like the approach I should use for the link checking method, as I'd 
rather not expose it all the way out to the action box. So can I assume any 
method wrapped in the WorkflowMethod call will trigger all the WorkflowMethod 
triggered transitions on an object in a given state? Again, what order are 
several WorkflowMethod transitions processed in?

> >  - When do scripts execute? What happens if they fail and raise an
> > exception?
>
> That depends on the kind of script. Before- and after- transition
> scripts are executed just before or after a transition is followed.

I only see a single script field in the transitions form, so I assume I'm 
using an older version of DCworkflows. I'll browse the code...

> The
> difference between the two is that they take place before or after the
> new variables, permissions... are set.
>
> Scripts can also be called from an TAL expression in guards.
>
> If an exception other than a ObjectMoved or ObjectDeleted exception is
> raised, everything is aborted, like always.

Great. Thanks for the info.

John