Commit 7dc565b1 authored by wenjie.zheng's avatar wenjie.zheng

WorkflowTool.py: only convert DCWorkflow and DC interaction workflow, this...

WorkflowTool.py: only convert DCWorkflow and DC interaction workflow, this modification makes conversion more robust.
parent e2c8a92d
...@@ -257,7 +257,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -257,7 +257,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
if workflow_type_id == 'DCWorkflowDefinition': if workflow_type_id == 'DCWorkflowDefinition':
if temp == 0: if temp == 0:
new_id = 'converting_'+dc_workflow.id new_id = 'converting_'+dc_workflow.id
else: elif workflow_type_id == 'InteractionWorkflowDefinition':
new_id = dc_workflow.id new_id = dc_workflow.id
uid = self.encodeWorkflowUid(new_id) uid = self.encodeWorkflowUid(new_id)
workflow = container.newContent(id=new_id, portal_type='Workflow', temp_object=temp) workflow = container.newContent(id=new_id, portal_type='Workflow', temp_object=temp)
...@@ -416,7 +416,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -416,7 +416,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
worklist.setGroupList(qdef.guard.groups) worklist.setGroupList(qdef.guard.groups)
if qdef.guard.expr is not None: if qdef.guard.expr is not None:
worklist.setExpression(qdef.guard.expr.text) worklist.setExpression(qdef.guard.expr.text)
else: elif workflow_type_id == 'InteractionWorkflowDefinition':
for tid in dc_workflow.interactions: for tid in dc_workflow.interactions:
interaction = workflow.newContent(portal_type='Interaction', temp_object=temp) interaction = workflow.newContent(portal_type='Interaction', temp_object=temp)
tdef = dc_workflow.interactions.get(tid) tdef = dc_workflow.interactions.get(tid)
......
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