[Zope-CMF] Re: DCWorkflow + Acqusition
Florent Guillaume
fg at nuxeo.com
Tue Oct 25 06:29:18 EDT 2005
Victor Safronovich wrote:
> Hello Florent Guillaume,
>
> Monday, October 24, 2005, 7:47:43 PM, you wrote:
>
> FG> They're not skipped, they're treated specially. These exceptions are the way
> FG> for transition code to notify the caller that something happened to the
> FG> underlying object.
>
> But what prevent to raise ObjectMoved, ObjectDeleted in
> nofityException, notifySuccess?
That's not what these methods are for. ObjectMoved and ObjectDeleted are
designed to be raised by workflow scripts, during the transition, to inform
the workflow machinery that the transition left the object in an unexpected
place.
notifySuccess marks the end of the transition, and is designed similarly to
an event mechanism, to inform interested parties that the transition is
complete. If it raises exceptions, then they won't be caught.
Florent
I.e. DCWorkflowDefinition.notifyCreated
> swallow ObjectDeleted, ObjectMoved. Why?
> if ObjectMoved raised in DCWorkflowDefinition.notifyCreated,
> WorkflowTool.notifyCreated doen`t know about that, and
>
> def notifyCreated(self, ob):
>
> """ Notify all applicable workflows that an object has been created
> and put in its new place.
> """
> wfs = self.getWorkflowsFor(ob)
> for wf in wfs:
> wf.notifyCreated(ob)
> self._reindexWorkflowVariables(ob) <<-- ob reindexed in a wrong
> acquisition wrapper.
>
--
Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com
More information about the Zope-CMF
mailing list