sobjects/textparsers.py
changeset 5556 9ab2b4c74baf
parent 5424 8ecbcbff9777
child 6911 75849076fd6c
--- a/sobjects/textparsers.py	Thu May 20 20:47:13 2010 +0200
+++ b/sobjects/textparsers.py	Thu May 20 20:47:55 2010 +0200
@@ -74,10 +74,14 @@
             if not hasattr(entity, 'in_state'):
                 self.error('bad change state instruction for eid %s', eid)
                 continue
-            tr = entity.current_workflow and entity.current_workflow.transition_by_name(trname)
+            iworkflowable = entity.cw_adapt_to('IWorkflowable')
+            if iworkflowable.current_workflow:
+                tr = iworkflowable.current_workflow.transition_by_name(trname)
+            else:
+                tr = None
             if tr and tr.may_be_fired(entity.eid):
                 try:
-                    trinfo = entity.fire_transition(tr)
+                    trinfo = iworkflowable.fire_transition(tr)
                     caller.fire_event('state-changed', {'trinfo': trinfo,
                                                         'entity': entity})
                 except: