commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <>
Subject Re: [SCXML] Help with SCXML Send usage
Date Tue, 06 Dec 2005 07:01:39 GMT
Hi Mike -

This is an interesting question, but before I attempt to answer --
I've modified the email subject with a [SCXML] prefix, please try to
add the prefix when you start a thread, since some of us have email
filters set up.

On 12/5/05, Mike Sparr - <> wrote:
> We are trying to parse/use the content between <send> </send> tags and
> everything we try using the SCXML digester and Send methods retrieves
> null.  We have successfully captured the <var> values, but nothing
> within <send> tags.  Can you please provide information on how to
> retrieve this content using the code?  Our SCXML test document is below:
> <?xml version="1.0"?>
> <scxml xmlns=""
>       version="1.0"
>       initialstate="logoff">
>  <state id="logoff">
>    <onentry>
>      <var name="drink" expr="water" />
>        <var name="eat" expr="flies" />
>        <send target="http://localhost:8080/VXMLInterpreter"
> targettype="v3" xmlns:v3=""
> namelist="drink eat" event="" hints="" sendid="" delay="0">
>            <v3:form id="Welcome">
>              <v3:block><v3:prompt>Please enter your
> name.</v3:prompt></v3:block>
>            </v3:form>
>          </send>
>        <log expr="'@@@@@@executed send@@@@@@@@'"/>
>      <cancel sendId="send12345"/>
>    </onentry>
>    <transition event="go_login">
>      <target next="login"/>
>    </transition>
>  </state>
>  <state id="login">
>      <transition event="go_logoff">
>        <target next="logoff"/>
>     </transition>
>  </state>
> </scxml>
> Please help in allowing us to get the SCXML code to work.  We've tried
> getExternalNodes() within Send and looked into the Rules for digester
> and do not know how to retrieve the <send>text</send> body elements.

Sorry, that digester rule is not in the current SCXMLDigester [1]. Let
me take this up as a TODO for myself, I'll try to get to this during
the upcoming weekend. I'll attempt to use NodeCreateRule [2] to
prepare the external nodes, but since we also need to process the
known bits of the SCXML <send> element, there'll be more than one
digester rule involved.

This will allow the SCXML engine to react to external namespaces, as
long as the EventDispatcher [3] can locate a suitable namespace
handler. I believe SCXML has much promise when it comes to playing in
Compound Document Frameworks.

Having said that, a different approach is equally powerful, and
available immediately. I have written applications which do exactly
what you're alluding to above i.e. thinking of conversations as states
and transitions where each state has a corresponding activity which
might be a dialog of arbitrary complexity (one or more prompts and
replies, client side interaction or even multiple round trips to the

IIRC you've looked at the RDC framework [4], and it provides a SCXML
dialog management strategy for the group container [5]. A very simple,
fictitious use case example is here [6] for which the SCXML controller
is here [7]. Wrapping each activity in a RDC gives us:

a) A separation between the controller and the view
b) The interaction that needs to happen when you're in a particular
state can be fairly involved including any number of client server
round trips
c) You can make decisions about the transition you'd want to follow
based on prior interaction(s)

The separation in (a) is especially useful if you're authoring
multi-channel applications (voice, GUI, small device) since it
encourages reuse across different view layer markup. We have a multi
channel example [8] in the RDC distro which uses Struts wildcard
mappings and I've also demonstrated a proof of concept of how SCXML
can play in Struts Shale.

Please let me know if you have any other questions about SCXML, or how
it can be used to control a VoiceXML based conversation.



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

View raw message