blob: 281085f4a8aae8098df25c463b6180e3adcd041c [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<document>
<properties>
<title>Commons SCXML Usecases - Dialog Management Strategy for rdc:group</title>
<author email="dev@commons.apache.org">Commons Documentation Team</author>
</properties>
<body>
<section name="SCXML documents to configure RDC group container instances">
<p><a href="http://jakarta.apache.org/taglibs/doc/rdc-doc/intro.html">
Reusable Dialog Components (RDC) Framework</a> is &quot;<i>a framework
for creating JSP taglibs that aid in rapid development of voice and
multimodal applications</i>&quot;. The RDC Framework defines a
<code>&lt;group&gt;</code> container for aggregating multiple components
in one view. The dialog management across the child components for a
group is pluggable, more details are available on this RDC wiki page on
<a href="http://wiki.apache.org/jakarta-taglibs/ReusableDialogComponents/Tutorials/Aggregation">
aggregation</a>. A Commons SCXML driven dialog management strategy has
been incorporated into the RDC Framework, as seen
<a href="http://svn.apache.org/repos/asf/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/dm/">
here</a>.
</p>
<subsection name="Motivation">
<ul>
<li><a href="http://www.w3.org/TR/scxml">SCXML</a> semantics are based
on UML state charts, and provide an easy transition from the modeling
layer to the runtime artifacts.</li>
<li>The SCXML based strategy is more expressive than the precursor
strategies that were previously available in the RDC distribution.</li>
</ul>
</subsection>
</section>
<section name="Example">
<p>To illustrate the use of the SCXML strategy for &lt;rdc:group&gt;,
consider a simple air travel information speech dialog, which prompts
the user for the trip type (one way or round trip), and collect either
one travel date or two depending on the answer.</p>
<subsection name="UML Diagram">
<p>Here is the
<a href="rdc-group/travel-info.jpg">UML state machine diagram</a>
that represents this SCXML-based travel information speech dialog.</p>
</subsection>
<subsection name="Code">
<p>That gives us the following JSP snippet, if named variable
<code>today</code> contains the <i>MMddyyyy</i> string for the
current date:</p>
<pre>
&lt;rdc:group id=&quot;travelInfo&quot;
strategy=&quot;org.apache.taglibs.rdc.dm.SCXMLDialog&quot;
config=&quot;<a href="rdc-group/travel-dialog.xml">travel-dialog.xml</a>&quot;&gt;
&lt;rdc:select1 id=&quot;tripType&quot;
options=&quot;<a href="rdc-group/travel-types.xml">travel-types.xml</a>&quot;
echo=&quot;true&quot; /&gt;
&lt;rdc:usMajorCity id=&quot;departureCity&quot; /&gt;
&lt;rdc:usMajorCity id=&quot;arrivalCity&quot; /&gt;
&lt;rdc:date id=&quot;departureDate&quot;
minDate=&quot;${today}&quot;
confirm=&quot;true&quot;/&gt;
&lt;rdc:date id=&quot;arrivalDate&quot;
minDate=&quot;${departureDate}&quot;
confirm=&quot;true&quot; /&gt;
&lt;/rdc:group&gt;
</pre>
<p>View the RDC documentation in Jakarta Taglibs for packaging and
deployment as a web application.</p>
</subsection>
</section>
</body>
</document>