SCXML Workflow Definition - BloomReach Experience - Open Source CMS

This article covers a Hippo CMS version 11. There's an updated version available that covers our most recent release.

04-07-2016

SCXML Workflow Definition

SCXML Workflow Definition

SCXML Workflow definitions are stored in the repository under a special SCXMLRegistry module configuration located at:

/hippo:configuration/hippo:modules/scxmlregistry/hippo:moduleconfig/hipposcxml:definitions

 This storage location uses the following namespace and nodetype definitions:

<'hipposcxml'='http://www.onehippo.org/jcr/hipposcxml/nt/1.0'>
<'nt'='http://www.jcp.org/jcr/nt/1.0'>
[hipposcxml:action] > nt:base
  - hipposcxml:classname (string) mandatory
  - hipposcxml:namespace (string) mandatory
[hipposcxml:scxml] > nt:base
  - hipposcxml:source (string) mandatory
  + * (hipposcxml:action) = hipposcxml:action
[hipposcxml:definitions] > nt:base
  + * (hipposcxml:scxml) = hipposcxml:scxml

As can be seen from this nodetype definition, you can create multiple SCXML Workflow definitions using nodetype hippscxml:scxml, which are identified by their node name.

Each SCXML definition itself consists of a String property containing the XML document source itself, and optionally additional hipposcxml:action child nodes defining custom actions for usage within the SCXML document.

Such hipposcxml:action configurations are referenced by their node name and namespace as configured through their hpposcxml:namespace property, which has to be declared with an appropriate prefix within the SCXML document.

The actual implementation of the action to be invoked is defined with the hipposcxml:classname property, which has be the fully qualified classname of a class extending the Apache Commons SCXML org.apache.commons.scxml2.model.Action class.

Convenient baseclasses for specific Hippo Workflow related usages are also available, like for example org.onehippo.repository.scxml.AbstractAction or org.onehippo.repository.scxml.AbstractWorkflowTaskAction.

More detailed information on using and implementing or extending such SCXML Workflow Actions is documented in SCXML Workflow Actions and Tasks.

The SCXMLRegistry

The org.onehippo.repository.scxml.SCXMLRegistry is a repository module registered as a service in the HippoServiceRegistry, and monitors its Repository configuration path for changes.

When changes are detected all configured SCXML Workflow definitions will be (re)loaded and first validated by the Apache Commons SCXML engine.

If validation fails for one or more of these definitions, their previously (valid) loaded SCXML Workflow definitions will be retained (if any), otherwise the newly loaded definitions will replace them. 

This auto-reloading of definitions is primarily provided for usage during development, but not intended to be (arbitrarily) used for production environments!

Note also that, while an SCXML definition might be successfully validated during loading, this only validates the SCXML document structure.

It does not guarantee that the state machine is functionally or even technically valid. 

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?