2

How can I define a "legal state configuration" according to https://www.w3.org/TR/scxml/#LegalStateConfigurations. I want to specify a target set (!), not a single target. Target sets can be defined inside the initial attribute of the <scxml> and <state> elements, as well as a target attribute of <transition> elements. But I can't seem to find any example of the notation of more than one state inside the above-mentioned attributes. Do they have to be space-separated? Or array notation according to JavaScript? Or object notation? Or comma-separated? Thanks for any hints.

But anyway I'd like to know, what I have missed in the standard, to be sure to be interpreter-independent.

Here's a little testcode:

<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0">
    <initial>
        <transition target="State_3_2 State_4_2" />
    </initial>
    <parallel id="Parallel_1">
        <history id="hist" type="deep">
            <transition target="State_1_2 State_2_2" />
        </history>
        <state id="State_1">
            <state id="State_1_1" />
            <state id="State_1_2" />
        </state>
        <state id="State_2">
            <state id="State_2_1" />
            <state id="State_2_2" />
        </state>
    </parallel>
    <parallel id="Parallel_2">
        <transition target="hist" event="switch_hist" />
        <state id="State_3">
            <state id="State_3_1" />
            <state id="State_3_2" />
        </state>
        <state id="State_4">
            <state id="State_4_1" />
            <state id="State_4_2" />
        </state>
    </parallel>
</scxml>

To test: on entry, the states State_3_2 and State_4_2 must be active (initial element executed correctly), after event switch_hist, states State_1_2 and State_2_2 must be active (transitionattribute executed correctly). If somebody has an interpreter all set other than SCION, could You test this there? Also the alternative syntax with the first 4 lines replaced by

<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initial="State_3_2 State_4_2">

Thank You.

Ruebe
  • 41
  • 4

1 Answers1

1

It is space-separated. You can see an example of this in the SCXML test test suite. For example line 9 of test364.

Hope this helps. Thanks.

jbeard4
  • 12,664
  • 4
  • 57
  • 67
  • Ok, thank You. SCION shows correct behaviour for this. But how about having a target set inside the `initial` _attribute_, i.e. inside the `` tag? Here, SCION fails. – Ruebe Apr 09 '18 at 09:32
  • This is a known issue in SCION: https://github.com/jbeard4/SCION/issues/390 Should be fixed soon. – jbeard4 Apr 11 '18 at 01:50