appy.gen: stop storing workflow task attribute '_v_appy_do' as a volatile attr in ZODB (renamed it '_appy_do'). It seems to be removed by a sub-transaction during a long transition.

This commit is contained in:
Gaetan Delannay 2011-03-02 09:37:03 +01:00
parent c7633ecc8b
commit 7294cc0c4d
2 changed files with 7 additions and 7 deletions

View file

@ -147,14 +147,14 @@ def do(transitionName, stateChange, logger):
doAction = False
if transition.action:
doAction = True
if hasattr(ploneObj, '_v_appy_do') and \
not ploneObj._v_appy_do['doAction']:
if hasattr(ploneObj, '_appy_do') and \
not ploneObj._appy_do['doAction']:
doAction = False
doNotify = False
if transition.notify:
doNotify = True
if hasattr(ploneObj, '_v_appy_do') and \
not ploneObj._v_appy_do['doNotify']:
if hasattr(ploneObj, '_appy_do') and \
not ploneObj._appy_do['doNotify']:
doNotify = False
elif not getattr(ploneObj.getTool().appy(), 'enableNotifications'):
# We do not notify if the "notify" flag in the tool is disabled.
@ -174,7 +174,7 @@ def do(transitionName, stateChange, logger):
if doNotify:
notifier.sendMail(obj, transition, transitionName, workflow, logger)
# Produce a message to the user
if hasattr(ploneObj, '_v_appy_do') and not ploneObj._v_appy_do['doSay']:
if hasattr(ploneObj, '_appy_do') and not ploneObj._appy_do['doSay']:
# We do not produce any message if the transition was triggered
# programmatically.
return

View file

@ -280,7 +280,7 @@ class AbstractWrapper:
# Set in a versatile attribute details about what to execute or not
# (actions, notifications) after the transition has been executed by DC
# workflow.
self.o._v_appy_do = {'doAction': doAction, 'doNotify': doNotify,
self.o._appy_do = {'doAction': doAction, 'doNotify': doNotify,
'doSay': False}
if not doHistory:
comment = '_invisible_' # Will not be displayed.
@ -289,7 +289,7 @@ class AbstractWrapper:
# object by consulting the target state of the last transition in
# this workflow_history.
wfTool.doActionFor(self.o, transitionName, comment=comment)
del self.o._v_appy_do
del self.o._appy_do
def log(self, message, type='info'): return self.o.log(message, type)
def say(self, message, type='info'): return self.o.say(message, type)