Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 3.28 KB

script.md

File metadata and controls

59 lines (41 loc) · 3.28 KB
Contents Overview Examples Editor Forum

Video version

The <script> element adds scripting capability to the state machine.

Example:

<script>print('Hello, world!')</script>

Attribute Details

NameRequiredAttribute ConstraintsDefault ValueValid ValuesDescription
srcfalseMay not occur if the element has children.noneA valid URIGives the location from which the script should be downloaded.

Children

The child content of the <script> element represents the script code to be executed.

A conformant SCXML document must specify either the 'src' attribute or child content, but not both. If 'src' is specified, the SCXML Processor must download the script from the specified location at load time. If the script can not be downloaded within a platform-specific timeout interval, the document is considered non-conformant, and the platform must reject it.

If the script specified by the 'src' attribute of a script element cannot be downloaded within a platform-specific timeout interval, the document is considered non-conformant, and the platform MUST reject it. N.B. This test is valid only for datamodels that support scripting.

test301

The SCXML Processor MUST evaluate any script element that is a child of scxml at document load time. N.B. This test is valid only for datamodels that support scripting.

test302

In a conformant SCXML document, the name of any script variable MAY be used as a location expression. N.B. This test is valid only for datamodels that support scripting.

test303

In a conformant SCXML document, the name of any script variable MAY be used as a location expression. N.B. This test is valid only for datamodels that support scripting.

test304

TOP Contents Overview Examples Editor Forum