uscxml icon indicating copy to clipboard operation
uscxml copied to clipboard

Multiple transitions on same event in parallel not working

Open KannebTo opened this issue 4 years ago • 1 comments

I found a case, where only one of two parallel transitions on the same event are executed.

SCXML:

<scxml initial="parallel">
    <parallel id="parallel">
        <state id="s1" initial="s11">
            <state id="s11">
                <transition event="e" target="s12"></transition>
            </state>
            <state id="s12"></state>
        </state>
        <state id="s2">
            <state id="wrapper_state">
                <transition event="x" target="s23"></transition>
                <state id="s21">
                    <transition event="e" target="s22"></transition>
                </state>
                <state id="s22"></state>
            </state>
            <state id="s23"></state>
        </state>
    </parallel>
</scxml>

1624952219

Initial configuration:

['parallel', 's1', 's11', 's2', 'wrapper_state', 's21']

Configuration after event e:

['parallel', 's1', 's12', 's2', 'wrapper_state', 's21']

s11 transitions to s12 but sadly s21 stays. I need to trigger event e a second time to make the transition to s22.

But when I delete the transition on event x in the SCXML, it is working fine.

KannebTo avatar Jun 29 '21 08:06 KannebTo

This is a very good catch because I found additional issue in your example which is related to issue #176

1. Event 'e' is accepted only to 's1' and 'done.state.p1' is generated when only 's1' reached final configuration

issue_with_done_state3

2. 'done.state.p1' is generated when only 's1' reached final configuration

issue_with_done_state

I made 3 tests which cover issues #176, #203

  1. testIssue176_DoneStateParallelNotBeforeFinal.scxml
  2. testIssue176_DoneStateParallelNotBeforeFinal2.scxml
  3. testIssue203_MultipleTransitionsOnSameEvent.scxml

alexzhornyak avatar Jun 29 '21 12:06 alexzhornyak