Commit 45b508a0 authored by iv's avatar iv

ERP5Workflow: same but cleaner way without storage_id

parent 59ec192a
...@@ -774,7 +774,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin): ...@@ -774,7 +774,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
state_list = [] state_list = []
for wf in self.portal_workflow.objectValues(): for wf in self.portal_workflow.objectValues():
for state in wf.getStateValueList(): for state in wf.getStateValueList():
if group in getattr(state, 'type_list', ()): if group in state.getStateTypeList():
state_list.append(state.getReference()) state_list.append(state.getReference())
return tuple(state_list) return tuple(state_list)
...@@ -1300,7 +1300,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin): ...@@ -1300,7 +1300,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
for wf in self.portal_workflow.objectValues(): for wf in self.portal_workflow.objectValues():
if wf.getVariableValueDict() and wf.getStateVariable() == 'simulation_state': if wf.getVariableValueDict() and wf.getStateVariable() == 'simulation_state':
for state in wf.getStateValueList(): for state in wf.getStateValueList():
if getattr(state, 'type_list', None): if state.getStateTypeList():
state_list.append(state.getReference()) state_list.append(state.getReference())
return tuple(sorted_list) return tuple(sorted_list)
......
...@@ -38,7 +38,9 @@ ...@@ -38,7 +38,9 @@
</item> </item>
<item> <item>
<key> <string>storage_id</string> </key> <key> <string>storage_id</string> </key>
<value> <string>type_list</string> </value> <value>
<none/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -843,6 +843,8 @@ def DCWorkflowDefinition_getScriptValueList(self): ...@@ -843,6 +843,8 @@ def DCWorkflowDefinition_getScriptValueList(self):
return [] return []
def StateDefinition_getDestinationIdList(self): def StateDefinition_getDestinationIdList(self):
return self.transitions return self.transitions
def StateDefinition_getStateTypeList(self):
return getattr(self, 'type_list', ())
def DCWorkflowDefinition_getPortalType(self): def DCWorkflowDefinition_getPortalType(self):
return self.__class__.__name__ return self.__class__.__name__
def method_getReference(self): def method_getReference(self):
...@@ -1113,6 +1115,7 @@ StateDefinition.getReference = method_getReference ...@@ -1113,6 +1115,7 @@ StateDefinition.getReference = method_getReference
StateDefinition.getDestinationIdList = StateDefinition_getDestinationIdList StateDefinition.getDestinationIdList = StateDefinition_getDestinationIdList
StateDefinition.getDestinationReferenceList = StateDefinition_getDestinationIdList StateDefinition.getDestinationReferenceList = StateDefinition_getDestinationIdList
StateDefinition.showDict = DCWorkflowDefinition_showDict StateDefinition.showDict = DCWorkflowDefinition_showDict
StateDefinition.getStateTypeList = StateDefinition_getStateTypeList
TransitionDefinition.getParentValue = TransitionDefinition_getParentValue TransitionDefinition.getParentValue = TransitionDefinition_getParentValue
TransitionDefinition.getReference = method_getReference TransitionDefinition.getReference = method_getReference
TransitionDefinition.showDict = DCWorkflowDefinition_showDict TransitionDefinition.showDict = DCWorkflowDefinition_showDict
......
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