Commit 119cc046 authored by Jérome Perrin's avatar Jérome Perrin

Reraise ValidationFailed, they should be catched by calling scripts.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5494 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f93f2df0
......@@ -117,6 +117,7 @@ def DCWorkflowDefinition_executeTransition(self, ob, tdef=None, kwargs=None):
sci = None
econtext = None
moved_exc = None
validation_exc = None
# Figure out the old and new states.
old_sdef = self._getWorkflowStateOf(ob)
......@@ -194,7 +195,12 @@ def DCWorkflowDefinition_executeTransition(self, ob, tdef=None, kwargs=None):
tool.setStatusOf(self.id, ob, status)
sci = StateChangeInfo(
ob, self, status, tdef, old_sdef, new_sdef, kwargs)
sci.setWorkflowVariable(ob, workflow_id=self.id, error_message = before_script_error_message)
# put the error message in the workflow history
sci.setWorkflowVariable(ob, workflow_id=self.id,
error_message = before_script_error_message)
if validation_exc :
# reraise validation failed exception
raise validation_exc
return new_sdef
# Update state.
......@@ -202,11 +208,6 @@ def DCWorkflowDefinition_executeTransition(self, ob, tdef=None, kwargs=None):
tool = aq_parent(aq_inner(self))
tool.setStatusOf(self.id, ob, status)
# Make sure that the error message is empty. # Why ?
#sci = StateChangeInfo(
# ob, self, status, tdef, old_sdef, new_sdef, kwargs)
#sci.setWorkflowVariable(ob, error_message = '')
# Update role to permission assignments.
self.updateRoleMappingsFor(ob)
......
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