The SCXML specification allows implementations to support multiple expression languages to enable using SCXML documents in varying environments. These expressions become part of attribute values for executable content, such as:
<var name="foo" expr="1 + 2 + bar" />
<transition event="day.close" cond="day eq 'Friday'" target="weekend" />
Variable resolution bubbles up from the current state up to the document root, similar to variable shadowing via blocks in a procedural language.
The Context is a collection of variables that defines a variable "scope". Each <state> element within an SCXML document gets its own Context or variable scope.
The root context is the context that may be supplied to the Commons SCXML engine as representing the variables in the "host environment". See SCXMLExecutor#setRootContext(Context) from the Javadoc.
<state id="foo" src="foo.xml"> <!-- Something, possibly very interesting, here --> </state>
Check out the engine API docs on how to plug in the suitable root context and evaluator tuple.
See org.apache.commons.scxml2.env.jexl package summary for the relevant root context and evaluator tuple to use.
See org.apache.commons.scxml2.env.xpath package summary for the relevant root context and evaluator tuple to use.
See org.apache.commons.scxml2.env.groovy package summary for the relevant root context and evaluator tuple to use.
Commons SCXML uses the mechanisms provided by the expression language chosen for the document to support method invocation. Commons JEXL allow for method invocations as follows: