W3C home > Mailing lists > Public > www-voice@w3.org > July to September 2006

RE: [scxml] Flow Control Elements

From: Barnett, James <James.Barnett@aspect.com>
Date: Wed, 12 Jul 2006 09:44:13 -0400
Message-ID: <57686697B4E28949A90094A6469165C75DE85A@ASP1EXCH1.aspect.com>
To: "Nestor Urquiza" <nestoru@yahoo.com>, <www-voice@w3.org>

Nestor,
 What you are asking for is not possible in SCXML because it's not
allowed in the underlying Harel semantics.  The executable content in
<onexit> handlers, transitions, and <onentry> handlers all run as a
single atomic operation before any events are processed or new
transitions taken. 

It is certainly possible to raise events inside these handlers, using
<send> but these events will not be processed until the <onentry>
handlers complete.  

The point behind this semantics is that you are guaranteed that <onexit>
and <onentry> handlers will execute whenever the relevant state is
exited or entered.  (Thus they are similar to pre- and post-conditions
in programming logics.)

You can get the kind of exception handling behavior you want using
normal state logic (e.g., null transitions with executable content,
<invoke>, etc.) - but you can't interrupt <onentry> or <onexit>
handlers.

- Jim

-----Original Message-----
From: www-voice-request@w3.org [mailto:www-voice-request@w3.org] On
Behalf Of Nestor Urquiza
Sent: Tuesday, July 11, 2006 3:59 PM
To: www-voice@w3.org
Subject: [scxml] Flow Control Elements


Hello guys,

I have been wondering how SCXML handles the case in
which being in an onentry handler the application
logic needs to fire a particular event.

The above can be achieved using control elements "if",
"elseif" and "else" together with "var" elements to
collect the information and so just apply the
transitions to specific states while evaluating those
"var". 

However, I am trying to find an alternative that
allows scxml to generate an internal event that is
supposed to take priority over the current execution.
Ideally that functionality would allow just to stop
the "onentry" handler flow and just execute the
"transition" associated to the internal thrown event.

Having if, else, elseif approach forces testing the
rest of the conditions which can contain executable
code as well. Think about this as a mean of a "break
onentry", "return", or even "exception handler" kind
of behavior.

I think the "send" datamodel operation can be used for
this purpose and what is not clear to me which would
be the syntax for the particular usecase I have been
describing above.
 

Thanks!,
Nestor




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Received on Wednesday, 12 July 2006 13:44:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 30 October 2006 12:49:03 GMT