# HG changeset patch # User Aurelien Campeas # Date 1254995046 -7200 # Node ID 600ee58a1375a16e26926ad43177f0baf56f8347 # Parent 4e289c2e4b337e30dc6fa43ac50f044b81bd9db2 a problem with consecutive transition firing when subworkflows are involved diff -r 4e289c2e4b33 -r 600ee58a1375 entities/test/unittest_wfobjs.py --- a/entities/test/unittest_wfobjs.py Wed Oct 07 23:20:01 2009 +0200 +++ b/entities/test/unittest_wfobjs.py Thu Oct 08 11:44:06 2009 +0200 @@ -158,6 +158,31 @@ 'WHERE T name "deactivate"') self._test_stduser_deactivate() + def test_swf_fire_in_a_row(self): + # sub-workflow + subwf = add_wf(self, 'CWGroup', name='subworkflow') + xsigning = subwf.add_state('xsigning', initial=True) + xaborted = subwf.add_state('xaborted') + xsigned = subwf.add_state('xsigned') + xabort = subwf.add_transition('xabort', (xsigning,), xaborted) + xsign = subwf.add_transition('xsign', (xsigning,), xsigning) + xcomplete = subwf.add_transition('xcomplete', (xsigning,), xsigned, + type=u'auto') + # main workflow + twf = add_wf(self, 'CWGroup', name='mainwf', default=True) + created = twf.add_state(_('created'), initial=True) + identified = twf.add_state(_('identified')) + released = twf.add_state(_('released')) + twf.add_wftransition(_('identify'), subwf, (created,), + [(xsigned, identified), (xaborted, created)]) + twf.add_wftransition(_('release'), subwf, (identified,), + [(xsigned, released), (xaborted, identified)]) + self.commit() + group = self.add_entity('CWGroup', name=u'grp1') + self.commit() + for trans in ('identify', 'release'): + group.fire_transition(trans) + def test_subworkflow_base(self): """subworkflow