ligtu
ligtu

Reputation: 1

How scxml transition target works

I am trying to understand scxml transition target state set. Here is some of my example code:

<parallel id="p">
    <state id="A" initial="A1">
        <state id="A1">
            <transition event="test" target="B2" />
        </state>
        <state id="A2" />
    </state>
    <state id="B" initial="B1">
        <state id="B1" />
        <state id="B2" />
    </state>
    <state id="C" initial="C1">
        <state id="C1" />
        <state id="C2" />
    </state>
</parallel>

if P, A, A1, B, B1, C and C2 are currently active. Now event "test" is coming, so the transition will take place to target state "b2" 1) Base on section 3.13 of State Chart XML (SCXML): State Machine Notation for Control Abstraction, the ancestors state A, and P will be affected. Al states will be exited then re-enter P, or only A1 and A are exited? 2) if all states are exited and re-enter at P then set P, A, A1, B, B2, C and C1 are active or set P, A, A1, B, B2, C and C2 are active? (because c2 was active before transition "test" took place)

Upvotes: 0

Views: 214

Answers (1)

user2187033
user2187033

Reputation: 65

The exit set consists of all active states that are proper descendants of the LCCA of the source and target states. This means that all states will be exited, including P since LCCA must be a , not a

The entry set consists of all members of the transition's complete target set that will not be active once the states in the exit set have been exited.

Since there is no active states after exit, the entry set is B2, specfied in the transition's target, and the two default states A1 and C1. There is no 'memory' regarding which states were active before exit.

So "P, A, A1, B, B2, C and C1" is the correct answer

Upvotes: 0

Related Questions