Commit 2ce31014 authored by wenjie.zheng's avatar wenjie.zheng Committed by Sebastien Robin

InteractionWorkflow.py: add universal method for compatibility.

parent 1caabb10
......@@ -387,3 +387,21 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"),
sci = StateChangeInfo(
ob, self, former_status, tdef, None, None, kwargs=kw)
script.execute(sci)
security.declarePrivate('isActionSupported')
def isActionSupported(self, document, action, **kw):
'''
Returns a true value if the given action name
is possible in the current state.
'''
sdef = self._getWorkflowStateOf(document, id_only=0)
if sdef is None:
return 0
if action in sdef.getDestinationIdList():
tdef = self._getOb(action, None)
if (tdef is not None and
tdef.trigger_type == TRIGGER_USER_ACTION and
self._checkTransitionGuard(tdef, document, **kw)):
return 1
return 0
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