W3C home > Mailing lists > Public > www-voice@w3.org > April to June 2007

SCXML: <send> and <event>

From: Torbjörn Lager <torbjorn.lager@gmail.com>
Date: Tue, 15 May 2007 18:29:15 +0200
Message-ID: <6ad4bdae0705150929o4b6d77adj76792ebc2d82658c@mail.gmail.com>
To: www-voice@w3.org

Hi All,

Based on my attempts (soon to be released in Synergy SCXML-Lab) to
make <send> and <event> behave more in accordance with the current
draft, I have come up with couple of suggestions that deviate somewhat
from what is said in the draft. Nothing radical, just a few small
things.

Suppose that we have three machines m0, m1 and m2, where m0 has
invoked m1 and m1 has invoked m2 (m0 may in fact be the runtime
environment of the SCXML interpreter, e.g. the OS), and that we are
executing a <send> in m1. In my understanding of the current
specification here's how we

 1. add "e" to the external queue of m0:

    <send event="e" target="'m0'"/>
    <send event="e" target="_caller"/>

 2. add "e" to the external queue of m1:

    <send event="e"/>
    <send event="e" target="'m1'"/>
    <send event="e" target="_self"/>

 3. add "e" to the external queue of m2:

    <send event="e" target="'m2'"/>

 4. add "e" to the internal queue of m1:

    <event name="e"/>

Based on my experiences implementing an playing with this, I have a
couple of comments:

1. My first comment is simply terminological. I think the term
"external queue" is confusing. I would much prefer the term "input
queue" instead, which more clearly describes its role.

2. I think the draft gets the default for 'target' wrong. In my view
it makes more sense to make '_caller' the default here, since
returning events from an invoked machine to an invoking machine (which
could be the runtime environment of the SCXML interpreter) is probably
a common thing to do, and, as far as I can see, a machine adding
events to its own *external* queue probably isn't very common. (It is
of course important for a machine to be able to add events to its own
*internal* queue.)

3. As I have said in an earlier name, I don't think "event" (as in
<event>) is a good name for a piece of executable content. I'm
suggesting using "raise" instead, with an attribute 'event', in
analogy with <send>.

So, here's how I suggest it should work. In m1, to

 1. add "e" to the input queue of m0:

    <send event="e"/>
    <send event="e" target="'m0'"/>
    <send event="e" target="_caller"/>

 2. add "e" to the input queue of m1:

    <send event="e" target="'m1'"/>
    <send event="e" target="_self"/>

 3. add "e" to the input queue of m2:

    <send event="e" target="'m2'"/>

 4. add "e" to the internal queue of m1:

    <raise event="e"/>


Regards,
Torbjörn
Received on Tuesday, 15 May 2007 16:29:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 15 May 2007 16:29:21 GMT