Commit 0e310cfa authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

use portal_workflow.isTransitionPossible instead of 'try' and 'except UnsupportedWorkflowMethod'.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33941 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a007d846
...@@ -32,7 +32,6 @@ from AccessControl import ClassSecurityInfo ...@@ -32,7 +32,6 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
from Products.CMFActivity.ActiveProcess import ActiveProcess from Products.CMFActivity.ActiveProcess import ActiveProcess
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
class SolverProcess(XMLObject, ActiveProcess): class SolverProcess(XMLObject, ActiveProcess):
""" """
...@@ -150,12 +149,11 @@ class SolverProcess(XMLObject, ActiveProcess): ...@@ -150,12 +149,11 @@ class SolverProcess(XMLObject, ActiveProcess):
""" """
Start solving Start solving
""" """
isTransitionPossible = self.getPortalObject().portal_workflow.isTransitionPossible
for solver in self.contentValues(portal_type=self.getPortalObject().getPortalTargetSolverTypeList()): for solver in self.contentValues(portal_type=self.getPortalObject().getPortalTargetSolverTypeList()):
try: if isTransitionPossible(solver, 'start_solving'):
solver.startSolving() solver.startSolving()
solver.activate(active_process=self).solve() solver.activate(active_process=self).solve()
except UnsupportedWorkflowMethod:
pass
# API # API
def isSolverDecisionListConsistent(self): def isSolverDecisionListConsistent(self):
......
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