[Erp5-report] r42725 nicolas.dumazet - /erp5/trunk/products/ERP5/InteractionWorkflow.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 28 08:37:27 CET 2011


Author: nicolas.dumazet
Date: Fri Jan 28 08:37:26 2011
New Revision: 42725

URL: http://svn.erp5.org?rev=42725&view=rev
Log:
The guard is already checked once using isWorkflowMethodSupported, and
notify* methods are never called if the guard evaluates to False. This
check looks costly and useless.


The only possibility (?) would be that one of your Interaction workflow guards
checks kw['workflow_method_args'] and returns a different result depending
on when _checkTransitionGuard is called.
That seems like a tricky (wrong? unlikely?) usecase.
If you are in this case, let me know, and if needed I'll engineer a fast guard
check that is only ever checked once.

Modified:
    erp5/trunk/products/ERP5/InteractionWorkflow.py

Modified: erp5/trunk/products/ERP5/InteractionWorkflow.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/InteractionWorkflow.py?rev=42725&r1=42724&r2=42725&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/InteractionWorkflow.py [utf8] (original)
+++ erp5/trunk/products/ERP5/InteractionWorkflow.py [utf8] Fri Jan 28 08:37:26 2011
@@ -220,8 +220,7 @@ class InteractionWorkflowDefinition (DCW
       tdef = self.interactions[t_id]
       assert tdef.trigger_type == TRIGGER_WORKFLOW_METHOD
       if (tdef.portal_type_filter is None or \
-          ob.getPortalType() in tdef.portal_type_filter) and \
-          self._checkTransitionGuard(tdef, ob, **kw):
+          ob.getPortalType() in tdef.portal_type_filter):
         filtered_transition_list.append(tdef.id)
         former_status = self._getStatusOf(ob)
         # Execute the "before" script.



More information about the Erp5-report mailing list