Re: bad initial target in the SCXML document example

Le 13 feb 2013 à 10:01, spam.spam.spam.spam@free.fr a écrit :

> In the G.3 [1] section, I can read:
> '<state id="engine">
>      <transition target="off"/>'
> 
> As this is a transition without condition or event, I guess that this is an initial transition.

No. <initial> transitions are taken during the entry step of a microstep, whenever their parent state is entered and only if none of its children states is a target in the current microstep; moreover, they are not eligible to be enabled during the transition selection step, they cannot have a condition or event, they must have a target and that target must be internal. So while they work internally like transitions, they are restricted and not really transitions from the general SC's point of view.

On the other hand, there is an eventless microstep before popping events from the queues. An eventless and inconditional transition like the one you show may have external targets, be ignored if a previous eventless transition has a true condition, or preempted by another eventless transition, and it may be targetless too. So they work just like other transitions except they don't need an event and have priority over those that do.

In the example you cite, there would be no practical difference between the eventless transition shown and an <initial> transition. But it's a razor-thin edge case.

			David

Received on Wednesday, 13 February 2013 10:33:36 UTC