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

WorkflowTool.py: now getWorkflowChainDict also return the type defined...

WorkflowTool.py: now getWorkflowChainDict also return the type defined workflow list in the same dict.
parent 7a5bece0
......@@ -542,13 +542,18 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
def getWorkflowChainDict(self, sorted=True):
"""Returns workflow chain compatible with workflow_chain_dict signature"""
# add new workflow compatibility;
chain = self._chains_by_type.copy()
return_dict = {}
for portal_type, workflow_id_list in chain.iteritems():
for portal_type, dc_workflow_id_list in chain.iteritems():
if sorted:
workflow_id_list = list(workflow_id_list)
dc_workflow_id_list = list(dc_workflow_id_list)
workflow_id_list.sort()
portal_type_value = self.getPortalObject().portal_types._getOb(portal_type)
workflow_id_list = [workflow.getId() for workflow in portal_type_value.getTypeWorkfowList()]
workflow_id_list.extend(dc_workflow_id_list)
return_dict['chain_%s' % portal_type] = ', '.join(workflow_id_list)
return return_dict
def isTransitionPossible(self, ob, transition_id, wf_id=None):
......
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