##### Commons SCXML Resources

- Overview
- User Guide
- Javadoc
- FAQ
- Usecases
  - SCXML Stopwatch
  - SCXML in RDC group container
  - SCXML in Shale dialogs
- Building
- Dependencies
- Mailing lists
- Team
- SVN repository
- Nightly snapshots

##### Project Documentation

- About
- Project Info
- Project Reports
- Development Process

##### Commons

- Home
- Components
- Sandbox
- Dormant
- Volunteering
- Contributing Patches
- Building Components
- Releasing Components
- Wiki

##### Legend

- External Link
- Opens in a new window

## SCXML documents to configure RDC group container instances

Reusable Dialog Components (RDC) Framework is "a framework for creating JSP taglibs that aid in rapid development of voice and multimodal applications". The RDC Framework defines a `<group>` 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 aggregation. A Commons SCXML driven dialog management strategy has been incorporated into the RDC Framework, as seen here.

### Motivation

- SCXML semantics are based on UML state charts, and provide an easy transition from the modeling layer to the runtime artifacts.
- The SCXML based strategy is more expressive than the precursor strategies that were previously available in the RDC distribution.

## Example

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.

### UML Diagram

Here is the UML state machine diagram that represents this SCXML-based travel information speech dialog.

### Code

That gives us the following JSP snippet, if named variable `today` contains the MMddyyyy string for the current date:

      <rdc:group             id="travelInfo"
                        strategy="org.apache.taglibs.rdc.dm.SCXMLDialog"
                          config="travel-dialog.xml">

          <rdc:select1     id="tripType"
                         options="travel-types.xml"
                            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>

View the RDC documentation in Jakarta Taglibs for packaging and deployment as a web application.