Commit b108df4b authored by Jérome Perrin's avatar Jérome Perrin

remove useless call to updateState

do not catch ObjectMoved


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4034 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 506c2d65
......@@ -188,7 +188,6 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject):
a notifySuccess() or notifyException() can be expected later on.
The action usually corresponds to a method name.
'''
# LOG('InteractionWorflow.notifyBefore, ob',0,ob)
for t in self.interactions.values():
tdef = None
if t.trigger_type == TRIGGER_AUTOMATIC:
......@@ -210,11 +209,7 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject):
# Pass lots of info to the script in a single parameter.
sci = StateChangeInfo(
ob, self, former_status, tdef, None, None, kwargs=kw)
try:
script(sci) # May throw an exception.
except ObjectMoved, moved_exc:
ob = moved_exc.getNewObject()
# Re-raise after transition
security.declarePrivate('notifySuccess')
def notifySuccess(self, ob, action, result, args=None, kw=None):
......@@ -269,25 +264,19 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject):
value = expr(econtext)
status[id] = value
# Update state.
tool = aq_parent(aq_inner(self))
tool.setStatusOf(self.id, ob, status)
# Execute the "after" script.
# Execute "after" scripts
for script_name in tdef.after_script_name:
script = self.scripts[script_name]
# Pass lots of info to the script in a single parameter.
sci = StateChangeInfo(
ob, self, status, tdef, None, None, kwargs=kw)
try:
script(sci) # May throw an exception.
except ObjectMoved, moved_exc:
ob = moved_exc.getNewObject()
# Re-raise after transition
# Execute the "after" script.
# Execute "activity" scripts
for script_name in tdef.activate_script_name:
self.activate(activity='SQLQueue').activeScript(script_name, ob.getRelativeUrl(), status, tdef.id)
self.activate(activity='SQLQueue')\
.activeScript(script_name, ob.getRelativeUrl(), status, tdef.id)
security.declarePrivate('activeScript')
def activeScript(self, script_name, ob_url, status, tdef_id):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment