Commit 8f05514e authored by wenjie.zheng's avatar wenjie.zheng Committed by Sebastien Robin

InteractionWorkflow.py: change the name of universal method for the initialization of document.

parent 8a9c57e9
...@@ -53,7 +53,6 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"), ...@@ -53,7 +53,6 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"),
""" """
An ERP5 Interaction Workflow. An ERP5 Interaction Workflow.
""" """
meta_type = 'ERP5 Workflow' meta_type = 'ERP5 Workflow'
portal_type = 'Interaction Workflow' portal_type = 'Interaction Workflow'
_isAWorkflow = True # DCWorkflow Tool compatibility _isAWorkflow = True # DCWorkflow Tool compatibility
...@@ -68,8 +67,6 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"), ...@@ -68,8 +67,6 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"),
intaractions = None intaractions = None
manager_bypass = 0 manager_bypass = 0
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
...@@ -85,7 +82,7 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"), ...@@ -85,7 +82,7 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"),
) )
def initializeDocument(self, document): def notifyCreated(self, document):
pass pass
security.declareProtected(Permissions.View, 'getChainedPortalTypeList') security.declareProtected(Permissions.View, 'getChainedPortalTypeList')
...@@ -129,7 +126,7 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"), ...@@ -129,7 +126,7 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"),
Allows the user to request information provided by the Allows the user to request information provided by the
workflow. This method must perform its own security checks. workflow. This method must perform its own security checks.
''' '''
vdef = self._getOb(name, _MARKER) ### getObjectByRef vdef = self._getOb(name, _MARKER)
if vdef is _MARKER: if vdef is _MARKER:
return default return default
if vdef.info_guard is not None and not vdef.info_guard.check( if vdef.info_guard is not None and not vdef.info_guard.check(
...@@ -148,7 +145,7 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"), ...@@ -148,7 +145,7 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"),
return value return value
security.declarePrivate('isWorkflowMethodSupported') security.declarePrivate('isWorkflowMethodSupported')
def isERP5WorkflowMethodSupported(self, ob, tid): def isWorkflowMethodSupported(self, ob, tid):
''' '''
Returns a true value if the given workflow method Returns a true value if the given workflow method
is supported in the current state. is supported in the current state.
...@@ -159,8 +156,6 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"), ...@@ -159,8 +156,6 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"),
return 1 return 1
return 0 return 0
isWorkflowMethodSupported = isERP5WorkflowMethodSupported
def _checkTransitionGuard(self, tdef, document, **kw): def _checkTransitionGuard(self, tdef, document, **kw):
if tdef.temporary_document_disallowed: if tdef.temporary_document_disallowed:
isTempDocument = getattr(document, 'isTempDocument', None) isTempDocument = getattr(document, 'isTempDocument', None)
...@@ -271,8 +266,7 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"), ...@@ -271,8 +266,7 @@ class InteractionWorkflow(IdAsReferenceMixin("interactionworkflow_", "prefix"),
filtered_transition_list = [] filtered_transition_list = []
for t_id in transition_list: for t_id in transition_list:
LOG(" t_id is '%s'"%t_id, WARNING, " in InteractionWorkflow.py 247.") tdef = self._getOb(t_id)
tdef = self._getOb(t_id) # t_id is id or reference?
assert tdef.trigger_type == TRIGGER_WORKFLOW_METHOD assert tdef.trigger_type == TRIGGER_WORKFLOW_METHOD
filtered_transition_list.append(tdef.getId()) filtered_transition_list.append(tdef.getId())
former_status = self._getOb(status_dict[self.getStateVariable()], None) former_status = self._getOb(status_dict[self.getStateVariable()], None)
......
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