[Zope-CMF] Re: DCWorkflow + Acqusition

Florent Guillaume fg at nuxeo.com
Mon Oct 24 09:47:43 EDT 2005


Victor Safronovich wrote:
> Hello Dieter Maurer,
> 
> Thursday, October 20, 2005, 1:44:27 AM, you wrote:
> 
> DM> Victor Safronovich wrote at 2005-10-17 13:10 +0600:
> 
>>>...
>>>By the way i think code:
>>>       for w in wfs:
>>>           w.notifySuccess(ob, action, res)
>>>       if reindex:
>>>           self._reindexWorkflowVariables(ob)
>>>in  _invokeWithNotification should be turn upside-down to:
>>>       if reindex:
>>>           self._reindexWorkflowVariables(ob)
>>>       for w in wfs:
>>>           w.notifySuccess(ob, action, res)
>>>am i right?
> 
> 
> DM> Why do you think so?
> 
> DM>   I find the original order more natural (in case "notifySuccess"
> DM>   would change some workflow variables).
>    My  product  used  DCWorkflow  in  a  wrong way. It is override notifySuccess
>    method  and  called many scripts in this method, instead of adding before and
>    after   scripts  to  transition.  And to my product it is necessary ( i think
>    because  of  allowedRolesAndUsers  index  )  that  ob  must be reindexed before
>    notifySuccess was called.

Yes that's a legitimate use case. Note that I have opened 
http://www.zope.org/Collectors/CMF/389 about this.

>    By  the  way  is  it  correct  to skip ObjectMoved, ObjectDeleted errors from
>    notifyBefore, notifySuccess, notifyException  methods in
>    _invokeWithNotification method?

They're not skipped, they're treated specially. These exceptions are the way 
for transition code to notify the caller that something happened to the 
underlying object.

Florent

-- 
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