Commit e82cf608 authored by wenjie.zheng's avatar wenjie.zheng

Base.py: use getWorkflowsFor to replace getWorkflowValueListFor.

parent 956f518f
...@@ -507,7 +507,7 @@ def initializePortalTypeDynamicWorkflowMethods(ptype_klass, portal_workflow): ...@@ -507,7 +507,7 @@ def initializePortalTypeDynamicWorkflowMethods(ptype_klass, portal_workflow):
workflow_dict = {} workflow_dict = {}
interaction_workflow_dict = {} interaction_workflow_dict = {}
for wf in portal_workflow.getWorkflowValueListFor(portal_type): for wf in portal_workflow.getWorkflowsFor(portal_type):
wf_id = wf.getId() wf_id = wf.getId()
wf_type = wf.__class__.__name__ wf_type = wf.__class__.__name__
if wf_type == "DCWorkflowDefinition" or wf_type == "Workflow": if wf_type == "DCWorkflowDefinition" or wf_type == "Workflow":
...@@ -2687,7 +2687,7 @@ class Base( CopyContainer, ...@@ -2687,7 +2687,7 @@ class Base( CopyContainer,
'isDeleted') 'isDeleted')
def isDeleted(self): def isDeleted(self):
"""Test if the context is in 'deleted' state""" """Test if the context is in 'deleted' state"""
for wf in self.getPortalObject().portal_workflow.getWorkflowValueListFor(self): for wf in self.getPortalObject().portal_workflow.getWorkflowsFor(self):
state = wf._getWorkflowStateOf(self) state = wf._getWorkflowStateOf(self)
if state is not None and state.getReference() == 'deleted': if state is not None and state.getReference() == 'deleted':
return True return True
...@@ -2729,7 +2729,7 @@ class Base( CopyContainer, ...@@ -2729,7 +2729,7 @@ class Base( CopyContainer,
Returns a list of tuples {id:workflow_id, state:workflow_state} Returns a list of tuples {id:workflow_id, state:workflow_state}
""" """
result = [] result = []
for wf in self.portal_workflow.getWorkflowValueListFor(self.getPortalType()): for wf in self.portal_workflow.getWorkflowsFor(self.getPortalType()):
result += [(wf.getReference(), wf._getWorkflowStateOf(self, id_only=1))] result += [(wf.getReference(), wf._getWorkflowStateOf(self, id_only=1))]
return result return result
...@@ -3097,7 +3097,7 @@ class Base( CopyContainer, ...@@ -3097,7 +3097,7 @@ class Base( CopyContainer,
# Check if edit_workflow defined # Check if edit_workflow defined
portal_workflow = self.getPortalObject().portal_workflow portal_workflow = self.getPortalObject().portal_workflow
wf = portal_workflow.getWorkflowById('edit_workflow') wf = portal_workflow.getWorkflowById('edit_workflow')
wf_list = portal_workflow.getWorkflowValueListFor(self) wf_list = portal_workflow.getWorkflowsFor(self)
if wf is not None: if wf is not None:
wf_list = [wf] + wf_list wf_list = [wf] + wf_list
for wf in wf_list: for wf in wf_list:
...@@ -3372,7 +3372,7 @@ class Base( CopyContainer, ...@@ -3372,7 +3372,7 @@ class Base( CopyContainer,
portal = self.getPortalObject() portal = self.getPortalObject()
workflow_tool = portal.portal_workflow workflow_tool = portal.portal_workflow
worflow_variable_list = [] worflow_variable_list = []
for workflow in workflow_tool.getWorkflowValueListFor(self): for workflow in workflow_tool.getWorkflowsFor(self):
if not isinstance(workflow, InteractionWorkflowDefinition) and \ if not isinstance(workflow, InteractionWorkflowDefinition) and \
not isinstance(workflow, InteractionWorkflow): not isinstance(workflow, InteractionWorkflow):
worflow_variable_list.append(self.getProperty(workflow.getStateVariable())) worflow_variable_list.append(self.getProperty(workflow.getStateVariable()))
......
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