Commit 1fc433dd authored by Rafael Monnerat's avatar Rafael Monnerat

Added Utility Method for get the workflow chain as Dict (instead persistent...

Added Utility Method for get the workflow chain as Dict (instead persistent mapping) and return use same format as required by manage_changeWorkflows method.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36175 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a8a334a0
......@@ -783,6 +783,19 @@ def WorkflowTool_isTransitionPossible(self, ob, transition_id, wf_id=None):
WorkflowTool.isTransitionPossible = WorkflowTool_isTransitionPossible
def WorkflowTool_getWorkflowChainDict(self, sorted=True):
"""Returns workflow chain compatible with workflow_chain_dict signature"""
chain = self._chains_by_type.copy()
return_dict = {}
for portal_type, workflow_id_list in chain.iteritems():
if sorted:
workflow_id_list = list(workflow_id_list)
workflow_id_list.sort()
return_dict['chain_%s' % portal_type] = ', '.join(workflow_id_list)
return return_dict
WorkflowTool.getWorkflowChainDict = WorkflowTool_getWorkflowChainDict
WorkflowTool._reindexWorkflowVariables = lambda self, ob: \
hasattr(aq_base(ob), 'reindexObjectSecurity') and ob.reindexObjectSecurity()
......
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