commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <>
Subject Re: [SCXML] initialstate required in external sub-state?
Date Fri, 09 Feb 2007 01:05:26 GMT
On 2/7/07, Wolfgang Frech <> wrote:
> Hi SCXML team and users!
> I started to play around with Commons SCXML, and stumbled over an
> inconsistent example in the working draft.
> On the one hand, the initialstate attribute of the scxml element is
> required (see attribute detail list of the scxml element).
> On the other hand, the example for an externally defined state
> (Test2Sub1.scxml) in Section F.1 does not have an initialstate attribute.

Error in that example, the attribute is needed.

> Logically, the initialstate attribute is not needed in an external state
> definition, because the one and only state that is extracted into the
> file is entered, when the remaining state stub in the including state
> chart is entered.

There is no requirement that the external state definition consist of
only one state (its recursive composition, a composite state can
contain a state machine -- or in other words, its mostly possible to
point to any SCXML document via the "src" attribute of the <state>

> As I read the spec, the example in the WD is in error relative to the
> normative part.
> As I understand the spec, the semantics of the initialstate  attribute
> for external states is not clear, at least for me.
> As I understand my experiments, Commons SCXML treats the initialstate
> attribute as required, following the WD.

Yes. If you want, you can point the error in the example to the W3C WG
(the list email is in the "Status of this Document" section of the
draft (you may want to subscribe first).

> What I do not understand: What semantics implemented?
> The error message for leaving out initialstate suggests:
> - the initialstate must be either the (extracted) parent state or a
> substate of it.
> - the initialstate attribute is evaluated.
> Is this correct?
> But: what if there is an initial child in the extracted state?
> Which takes precedence: a transition in initial, or the initialstate
> attribute?

"initialstate" attribute, but its not a either/or (there is no
<initial> child of the <scxml> element). Here is how it works
(discounting <parallel>):

0) Look at initialstate attribute value, error if absent
1) Go to state with ID as the attribute value, error if no such state
2) If state in (1) is a:
    a) simple or leaf state, done
    b) composite state, look up target specified by the <initial> transition
        i) Error if no such target
        ii) if target is simple, done
        iii) if target is composite, go to 2b

If a <parallel> is encountered along the way, all regions (child
states) must become active.

Once all initial leaf states are determined, we're done (the state
machine has come to rest).


A) Any <transition>s with no event attributes might cause the state
machine to progress further (if the cond attribute is absent or
evaluates to true).

B) The "initialstate" attribute or <initial> target can point to any
descendent, not necessarily an immediate child.

Some bits about SCXML documents are in the user guide [1]. It can
always be vastly improved, if you'd like to suggest (or contribute)
additions, they can come in through JIRA [2]. Site sources are here

Please let us know if you have other questions.



> Thanks for your help
> Wolfgang
> --
> Wolfgang Frech
> iteratec GmbH
> Inselkammerstra├če 4   D-82008 Unterhaching
> +49-89-61 45 51-64    Fax: -10

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message