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

WorkflowTool.py: resolve transition, worklist and interaction guard issue.

parent 203e54b9
...@@ -335,7 +335,12 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -335,7 +335,12 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
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('script_'+tdef.script_name)
transition.guard = tdef.guard # configure guard
if tdef.guard:
transition.setRoleList(tdef.guard.roles)
transition.setPermissionList(tdef.guard.permissions)
transition.setGroupList(tdef.guard.groups)
transition.setExpression(tdef.guard.expr)
# create states (portal_type = State) # create states (portal_type = State)
for sid in dc_workflow.states: for sid in dc_workflow.states:
sdef = dc_workflow.states.get(sid) sdef = dc_workflow.states.get(sid)
...@@ -408,7 +413,12 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -408,7 +413,12 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
worklist.setActboxIcon(qdef.actbox_icon) worklist.setActboxIcon(qdef.actbox_icon)
worklist.setActboxName(qdef.actbox_name) worklist.setActboxName(qdef.actbox_name)
worklist.setActboxUrl(qdef.actbox_url) worklist.setActboxUrl(qdef.actbox_url)
worklist.guard = qdef.guard # configure guard
if qdef.guard:
worklist.setRoleList(qdef.guard.roles)
worklist.setPermissionList(qdef.guard.permissions)
worklist.setGroupList(qdef.guard.groups)
worklist.setExpression(qdef.guard.expr)
else: else:
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)
...@@ -436,7 +446,12 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -436,7 +446,12 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
interaction.setBeforeScriptName('interaction_'+tdef.script_name) interaction.setBeforeScriptName('interaction_'+tdef.script_name)
elif tdef.script_name in dc_workflow.scripts.objectIds(): elif tdef.script_name in dc_workflow.scripts.objectIds():
interaction.setBeforeScriptName('script_'+tdef.script_name) interaction.setBeforeScriptName('script_'+tdef.script_name)
interaction.guard = tdef.guard # configure guard
if tdef.guard:
interaction.setRoleList(tdef.guard.roles)
interaction.setPermissionList(tdef.guard.permissions)
interaction.setGroupList(tdef.guard.groups)
interaction.setExpression(tdef.guard.expr)
interaction.setPortalTypeFilter(tdef.portal_type_filter) interaction.setPortalTypeFilter(tdef.portal_type_filter)
interaction.setPortalTypeGroupFilter(tdef.portal_type_group_filter) interaction.setPortalTypeGroupFilter(tdef.portal_type_group_filter)
interaction.setTemporaryDocumentDisallowed(tdef.temporary_document_disallowed) interaction.setTemporaryDocumentDisallowed(tdef.temporary_document_disallowed)
...@@ -1334,4 +1349,4 @@ class ExclusionTuple(tuple): ...@@ -1334,4 +1349,4 @@ class ExclusionTuple(tuple):
It is not to be used outside of the scope of this document nor outside It is not to be used outside of the scope of this document nor outside
of the scope of worklist criterion handling. of the scope of worklist criterion handling.
""" """
pass pass
\ No newline at end of file
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