Skip to content

getExitSet() returns an incorrect result in certain configurations #193

@ryanhol-amazon-com

Description

@ryanhol-amazon-com

getExitSet() can return an incorrect result in certain configurations, leading to the unexpected exit of states unrelated to the active transition.

Given the following state chart definition...

<scxml>
  <parallel id="Main">
    <state id="Parent">
      <state id="Child">
        <state id="Action1">
          <transition target="Action2" event="Go"/>
        </state>

        <state id="Action2"/>
      </state>
    </state>

    <state id="Sibling1"/>
    <state id="Sibling2"/>
    <state id="Sibling3"/>
    <state id="Sibling4"/>
    <!-- Any number of siblings... -->
  </parallel>
</scxml>

...when taking a transition from Action1 to Action2, the expected
exit set is [Action1]. However, getExitSet() returns an exit set that
includes Action1 in addition to all Sibling* states (i.e.
[Action1, Sibling1, Sibling2, ...]).

The issue here is that getExitSet() depends on finding a sibling of the
least-common-compound-ancestor (LCCA) in order to determine the bounds
of the exit set. In this case -- transitioning from Action1 to
Action2 -- the LCCA is 'Child'. However, 'Child' has no siblings. When the LCCA has no siblings, getExitSet() takes the action of including all
subsequent states (in document order) in the exit set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions