W3C

State Chart XML (SCXML): State Machine Notation for Control Abstraction

W3C Recommendation 1 September 2015

This version:
http://www.w3.org/TR/2015/REC-scxml-20150901/
Latest version:
http://www.w3.org/TR/scxml/
Previous version:
http://www.w3.org/TR/2015/PR-scxml-20150430/
Editors:
Jim Barnett, Genesys (Editor-in-Chief)
Rahul Akolkar, IBM
RJ Auburn, Voxeo
Michael Bodell, (until 2012, when at Microsoft)
Daniel C. Burnett, Voxeo
Jerry Carter, (until 2008, when at Nuance)
Scott McGlashan, (until 2011, when at HP)
Torbjörn Lager, Invited Expert
Mark Helbing, (until 2006, when at Nuance)
Rafah Hosn, (until 2008, when at IBM)
T.V. Raman, (until 2005, when at IBM)
Klaus Reifenrath, (until 2006, when at Nuance)
No'am Rosenthal, (until 2009, when at Nokia)
Johan Roxendal, Invited Expert

Please refer to the errata for this document, which may include normative corrections.

See also translations.


Abstract

This document describes SCXML, or the "State Chart extensible Markup Language". SCXML provides a generic state-machine based execution environment based on CCXML and Harel State Tables.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This is the Recommendation of SCXML Version 1.0. It has been published by the Voice Browser Working Group, which is part of the Voice Browser Activity.

Comments are welcome at [email protected] (archive). See W3C mailing list and archive usage guidelines.

This specification has been widely reviewed (see the Third Last Call Working Draft Disposition of Comments) and satisfies the Working Group's technical requirements. A list of implementations is included in the SCXML 1.0 Implementation Report, along with the associated test suite. The Working Group removed an unused reference to ECMASCRIPT-327 based on a public comment, updated the broken link for E4X, and fixed typos. However, there are no substantial changes from the 30 April Proposded Recommendation.

This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.

This document has been produced as part of the Voice Browser Activity (activity statement), following the procedures set out for the W3C Process. The authors of this document are members of the Voice Browser Working Group.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 14 October 2005 W3C Process Document.

The sections of this document are normative unless otherwise specified.

Table of Contents

1 Terminology
2 Overview
3 Core Constructs
    3.1 Introduction
    3.2
    3.3
    3.4
    3.5
    3.6
    3.7
    3.8
    3.9
    3.10
    3.11 Legal State Configurations and Specifications
    3.12 SCXML Events
    3.13 Selecting and Executing Transitions
    3.14 IDs
4 Executable Content
    4.1 Introduction
    4.2
    4.3
    4.4
    4.5
    4.6
    4.7
    4.8 Other Executable Content
    4.9 Evaluation of Executable Content
    4.10 Extensibility of Executable Content
5 Data Model and Data Manipulation
    5.1 Introduction
    5.2
    5.3
    5.4
    5.5
    5.6
    5.7
    5.8 ....

A Conformance

[This section is normative.]

A.1 Conforming Documents

The following conformance requirements hold for all SCXML documents.

  1. The root element of the document MUST be .
  2. The element MUST include a "version" attribute with the value "1.0".
  3. The element MUST designate the SCXML namespace. This can be achieved by declaring an "xmlns" attribute or an attribute with an "xmlns" prefix [XMLNames]. The namespace for SCXML is defined to be http://www.w3.org/2005/07/scxml.
  4. The document MUST conform to all the syntactic constraints defined in this specification, including those contained in the schema, those contained in the "Attribute Constraints" and "Valid Values" fields in the attribute tables, and those contained in the definition of its children.
  5. The document MUST conform to any additional syntactic constraints that are defined for the data model that it has chosen. See B Data Models for the definition of the individual data models.

A.2 Conforming Processors

A SCXML 1.0 processor is a user agent that can parse and process Conforming SCXML 1.0 documents.

In a Conforming SCXML 1.0 Processor, the XML parser MUST be able to parse and process all well-formed XML constructs defined within [XML] and [XMLNames]. It is not required that a Conforming SCXML 1.0 processor use a validating parser.

A Conforming SCXML 1.0 Processor MUST support the syntax and semantics of all mandatory SCXML elements described in this document. A Conforming SCXML 1.0 Processor MAY support the syntax and semantics of any optional SCXML elements described in this document.

When a Conforming SCXML 1.0 Processor encounters a non-conformant document, or one containing non-SCXML elements or attributes which are proprietary, or defined in a non-SCXML namespace, its behavior is undefined.

There is no conformance requirement with respect to performance characteristics of the SCXML 1.0 Processor.

B Data Models

[This section is normative.]

The 'datamodel' attribute on defines the data model that the document uses. The data model includes the underlying data structure plus languages for boolean expressions, location expressions, value expressions, and scripting. A conformant SCXML document MAY specify the data model it uses. Conformant SCXML processors MUST support the null data model, and MAY support other data models, including the ECMAScript and XPath data models. The ECMAScript and XPath model definitions given here are normative in the sense that they define how implementations that support one of these languages MUST behave. The intent is to ensure interoperability among all processors that support ECMAScript, and all those that support XPath, without requiring all implementations to support either of those data model languages.

The definition of a data model MUST:

The following example shows a the control flow for a blackjack game.

Example: Blackjack


 
    
      
    
    
     
     
    
      
        
      
      
        
          
        
      
      
    

    
      
        
      
      
    

    
      
        
      
      
    

    
      
        
      
      
        
        
        
        
        
      
      
    

    
      
        
        
          
        
      
      
      
    

    
      
        
        
        
      
      
       
    

    
      
        
      
      
        
        
        
      
      
      
    

    
      
       
      
      
      
    
  



G.6 Inline Content and Namespaces

Since SCXML documents are XML documents, normal XML namespace rules apply to inline content specified with and . In particular, if no namespace is specified, the inline content will be placed in the SCXML namespace. Consider the following example:

The recipient of the message will see the following:

The following markup would cause the message to be delivered without namespaces:

The recipient of the message will see the following:

The sender can also specify multiple namespaces:

     

 
   
      1
      2
      3
   
 

 

In this case, the receiver would see:

  
  
      1
      3
  
 

G.7 Custom Action Elements

Custom Action Elements can be defined in other specifications/namespaces and are responsible for performing actions on behalf of custom components. Logically Custom Action Elements can be thought of as a collection of actions and handlers to perform specific tasks. An example of this is a CCXML element that is a Custom Action Element:


  

This could be written using a element using the following syntax:





  
  

A more complicated example might be a CCXML where you are both providing variables and getting values back that using only the syntax would be more complex as it would need to be broken over several steps. For example:


   

Would need to be modeled in two steps using as you would need to do something like the following:


  
  


  


   

The exact mappings between Custom Action Elements and actions are to be defined in the individual Custom Action Element specifications.

H MIME Type

[This section is normative.]

This appendix registers a new MIME media type, "application/scxml+xml".

The "application/scxml+xml" media type is being submitted to the IESG for review, approval, and registration with IANA.

H.1 Registration of MIME media type application/scxml+xml

MIME media type name:
application
MIME subtype name:
scxml+xml
Required parameters:
None
Optional parameters:
charset
This parameter has identical semantics to the charset parameter of the application/xml media type as specified in [RFC 3023] or its successor.
Encoding considerations:
By virtue of SCXML content being XML, it has the same considerations when sent as "application/scxml+xml"as does XML. See [RFC 3023] (or its successor), section 3.2.
Security considerations:
SCXML elements may include arbitrary URIs. Therefore, the security issues of [RFC 3986] section 7 should be considered. In addition, because of the extensibility features for SCXML, it is possible that "application/scxml+xml" may describe content that has security implications beyond those described here. However, if the processor follows only the normative semantics of this specification, this content will be ignored. Only in the case where the processor recognizes and processes the additional content, or where further processing of that content is dispatched to other processors, would security issues potentially arise. And in that case, they would fall outside the domain of this registration document.
Interoperability considerations:
This specification describes processing semantics that dictate behavior that must be followed when dealing with, among other things, unrecognized elements.Because SCXML is extensible, conformant "application/scxml+xml" processors MAY expect that content received is well-formed XML, but processors SHOULD NOT assume that the content is valid SCXML or expect to recognize all of the elements and attributes in the document.
Published specification:
This media type registration is extracted from Appendix H of the State Chart XML (SCXML): State Machine Notation for Control Abstraction specification.
Additional information:
Magic number(s):
There is no single initial octet sequence that is always present in SCXML documents.
File extension(s):
SCXML documents are most often identified with the extensions ".scxml".
Macintosh File Type Code(s):
TEXT
Person and email address to contact for further information:
Kazuyuki Ashimura, <[email protected]>.
Intended usage:
COMMON
Restrictions on usage:
None
Author:
The SCXML specification is a work product of the World Wide Web Consortium's Voice Browser Working Group.
Change controller:
The W3C has change control over these specifications.

H.2 Fragment Identifiers

For documents labeled as "application/scxml+xml", the fragment identifier notation is exactly that for "application/xml", as specified in RFC 3023.

I References

I.1 Normative References

ECMASCRIPT-262
ECMAScript Language Specification. Standard ECMA-262, Edition 5.1 ECMA. June 2011. (See http://www.ecma-international.org/publications/standards/Ecma-262.htm.)
E4X
ECMAScript for XML (E4X) Specification Standard ECMA-357, 2nd Edition, December 2005. (See http://www.ecma-international.org/publications/files/ECMA-ST-WITHDRAWN/Ecma-357.pdf.)
RFC 2119
RFC 2119: Key words for use in RFCs to Indicate Requirement Levels Internet Engineering Task Force. March 1997. (See http://www.ietf.org/rfc/rfc2119.txt.)
RFC 2396
RFC 2396: Uniform Resource Identifiers Internet Engineering Task Force. August 1998. (See http://www.ietf.org/rfc/rfc2396.txt.)
RFC 2616
RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1 Internet Engineering Task Force. June 1999. (See http://www.ietf.org/rfc/rfc2616.txt.)
RFC 4627
The application/json Media Type for JavaScript Object Notation (JSON) Internet Engineering Task Force. July 2006. (See http://www.ietf.org/rfc/rfc4627.txt.)
RFC 3023
RFC 3023: XML Media Types. Internet Engineering Task Force. January 2001. (See http://www.ietf.org/rfc/rfc3023.txt.)
RFC 3986
RFC 3986: Uniform Resource Identifier (URI): Generic Syntax. Internet Engineering Task Force. January 2005. (See http://www.ietf.org/rfc/rfc3986.txt.)
XML
Extensible Markup Language (XML) 1.0 (Fifth Edition) World Wide Web Consortium. W3C Recommendation, November 2008 (See http://www.w3.org/TR/xml/.)
XMLNames
Namespaces in XML 1.0 (Second Edition) World Wide Web Consortium. W3C Recommendation, August 2006 (See http://www.w3.org/TR/2006/REC-xml-names-20060816/.)
XML Schema
XML Schema Part 2: Datatypes Second Edition World Wide Web Consortium. W3C Recommendation, October 2004. (See http://www.w3.org/TR/xmlschema-2/.)

I.2 Informative References

ebXML
ebXML Business Process Specification Schema v2.0 (See https://www.oasis-open.org/committees/documents.php?wg_abbrev=ebxml-bp.)
EL
EL: The JSP 2.0 Expression Language Interpreter (See http://commons.apache.org/el/.)
Harel and Politi
Modeling Reactive Systems with Statecharts: The STATEMATE Approach By D. Harel and M. Politi. McGraw-Hill, 1998. (See http://www.wisdom.weizmann.ac.il/~dharel/reactive_systems.html.)
CCXML 1.0
Voice Browser Call Control: CCXML Version 1.0 World Wide Web Consortium. W3C Recommendation, July 2011. (See http://www.w3.org/TR/2011/REC-ccxml-20110705/.)
VoiceXML 2.0
VoiceXML 2.0: World Wide Web Consortium. W3C Recommendation, March 2004. (See http://www.w3.org/TR/voicexml20/.)
UML 2.3
UML Specification Version 2.3 OMG, 2009. (See http://www.omg.org/spec/UML/2.3/.)
xinclude
XML Inclusions (XInclude) Version 1.0 (Second Editiion) W3C Recommendation, 2006. (See http://www.w3.org/TR/xinclude/.)
UML XMI
XML Metadata Exchange version 2.4.1 OMG. August 2011. (See http://www.omg.org/spec/XMI/.)
XTND
XML Transition Network Definition World Wide Web Consortium. W3C Note, November 2000. (See http://www.w3.org/TR/2000/NOTE-xtnd-20001121/.)