Commit 9250473a authored by wenjie.zheng's avatar wenjie.zheng

WorkflowTool.py: reactivate getWorkflowsFor=getWorkflowValueList; load...

WorkflowTool.py: reactivate getWorkflowsFor=getWorkflowValueList; load DCWorkflow chain even if portal type is not in portal_types.
parent 4d70b829
...@@ -193,20 +193,20 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -193,20 +193,20 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
""" Return a list of workflows bound to selected portal_type, this workflow """ Return a list of workflows bound to selected portal_type, this workflow
list may contain both DC Workflow and Workflow. list may contain both DC Workflow and Workflow.
""" """
portal_type = self.getPortalObject().getDefaultModule(portal_type="portal_types")._getOb(portal_type_id, None) portal_type = self.getPortalObject().portal_types._getOb(portal_type_id, None)
workflow_list = [] workflow_list = []
if portal_type is not None: if portal_type is not None:
# checking Workflow assignment: # checking Workflow assignment:
for workflow_id in portal_type.getTypeWorkflowList(): for workflow_id in portal_type.getTypeWorkflowList():
workflow_list.append(self._getOb(workflow_id)) workflow_list.append(self._getOb(workflow_id))
for wf_id in self.getChainFor(portal_type_id): for wf_id in self.getChainFor(portal_type_id):
wf = self.getWorkflowById(wf_id) wf = self.getWorkflowById(wf_id)
if wf is not None: if wf is not None:
workflow_list.append(wf) workflow_list.append(wf)
return workflow_list return workflow_list
#getWorkflowsFor = getWorkflowValueListFor getWorkflowsFor = getWorkflowValueListFor
security.declarePrivate('getHistoryOf') security.declarePrivate('getHistoryOf')
def getHistoryOf(self, wf_id, ob): def getHistoryOf(self, wf_id, ob):
...@@ -698,9 +698,8 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -698,9 +698,8 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
document_pt = document.getTypeInfo() document_pt = document.getTypeInfo()
if document_pt is not None: if document_pt is not None:
workflow_list = self.getWorkflowValueListFor(document.getPortalType()) workflow_list = document_pt.getTypeWorkflowList()
for wf in workflow_list: for wf in workflow_list:
LOG("Check workflow '%s' action list"%wf.id,WARNING," in WorkflowTool.py 705")
wf_id = wf.getReference() wf_id = wf.getReference()
did[wf_id] = None did[wf_id] = None
wf = self.getPortalObject().portal_workflow._getOb(wf_id, None) wf = self.getPortalObject().portal_workflow._getOb(wf_id, None)
...@@ -713,6 +712,17 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -713,6 +712,17 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
if a is not None: if a is not None:
worklist_dict[wf_id] = a worklist_dict[wf_id] = a
for wf_id in chain:
did[wf_id] = None
wf = self.getWorkflowById(wf_id)
if wf is not None:
a = wf.listObjectActions(info)
if a is not None:
actions.extend(a)
a = wf.getWorklistVariableMatchDict(info)
if a is not None:
worklist_dict[wf_id] = a
wf_ids = self.getWorkflowIds() wf_ids = self.getWorkflowIds()
for wf_id in wf_ids: for wf_id in wf_ids:
if not did.has_key(wf_id): if not did.has_key(wf_id):
......
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