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

WorkflowTool.py: only convert transition variable when there exist transition.

parent 1b7f9ef4
...@@ -481,21 +481,22 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -481,21 +481,22 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
variable.setInitialValue(vdef.default_value) variable.setInitialValue(vdef.default_value)
variable.setDescription(vdef.description) variable.setDescription(vdef.description)
# configure transition variable # configure transition variable
for tid in dc_workflow.transitions: if dc_workflow.transitions is not None:
origin_tdef = dc_workflow.transitions[tid] for tid in dc_workflow.transitions:
transition = workflow._getOb('transition_'+tid) origin_tdef = dc_workflow.transitions[tid]
new_category = [] transition = workflow._getOb('transition_'+tid)
if origin_tdef.var_exprs is None: new_category = []
var_exprs = {} if origin_tdef.var_exprs is None:
else: var_exprs = origin_tdef.var_exprs var_exprs = {}
LOG("transition '%s' has var_exprs '%s'"%(origin_tdef.__dict__, var_exprs), WARNING, " in WorkflowTool.py 496") else: var_exprs = origin_tdef.var_exprs
for key in var_exprs: LOG("transition '%s' has var_exprs '%s'"%(origin_tdef.__dict__, var_exprs), WARNING, " in WorkflowTool.py 496")
tr_var = transition.newContent(portal_type='Transition Variable', temp_object=temp) for key in var_exprs:
tr_var.setDefaultExpr(var_exprs[key].text) tr_var = transition.newContent(portal_type='Transition Variable', temp_object=temp)
tr_var_path = getattr(workflow, 'variable_'+key).getPath() tr_var.setDefaultExpr(var_exprs[key].text)
tr_var_path = '/'.join(tr_var_path.split('/')[2:]) tr_var_path = getattr(workflow, 'variable_'+key).getPath()
new_category.append(tr_var_path) tr_var_path = '/'.join(tr_var_path.split('/')[2:])
tr_var.setCausalityList(new_category) new_category.append(tr_var_path)
tr_var.setCausalityList(new_category)
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