SCXML Workflow Engine
Overview
Bloomreach Content includes a workflow engine based on SCXML (State Chart XML). This engine uses the open source Apache Commons SCXML 2.0 library and follows the W3C State Chart XML (SCXML) specification to execute workflow definitions as state machines.
Bloomreach Content extends the Apache Commons SCXML library to integrate with repository content and workflow APIs. These enhancements enable transparent, customizable workflow execution within the platform.
A workflow definition in Bloomreach Content is an XML document stored in the repository. This definition can include custom actions, which the SCXML workflow state machine can invoke.
The following screenshots show where the SCXML DocumentWorkflow is defined in the SCXMLRegistry module configuration:

Partial view of the documentworkflow SCXML definition.

Configuration of a custom SCXML action for use in the documentworkflow definition.
SCXML Workflow Execution
To execute a workflow state machine, use the org.onehippo.repository.scxml.SCXMLWorkflowExecutor class. Instantiate and configure this executor within your workflow implementation. Most workflow operations can be delegated to the SCXML workflow state machine by triggering a workflow action—optionally with a payload—using the SCXMLWorkflowExecutor. This triggers a SCXML event within the state machine.
To pass workflow-specific input data to the SCXML state machine, implement the org.onehippo.repository.scxml.SCXMLWorkflowData interface. The state machine communicates its current state and any result data through a org.onehippo.repository.scxml.SCXMLWorkflowContext object.
Because the state of a SCXML workflow state machine often depends on volatile repository (JCR) content, always (re)start the SCXML state machine with the SCXMLWorkflowExecutor before accessing the SCXMLWorkflowContext or SCXMLWorkflowData. This prevents stale information.
For detailed setup and usage instructions, see:
The DocumentWorkflow is implemented using the SCXML Workflow Engine and serves as a comprehensive example.
SCXML Workflow Engine Features
Standard SCXML Features
A SCXML workflow definition supports:
- One or more states, including compound and parallel states
- Transitions between states
- Executable content such as custom actions, scripts, and process control elements (if, elseif, else, foreach)
- External data access and manipulation
Unsupported SCXML Features
The following SCXML specification features are not supported or are only partially supported:
- External communications
- Internal session management
- Embedded datamodel usage (XPath-based or otherwise)
Future releases may add support for some of these features.
Apache Commons SCXML 2.0 Features
Commons SCXML 2.0 provides:
- Groovy as an expression and scripting language
- Pluggable custom Java actions usable within SCXML definitions
Bloomreach SCXML Workflow Engine Extensions
The Bloomreach SCXML Workflow Engine adds:
- Storage of SCXML workflow definitions in the repository
- A generic framework for invoking SCXML state machines
- State and data communication between the workflow and the SCXML state machine using
SCXMLWorkflowContextandSCXMLWorkflowData - Base custom SCXML actions for managing state and data communication
DocumentWorkflow Implementation Features
The DocumentWorkflow uses a SCXML workflow definition and provides specific SCXML actions. You can use these actions as references or building blocks for other SCXML workflow definitions.
SCXML Standards and Library Versions
The SCXML Workflow Engine in Bloomreach Content uses Apache Commons SCXML 2.0 to execute state machines defined according to the W3C SCXML specification.
Apache Commons SCXML 2.0 is not yet formally released. You can track the project's progress and roadmap on the Apache Commons SCXML Roadmap.
Bloomreach Content currently uses the stable, tagged Commons SCXML 2.0 milestone 1. Only a subset of SCXML features is required and supported for repository workflow operations.
Bloomreach contributes to the development of Commons SCXML 2.0. Until the final release is available, Bloomreach bundles a stable, verified build of the library with the repository.
When defining SCXML workflow state machines, follow the W3C SCXML specification for the supported feature set. Apache Commons SCXML also provides an extensible API for implementing custom state machine logic.