[Erp5-report] r36175 rafael - /erp5/trunk/products/ERP5Type/patches/WorkflowTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jun 9 23:50:47 CEST 2010


Author: rafael
Date: Wed Jun  9 23:50:46 2010
New Revision: 36175

URL: http://svn.erp5.org?rev=36175&view=rev
Log:
Added Utility Method for get the workflow chain as Dict (instead persistent mapping) and return use same format as required by manage_changeWorkflows method.


Modified:
    erp5/trunk/products/ERP5Type/patches/WorkflowTool.py

Modified: erp5/trunk/products/ERP5Type/patches/WorkflowTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/WorkflowTool.py?rev=36175&r1=36174&r2=36175&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/WorkflowTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/WorkflowTool.py [utf8] Wed Jun  9 23:50:46 2010
@@ -783,6 +783,19 @@ def WorkflowTool_isTransitionPossible(se
 
 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()
 




More information about the Erp5-report mailing list