Commit ac4e5087 authored by wenjie.zheng's avatar wenjie.zheng

WorkflowTool.py: avoid convert 'non-exist' bad defined transition during the conversion.

parent 834e7010
...@@ -350,9 +350,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -350,9 +350,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
sdef = workflow._getOb('state_'+sid) sdef = workflow._getOb('state_'+sid)
new_category = [] new_category = []
for transition_id in dc_workflow.states.get(sid).transitions: for transition_id in dc_workflow.states.get(sid).transitions:
tr_path = getattr(workflow, 'transition_'+transition_id).getPath() tr = getattr(workflow, 'transition_'+transition_id, None)
tr_path = 'destination/' + '/'.join(tr_path.split('/')[2:]) if tr is not None:
new_category.append(tr_path) tr_path = 'destination/' + '/'.join(tr.getPath().split('/')[2:])
new_category.append(tr_path)
sdef.setCategoryList(new_category) sdef.setCategoryList(new_category)
# set transition's destination state: # set transition's destination state:
for tid in dc_workflow.transitions: for tid in dc_workflow.transitions:
......
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