Commit 8c18e991 authored by Nicolas Delaby's avatar Nicolas Delaby

Code optimisation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24190 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f5e3f2f4
......@@ -293,25 +293,25 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject):
value = expr(econtext)
status[id] = value
sci = StateChangeInfo(
ob, self, former_status, tdef, None, None, kwargs=kw)
# Execute the "after" script.
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, former_status, tdef, None, None, kwargs=kw)
script(sci) # May throw an exception
# Execute Before Commit
transaction = get_transaction()
for script_name in tdef.before_commit_script_name:
method = getattr(self, 'activeScript')
get_transaction().beforeCommitHook(method, script_name,
ob.getRelativeUrl(),
status, tdef.id, kw)
script = self.scripts[script_name]
transaction.beforeCommitHook(script, sci)
# Execute "activity" scripts
for script_name in tdef.activate_script_name:
self.activate(activity='SQLQueue')\
.activeScript(script_name, ob.getRelativeUrl(), status, tdef.id)
.activeScript(script_name, ob.getRelativeUrl(),
status, tdef.id, kw)
security.declarePrivate('activeScript')
def activeScript(self, script_name, ob_url, status, tdef_id, kwargs=None):
......
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