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

WorkflowTool.py: do not add prefix to script id in convertion.

parent f428b3cc
...@@ -302,13 +302,13 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -302,13 +302,13 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
if tdef.after_script_name in dc_workflow.transitions.objectIds(): if tdef.after_script_name in dc_workflow.transitions.objectIds():
transition.setAfterScriptId('transition_'+tdef.after_script_name) transition.setAfterScriptId('transition_'+tdef.after_script_name)
elif tdef.after_script_name in dc_workflow.scripts.objectIds(): elif tdef.after_script_name in dc_workflow.scripts.objectIds():
transition.setAfterScriptId('script_'+tdef.after_script_name) transition.setAfterScriptId(tdef.after_script_name)
if tdef.script_name is not None: if tdef.script_name is not None:
# check after script is a Transion or a Script: # check after script is a Transion or a Script:
if tdef.script_name in dc_workflow.transitions.objectIds(): if tdef.script_name in dc_workflow.transitions.objectIds():
transition.setBeforeScriptId('transition_'+tdef.script_name) transition.setBeforeScriptId('transition_'+tdef.script_name)
elif tdef.script_name in dc_workflow.scripts.objectIds(): elif tdef.script_name in dc_workflow.scripts.objectIds():
transition.setBeforeScriptId('script_'+tdef.script_name) transition.setBeforeScriptId(tdef.script_name)
# configure guard # configure guard
if tdef.guard: if tdef.guard:
transition.setRoleList(tdef.guard.roles) transition.setRoleList(tdef.guard.roles)
...@@ -411,19 +411,19 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -411,19 +411,19 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
interaction.setReference(tdef.id) interaction.setReference(tdef.id)
script_list = [] script_list = []
for script_name in tdef.activate_script_name: for script_name in tdef.activate_script_name:
script_list.append('script_'+script_name) script_list.append(script_name)
interaction.setActivateScriptNameList(tuple(script_list)) interaction.setActivateScriptNameList(tuple(script_list))
script_list = [] script_list = []
for script_name in tdef.after_script_name: for script_name in tdef.after_script_name:
script_list.append('script_'+script_name) script_list.append(script_name)
interaction.setAfterScriptNameList(tuple(script_list)) interaction.setAfterScriptNameList(tuple(script_list))
script_list = [] script_list = []
for script_name in tdef.before_commit_script_name: for script_name in tdef.before_commit_script_name:
script_list.append('script_'+script_name) script_list.append(script_name)
interaction.setBeforeCommitScriptNameList(tuple(script_list)) interaction.setBeforeCommitScriptNameList(tuple(script_list))
script_list = [] script_list = []
for script_name in tdef.script_name: for script_name in tdef.script_name:
script_list.append('script_'+script_name) script_list.append(script_name)
interaction.setBeforeScriptNameList(tuple(script_list)) interaction.setBeforeScriptNameList(tuple(script_list))
# configure guard # configure guard
if tdef.guard: if tdef.guard:
...@@ -451,7 +451,12 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -451,7 +451,12 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
# create scripts (portal_type = Workflow Script) # create scripts (portal_type = Workflow Script)
for script_id in dc_workflow.scripts: for script_id in dc_workflow.scripts:
script = dc_workflow.scripts.get(script_id) script = dc_workflow.scripts.get(script_id)
workflow_script = workflow.newContent(id='script_'+script_id ,portal_type='Workflow Script', temp_object=temp) if hasattr(workflow, script_id):
workflow_script = workflow.newContent(portal_type='Workflow Script', temp_object=temp)
workflow.script_id = workflow_script
workflow.script_id.id = script_id
else:
workflow_script = workflow.newContent(id=script_id ,portal_type='Workflow Script', temp_object=temp)
workflow_script.setTitle(script.title) workflow_script.setTitle(script.title)
workflow_script.default_reference = script_id workflow_script.default_reference = script_id
workflow_script.setParameterSignature(script._params) workflow_script.setParameterSignature(script._params)
......
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