Commit 18c5463d authored by wenjie.zheng's avatar wenjie.zheng Committed by Sebastien Robin

Workflow.py: fix the converted workflow history missing action title.

parent 4efc49d6
...@@ -635,6 +635,7 @@ class Workflow(IdAsReferenceMixin("workflow_", "prefix"), XMLObject): ...@@ -635,6 +635,7 @@ class Workflow(IdAsReferenceMixin("workflow_", "prefix"), XMLObject):
# update variables # update variables
state_values = None state_values = None
object = self.getStateChangeInformation(document, self.getSourceValue())
if new_sdef is not None: if new_sdef is not None:
state_values = getattr(new_sdef,'var_values', None) state_values = getattr(new_sdef,'var_values', None)
if state_values is None: if state_values is None:
...@@ -660,11 +661,11 @@ class Workflow(IdAsReferenceMixin("workflow_", "prefix"), XMLObject): ...@@ -660,11 +661,11 @@ class Workflow(IdAsReferenceMixin("workflow_", "prefix"), XMLObject):
# Preserve former value # Preserve former value
value = former_status[id] value = former_status[id]
else: else:
if vdef.default_expr is not None: if vdef.getDefaultExpr() is not None:
expr = vdef.default_expr expr = vdef.getDefaultExpr()
else: else:
value = vdef.default_value value = vdef.getInitialValue(object=object)
if expr is not None: if expr is not None and expr != '':
# Evaluate an expression. # Evaluate an expression.
if econtext is None: if econtext is None:
# Lazily create the expression context. # Lazily create the expression context.
...@@ -676,10 +677,7 @@ class Workflow(IdAsReferenceMixin("workflow_", "prefix"), XMLObject): ...@@ -676,10 +677,7 @@ class Workflow(IdAsReferenceMixin("workflow_", "prefix"), XMLObject):
econtext = Expression_createExprContext(sci) econtext = Expression_createExprContext(sci)
expr = Expression(expr) expr = Expression(expr)
value = expr(econtext) value = expr(econtext)
if id_no_suffix == "action": status_dict[id_no_suffix] = value
status_dict[id_no_suffix] = '_'.join(value.split('_')[1:])
else:
status_dict[id_no_suffix] = value
# Do not proceed in case of failure of before script # Do not proceed in case of failure of before script
if not before_script_success: if not before_script_success:
......
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