##### Commons SCXML Resources

- Overview
- User Guide
- Javadoc
- FAQ
- Usecases
- Building
- Dependencies
- Mailing lists
- Team
- SVN repository
- Nightly snapshots

##### Releases

- Version 0.6
- Version 0.5

##### Project Documentation

- About SCXML
- Project Info
- Project Reports
  - Changes
  - Checkstyle
  - Cobertura
  - FAQs
  - JavaDocs
  - JavaDoc Report
  - JavaDoc Warnings Report
  - Unit Tests
  - Source Xref
  - Test Xref
  - Project License
- Development Process

##### Commons

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

## Commons SCXML FAQ

General

1. What is SCXML?
2. What is Commons SCXML?
3. Do you have a simple example where Commons SCXML is used?
4. What are the core requirements of SCXML? Do I need to include the JSP and Servlet API or the Faces libraries?

Expression languages

1. Which expression languages does the Commons SCXML implementation support?
2. Can I use more than one expression language in the same SCXML document?

The SCXMLExecutor

1. Once I set up an SCXMLExecutor (call the constructor, set the state machine) is there anything I have to do to "activate" it?
2. Can I have multiple instances of SCXMLExecutor all working off of a single instance of the SCXML class?
3. Can multiple threads safely interact with an instance of SCXMLExecutor?
4. Are SCXMLExecutor instances serializable?

## General

General

What is SCXML?
  State Chart XML (SCXML) is a general-purpose event-based state machine language that can be used in many ways. It is currently a W3C Working Draft, available here.

What is Commons SCXML?
  Commons SCXML is aimed at creating and maintaining an open-source Java SCXML engine capable of executing a state machine defined using a SCXML document, while abstracting out the environment interfaces.

Do you have a simple example where Commons SCXML is used?
  Sure, take a look at the stopwatch usecase.

What are the core requirements of SCXML? Do I need to include the JSP and Servlet API or the Faces libraries?
  The "core" requirements for Commons SCXML are Commons Digester and Commons Logging. Commons Digester, at the minimum (if you use Commons Digester 1.7+), has a runtime dependency on Commons BeanUtils. You do not need to include JSP or Servlet or Faces libraries. These are meant to come in via the servlet container (if at all you need them). You will need to choose an expression language for your SCXML documents (details in next section of this FAQ). See the dependencies page for details about the dependency versions.

## Expression languages

Expression languages

Which expression languages does the Commons SCXML implementation support?
  Commons SCXML currently supports Commons JEXL and Commons EL. For details, see the trying out and contexts and evaluators pages of the user guide.

Can I use more than one expression language in the same SCXML document?
  No, the expressions throughout the document must be homogeneous. This also applies to any external documents that may be refered by this document, for example via "src" attributes.

## The SCXMLExecutor

The SCXMLExecutor

Once I set up an SCXMLExecutor (call the constructor, set the state machine) is there anything I have to do to "activate" it?
  Yes, you must call the marker method, SCXMLExecutor#go(). This serves as an indication that you have finished configuring the SCXMLExecutor instance and are now ready to begin executing the state machine described by your SCXML document. For example, you may attach zero, one or many SCXMLListeners to interesting "nodes" within the SCXML document, such as the document root i.e. the SCXML object, and/or particular State and Transition objects as well. See the SCXMLExecutor section of the user guide for more.

Can I have multiple instances of SCXMLExecutor all working off of a single instance of the SCXML class?
  Yes. The Commons SCXML object model does not store any information related to a particular execution of the state machine. It is therefore possible to use a single SCXML instance as the state machine for multiple SCXMLExecutor instances. This also means that a SCXML document needs to be parsed only once, irrespective of the number of "instances" of the state machine that may execute.

Can multiple threads safely interact with an instance of SCXMLExecutor?
  To a certain extent. Things such as firing events on a state machine or reseting it are threadsafe. The underlying state machine needs to model any race conditions correctly. You have to worry about synchronizing access to other bits if you need to.

Are SCXMLExecutor instances serializable?
  Yes, as long as all associated user-defined content is too.