Commit d321b9d4 authored by Julien Muchembled's avatar Julien Muchembled

DCWorkflowDefinition_executeTransition: small optimization

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40423 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0c404f39
...@@ -401,15 +401,15 @@ def DCWorkflowDefinition_executeTransition(self, ob, tdef=None, kwargs=None): ...@@ -401,15 +401,15 @@ def DCWorkflowDefinition_executeTransition(self, ob, tdef=None, kwargs=None):
self.updateRoleMappingsFor(ob) self.updateRoleMappingsFor(ob)
# Execute the "after" script. # Execute the "after" script.
if tdef is not None and tdef.after_script_name: script = getattr(tdef, 'after_script_name', None)
if script:
# Script can be either script or workflow method # Script can be either script or workflow method
#LOG('_executeTransition', 0, 'new_sdef.transitions = %s' % (repr(new_sdef.transitions))) #LOG('_executeTransition', 0, 'new_sdef.transitions = %s' % (repr(new_sdef.transitions)))
if tdef.after_script_name in filter(lambda k: self.transitions[k].trigger_type == TRIGGER_WORKFLOW_METHOD, if script in new_sdef.transitions and \
new_sdef.transitions): self.transitions[script].trigger_type == TRIGGER_WORKFLOW_METHOD:
script = getattr(ob, convertToMixedCase(tdef.after_script_name)) getattr(ob, convertToMixedCase(script))()
script()
else: else:
script = self.scripts[tdef.after_script_name] script = self.scripts[script]
# Pass lots of info to the script in a single parameter. # Pass lots of info to the script in a single parameter.
sci = StateChangeInfo( sci = StateChangeInfo(
ob, self, status, tdef, old_sdef, new_sdef, kwargs) ob, self, status, tdef, old_sdef, new_sdef, kwargs)
......
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