RE: [scxml] semantics of targetless transition versus Rhapsody Static Reactions

I'm not sure about your references as I'm not familiar with Rhapsody and it has been a while since I've read up on STATEMATE, but to answer your code question, yes, the effect of an event bar occurring while in the atomic state foo would be for the doSomething() script to be run and the state machine configuration to stay in foo (assuming nothing else "weird" is going on elsewhere in the state machine, for instance a parallel ancestor and a different parallel region having a transition on bar that leaves the parallel region).

The eventless transitions have a priority of sorts over transitions based on events in that the matching eventless transitions will be selected before an event is taken from the queue.  But once an event is taken from the queue (either internal or external), then any eligible transition may fire, and the priority order is the most local transition will fire, with equally local transitions being tie broken by document order so the first transition "wins".  If you reverse the order of your two transitions then the transition that goes to state bat will win and the doSomething() would not occur.  So the presence or absence of a target (or of a satisfied condition or of actions on the transition) has no effect on which transition will be taken.

From: [] On Behalf Of Jacob Beard
Sent: Tuesday, January 04, 2011 4:09 PM
To: www-voice
Subject: [scxml] semantics of targetless transition versus Rhapsody Static Reactions


I have some questions about the semantics of targetless transitions as defined in the SCXML specification versus the semantics of Static Reactions described in "The Rhapsody Semantics of Statecharts".

First of all, the SCXML spec says here<> that a targetless transition "is equivalent to an event handler in Harel State Table notation".  Unfortunately, I have not been able to find a reference to an "event handler" in "The Rhapsody Semantics of Statecharts" or "The STATEMATE Semantics of Statecharts". However, both papers describe Static Reactions, and the semantics seem to be similar to targetless transitions in SCXML. In drawing a comparison to Harel Statecharts, would it be better for the SCXML specification to use the term "Static Reaction" as opposed to "event handler"?

Second, in "The Rhapsody Semantics of Statecharts", in Section 8, "The Basic Step Algorithm, Harel states that Compound Transitions are given priority over Static Reactions. What I was hoping someone could confirm is that the Algorithm for SCXML Interpretation doesn't respect this constraint. So, given the following SCXML snippet, if we are in state "foo", then on event "bar", doSomething() will be triggered and the statechart will stay in "foo":

<state id="foo">
    <transition event="bar">
    <transition event="bar" target="bat"/>

The reason for this is that transitions are selected with priority based on document order, regardless of whether or not they have a target. This is my understanding of the logic in function selectTransitions.

I'd appreciate any guidance anyone can offer. Thanks,


Received on Wednesday, 5 January 2011 00:42:45 UTC