[Zope-CMF] Re: Zope 3 events from workflow
Martin Aspeli
optilude at gmx.net
Wed Dec 27 14:29:56 EST 2006
Sidnei da Silva wrote:
> On 12/27/06, Martin Aspeli <optilude at gmx.net> wrote:
>> Right - that was the question I was asking. *Is* this an event that's
>> useful outside the framework?
>
> I believe so. For example, a subscriber that wants to know if an
> action has succeeded, no matter where/when, so it can purge an
> external cache (hint, hint) will want to subscribe to
> 'IWorkflowActionSuccess', not to I{Before,After}TransitionEvent.
>
> It wants to know if the action succeded, not execute something
> before/after the action happens.
>
> It also wants to fire only when the action succeeds, not when an
> exception is raised.
Right.
> The more I think about it, the more I wish you do it as soon as
> possible. It wouldn't take you long, since you have it all in your
> head by now.
Where would this go?
My first patch (btw, anyone up for merging it?) was to DCWorkflow.
I could make another one to WorkflowTool, I guess, if you can suggest
where and what payload it needs (it's hardly difficult to fire an
event). We could fire from _invokeWithNotification() at just before (or
after) notifyBefore(), notifyException() and notifySuccess(), passing
the same parameters + 'w' (the workflow definition) as the first parameter.
I'd still keep them as separate patches that could be reviewed/merged
separately.
Martin
More information about the Zope-CMF
mailing list