Commit b192815c authored by Nicolas Dumazet's avatar Nicolas Dumazet

simplify isWorkflowMethodSupported

Correct and update comment: we _do_ use isWorkflowMethodSupported to check the
guard of a transition before running it, check Base.WorkflowMethod implementation.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42724 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0199e809
...@@ -174,19 +174,11 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject): ...@@ -174,19 +174,11 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject):
security.declarePrivate('isWorkflowMethodSupported') security.declarePrivate('isWorkflowMethodSupported')
def isWorkflowMethodSupported(self, ob, method_id): def isWorkflowMethodSupported(self, ob, method_id):
''' '''
Returns a true value if the given workflow is Returns a true value if the given workflow method
automatic with the propper method_id is supported in the current state.
NOTE: this method is not used in ERP5 because
of transition_list approach
''' '''
tdef = self.interactions.get(method_id, None) tdef = self.interactions.get(method_id, None)
if (tdef is not None and return tdef is not None and self._checkTransitionGuard(tdef, ob)
tdef.trigger_type == TRIGGER_WORKFLOW_METHOD and
self._checkTransitionGuard(tdef, ob)):
return 1
return 0
security.declarePrivate('wrapWorkflowMethod') security.declarePrivate('wrapWorkflowMethod')
def wrapWorkflowMethod(self, ob, method_id, func, args, kw): def wrapWorkflowMethod(self, ob, method_id, func, args, kw):
......
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