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

patches/DCWorkflow.py: clean up.

parent 13b8bbde
...@@ -690,10 +690,6 @@ def updateRoleMappings(self, REQUEST=None): ...@@ -690,10 +690,6 @@ def updateRoleMappings(self, REQUEST=None):
DCWorkflowDefinition.updateRoleMappings = updateRoleMappings DCWorkflowDefinition.updateRoleMappings = updateRoleMappings
def DCWorkflowDefinition_getPortalType(self):
return self.__class__.__name__
DCWorkflowDefinition.getPortalType = DCWorkflowDefinition_getPortalType
# this patch allows to get list of portal types for workflow # this patch allows to get list of portal types for workflow
def getPortalTypeListForWorkflow(self): def getPortalTypeListForWorkflow(self):
""" """
...@@ -730,10 +726,6 @@ def DCWorkflowDefinition_getFutureStateSet(self, state, ignore=(), ...@@ -730,10 +726,6 @@ def DCWorkflowDefinition_getFutureStateSet(self, state, ignore=(),
DCWorkflowDefinition.getFutureStateSet = DCWorkflowDefinition_getFutureStateSet DCWorkflowDefinition.getFutureStateSet = DCWorkflowDefinition_getFutureStateSet
def DCWorkflowDefinition_getStateVariable(self):
return self.state_var
DCWorkflowDefinition.getStateVariable = DCWorkflowDefinition_getStateVariable
def DCWorkflowDefinition_notifyWorkflowMethod(self, ob, transition_list, args=None, kw=None): def DCWorkflowDefinition_notifyWorkflowMethod(self, ob, transition_list, args=None, kw=None):
''' '''
Allows the system to request a workflow action. This method Allows the system to request a workflow action. This method
...@@ -780,58 +772,57 @@ def DCWorkflowDefinition_notifySuccess(self, ob, transition_list, result, args=N ...@@ -780,58 +772,57 @@ def DCWorkflowDefinition_notifySuccess(self, ob, transition_list, result, args=N
''' '''
pass pass
def method_getReference(self): # following 15 patches are required for the new workflow tool compatibility.
return self.id
def DCWorkflowDefinition_getVariableValueList(self): def DCWorkflowDefinition_getVariableValueList(self):
if self.variables is not None: if self.variables is not None:
return self.variables return self.variables
return {} return {}
def DCWorkflowDefinition_getVariableIdList(self): def DCWorkflowDefinition_getVariableIdList(self):
if self.variables is not None: if self.variables is not None:
return self.variables.objectIds() return self.variables.objectIds()
return [] return []
def DCWorkflowDefinition_getStateVariable(self):
return self.state_var
def DCWorkflowDefinition_getStateValueList(self): def DCWorkflowDefinition_getStateValueList(self):
if self.states is not None: if self.states is not None:
return self.states return self.states
return {} return {}
def DCWorkflowDefinition_getStateIdList(self): def DCWorkflowDefinition_getStateIdList(self):
if self.states is not None: if self.states is not None:
return self.states.objectIds() return self.states.objectIds()
return [] return []
def DCWorkflowDefinition_getTransitionValueList(self): def DCWorkflowDefinition_getTransitionValueList(self):
if self.transitions is not None: if self.transitions is not None:
return self.transitions return self.transitions
else: else:
return {} return {}
def DCWorkflowDefinition_getTransitionIdList(self): def DCWorkflowDefinition_getTransitionIdList(self):
if self.transitions is not None: if self.transitions is not None:
return self.transitions.objectIds() return self.transitions.objectIds()
return [] return []
def DCWorkflowDefinition_getWorklistValueList(self): def DCWorkflowDefinition_getWorklistValueList(self):
if self.worklists is not None: if self.worklists is not None:
return self.worklists return self.worklists
return {} return {}
def DCWorkflowDefinition_getWorklistIdList(self): def DCWorkflowDefinition_getWorklistIdList(self):
if self.worklists is not None: if self.worklists is not None:
return self.worklists.objectIds() return self.worklists.objectIds()
return [] return []
def DCWorkflowDefinition_propertyIds(self):
return sorted(self.__dict__.keys())
def DCWorkflowDefinition_getProperty(self,prop_id):
return self.__dict__[prop_id]
def DCWorkflowDefinition_getScriptValueList(self): def DCWorkflowDefinition_getScriptValueList(self):
if self.scripts is not None: if self.scripts is not None:
return self.scripts return self.scripts
return {} return {}
def StateDefinition_getDestinationIdList(self): def StateDefinition_getDestinationIdList(self):
return self.transitions return self.transitions
def DCWorkflowDefinition_getPortalType(self):
return self.__class__.__name__
def method_getReference(self):
return self.id
# a necessary funtion in Base_viewDict
def DCWorkflowDefinition_showDict(self): def DCWorkflowDefinition_showDict(self):
attr_dict = {} attr_dict = {}
for attr in sorted(self.__dict__.keys()): for attr in sorted(self.__dict__.keys()):
...@@ -841,7 +832,8 @@ def DCWorkflowDefinition_showDict(self): ...@@ -841,7 +832,8 @@ def DCWorkflowDefinition_showDict(self):
else: else:
continue continue
return attr_dict return attr_dict
# generate XML file for the workflow contents comparison between DCWorkflow
# and converted workflow.
def DCWorkflowDefinition_showAsXML(self, root=None): def DCWorkflowDefinition_showAsXML(self, root=None):
if root is None: if root is None:
root = Element('erp5') root = Element('erp5')
...@@ -1053,13 +1045,6 @@ def DCWorkflowDefinition_showAsXML(self, root=None): ...@@ -1053,13 +1045,6 @@ def DCWorkflowDefinition_showAsXML(self, root=None):
return etree.tostring(root, encoding='utf-8', return etree.tostring(root, encoding='utf-8',
xml_declaration=True, pretty_print=True) xml_declaration=True, pretty_print=True)
def DCWorkflowDefinition_propertyIds(self):
return sorted(self.__dict__.keys())
def DCWorkflowDefinition_getProperty(self,prop_id):
return self.__dict__[prop_id]
DCWorkflowDefinition.getReference = method_getReference DCWorkflowDefinition.getReference = method_getReference
DCWorkflowDefinition.notifyWorkflowMethod = DCWorkflowDefinition_notifyWorkflowMethod DCWorkflowDefinition.notifyWorkflowMethod = DCWorkflowDefinition_notifyWorkflowMethod
DCWorkflowDefinition.notifyBefore = DCWorkflowDefinition_notifyBefore DCWorkflowDefinition.notifyBefore = DCWorkflowDefinition_notifyBefore
...@@ -1077,6 +1062,8 @@ DCWorkflowDefinition.showAsXML = DCWorkflowDefinition_showAsXML ...@@ -1077,6 +1062,8 @@ DCWorkflowDefinition.showAsXML = DCWorkflowDefinition_showAsXML
DCWorkflowDefinition.showDict = DCWorkflowDefinition_showDict DCWorkflowDefinition.showDict = DCWorkflowDefinition_showDict
DCWorkflowDefinition.propertyIds = DCWorkflowDefinition_propertyIds DCWorkflowDefinition.propertyIds = DCWorkflowDefinition_propertyIds
DCWorkflowDefinition.getProperty = DCWorkflowDefinition_getProperty DCWorkflowDefinition.getProperty = DCWorkflowDefinition_getProperty
DCWorkflowDefinition.getStateVariable = DCWorkflowDefinition_getStateVariable
DCWorkflowDefinition.getPortalType = DCWorkflowDefinition_getPortalType
StateDefinition.getReference = method_getReference StateDefinition.getReference = method_getReference
StateDefinition.getDestinationIdList = StateDefinition_getDestinationIdList StateDefinition.getDestinationIdList = StateDefinition_getDestinationIdList
StateDefinition.getDestinationReferenceList = StateDefinition_getDestinationIdList StateDefinition.getDestinationReferenceList = StateDefinition_getDestinationIdList
......
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