[CMF-checkins] CVS: CMF - DCWorkflow.py:1.5
shane@digicool.com
shane@digicool.com
Wed, 13 Jun 2001 09:54:07 -0400 (EDT)
Update of /cvs-repository/CMF/DCWorkflow
In directory korak.digicool.com:/tmp/cvs-serv5009
Modified Files:
DCWorkflow.py
Log Message:
Further awareness of ObjectMoved exceptions; now automatic transitions will
continue.
--- Updated File DCWorkflow.py in package CMF --
--- DCWorkflow.py 2001/06/13 02:06:20 1.4
+++ DCWorkflow.py 2001/06/13 13:54:06 1.5
@@ -505,8 +505,14 @@
automatic transitions. tdef set to None means the object
was just created.
'''
+ moved = 0
while 1:
- sdef = self._executeTransition(ob, tdef, kwargs)
+ try:
+ sdef = self._executeTransition(ob, tdef, kwargs)
+ except ObjectMoved, ex:
+ moved = 1
+ ob = ex.getNewObject()
+ sdef = self._getWorkflowStateOf(ob)
if sdef is None:
break
tdef = None
@@ -520,6 +526,9 @@
# No more automatic transitions.
break
# Else continue.
+ if moved:
+ # Re-raise.
+ raise ObjectMoved(ob)
def _executeTransition(self, ob, tdef=None, kwargs=None):
'''