Commit 192ed5d4 authored by wenjie.zheng's avatar wenjie.zheng Committed by Sebastien Robin

WorkflowTool.py: add variable's expression as getReference iff when variable...

WorkflowTool.py: add variable's expression as getReference iff when variable is action and it has a default_expr.
parent 1dd1f64f
...@@ -479,16 +479,17 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -479,16 +479,17 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
variable.setReference(vdef.id) variable.setReference(vdef.id)
variable.setAutomaticUpdate(vdef.update_always) variable.setAutomaticUpdate(vdef.update_always)
if getattr(vdef, 'default_expr', None) is not None: if getattr(vdef, 'default_expr', None) is not None:
variable.setDefaultExpr(vdef.default_expr.text) # for a very specific case, action return the reference of transition
# in order to generation correct workflow history.
if vid == 'action':
LOG(" variable is '%s'"%vid, WARNING, " in WorkflowTool.py 485.")
variable.setDefaultExpr('transition/getReference|nothing')
else: variable.setDefaultExpr(vdef.default_expr.text)
variable.info_guard = vdef.info_guard variable.info_guard = vdef.info_guard
variable.setForCatalog(vdef.for_catalog) variable.setForCatalog(vdef.for_catalog)
variable.setForStatus(vdef.for_status) variable.setForStatus(vdef.for_status)
variable.setInitialValue(vdef.default_value) variable.setInitialValue(vdef.default_value)
variable.setDescription(vdef.description) variable.setDescription(vdef.description)
# for a very specific case, action return the reference of transition
# in order to generation correct workflow history.
if vid == 'action':
variable.setDefaultExpr('transition/getReference|nothing')
return workflow return workflow
def getChainDict(self): def getChainDict(self):
......
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