##### Commons SCXML Resources

- Overview
- User Guide
  - SCXML documents
  - Using Commons SCXML
  - Standalone Testing
  - SCXML Parser
  - SCXML datamodel
  - Contexts and Evaluators
  - SCXML Engine
  - Triggering Events
  - Custom Actions
  - Custom Semantics
  - Side Effect - EL
- Javadoc
- FAQ
- Usecases
- Building
- Dependencies
- Mailing lists
- Team
- SVN repository
- Nightly snapshots

##### Releases

- Version 0.7
- Version 0.6
- Version 0.5

##### 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

## Commons SCXML - Standalone testing, trying out samples

The SCXML distribution provides utility classes that offer a mock command line environments allowing users to try out samples. The core dependencies for Commons SCXML are Commons Digester (which introduces a transitive dependency on Commons BeanUtils, at the least) and Commons Logging.

View the dependencies page for the recommended version numbers. It may be possible to use lower version numbers for the Commons dependencies.

An environment specific expression language is used in SCXML documents. Commons SCXML currently supports the use of JEXL or JSP 2.0 EL in SCXML documents.

### Using JEXL in SCXML documents

The JEXL Standalone class anticipates expressions in JEXL and hence requires commons-jexl.jar.

So that amounts to (use the correct local paths and filenames to the `jar` files and the SCXML document, without the line breaks):

        java -classpath

        commons-digester-1.7.jar;commons-beanutils-1.7.0.jar;
        commons-logging-1.0.4.jar;commons-scxml-1.0-SNAPSHOT.jar;
        commons-jexl-1.0.jar

        org.apache.commons.scxml.test.StandaloneJexlExpressions

        microwave01.xml

### Using JSP 2.0 EL in SCXML documents

The JSP Standalone class anticipates expressions in the JSP 2.0 Expression Language, and hence requires commons-el.jar and jsp-api.jar.

So that amounts to (use the correct local paths and filenames to the `jar` files and the SCXML document, without the line breaks):

        java -classpath

        commons-digester-1.7.jar;commons-beanutils-1.7.0.jar;
        commons-logging-1.0.4.jar;commons-scxml-1.0-SNAPSHOT.jar;
        commons-el-1.0.jar;jsp-api-2.0.jar

        org.apache.commons.scxml.test.StandaloneElExpressions

        microwave01.xml

You could set up something more elegant (a script, an ant task etc.), but that is what it boils down to. If the document is a well-formed SCXML document, you will be able to type ? or help at the console and you can follow the directions thereafter (to simulate events, set variable values, reset the state machine or quit).

A few examples are available as part of the Commons SCXML test suite (look in env.jexl and env.jsp child packages as well).