entities/wfobjs.py
branchstable
changeset 4646 322c3dd96dd5
parent 4645 fd4e32f17211
child 4647 6d7589b4ae6f
--- a/entities/wfobjs.py	Fri Feb 19 09:37:03 2010 +0100
+++ b/entities/wfobjs.py	Fri Feb 19 10:04:24 2010 +0100
@@ -266,6 +266,12 @@
         except IndexError:
             return entity.latest_trinfo().previous_state
 
+    def potential_destinations(self):
+        try:
+            yield self.destination_state[0]
+        except IndexError:
+            for state in self.reverse_allowed_transition:
+                yield state
 
     def parent(self):
         return self.workflow
@@ -279,9 +285,12 @@
     def subwf(self):
         return self.subworkflow[0]
 
-    def destination(self):
+    def destination(self, entity):
         return self.subwf.initial
 
+    def potential_destinations(self):
+        yield self.subwf.initial
+
     def add_exit_point(self, fromstate, tostate):
         if hasattr(fromstate, 'eid'):
             fromstate = fromstate.eid