| <?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 "<i>a framework |
| for creating JSP taglibs that aid in rapid development of voice and |
| multimodal applications</i>". The RDC Framework defines a |
| <code><group></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 <rdc:group>, |
| 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> |
| <rdc:group id="travelInfo" |
| strategy="org.apache.taglibs.rdc.dm.SCXMLDialog" |
| config="<a href="rdc-group/travel-dialog.xml">travel-dialog.xml</a>"> |
| |
| <rdc:select1 id="tripType" |
| options="<a href="rdc-group/travel-types.xml">travel-types.xml</a>" |
| echo="true" /> |
| |
| <rdc:usMajorCity id="departureCity" /> |
| |
| <rdc:usMajorCity id="arrivalCity" /> |
| |
| <rdc:date id="departureDate" |
| minDate="${today}" |
| confirm="true"/> |
| |
| <rdc:date id="arrivalDate" |
| minDate="${departureDate}" |
| confirm="true" /> |
| |
| </rdc:group> |
| </pre> |
| |
| <p>View the RDC documentation in Jakarta Taglibs for packaging and |
| deployment as a web application.</p> |
| </subsection> |
| |
| </section> |
| |
| </body> |
| |
| </document> |