summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--docs/DEVELOPERS.md8
-rw-r--r--docs/Doxyfile.in12
-rw-r--r--docs/DoxygenLayout.xml194
-rwxr-xr-xdocs/bootstrap/customdoxygen.css34
-rwxr-xr-xdocs/bootstrap/doxy-boot.js40
-rw-r--r--src/bindings/CMakeLists.txt46
-rw-r--r--src/bindings/swig/csharp/CMakeLists.txt88
-rw-r--r--src/bindings/swig/csharp/org/uscxml/InterpreterException.cs7
-rw-r--r--src/bindings/swig/csharp/uscxml.i429
-rw-r--r--src/bindings/swig/java/CMakeLists.txt77
-rw-r--r--src/bindings/swig/java/org/uscxml/InterpreterException.java11
-rw-r--r--src/bindings/swig/java/uscxml.i284
-rw-r--r--src/bindings/swig/php/CMakeLists.txt100
-rw-r--r--src/bindings/swig/php/test.php85
-rw-r--r--src/bindings/swig/php/uscxml.i400
-rw-r--r--src/bindings/swig/php/uscxmlNativePHP.php3121
-rw-r--r--src/bindings/swig/stl_list.i49
-rw-r--r--src/bindings/swig/stl_set.i73
-rw-r--r--src/bindings/swig/uscxml_beautify.i54
-rw-r--r--src/bindings/swig/uscxml_ignores.i155
-rw-r--r--src/bindings/swig/wrapped/WrappedDataModel.cpp27
-rw-r--r--src/bindings/swig/wrapped/WrappedDataModel.h98
-rw-r--r--src/bindings/swig/wrapped/WrappedExecutableContent.cpp43
-rw-r--r--src/bindings/swig/wrapped/WrappedExecutableContent.h66
-rw-r--r--src/bindings/swig/wrapped/WrappedIOProcessor.cpp29
-rw-r--r--src/bindings/swig/wrapped/WrappedIOProcessor.h64
-rw-r--r--src/bindings/swig/wrapped/WrappedInterpreterMonitor.cpp147
-rw-r--r--src/bindings/swig/wrapped/WrappedInterpreterMonitor.h128
-rw-r--r--src/bindings/swig/wrapped/WrappedInvoker.cpp29
-rw-r--r--src/bindings/swig/wrapped/WrappedInvoker.h84
-rw-r--r--src/uscxml/Interpreter.cpp6
-rw-r--r--src/uscxml/Interpreter.h24
-rw-r--r--src/uscxml/debug/InterpreterIssue.h10
-rw-r--r--src/uscxml/interpreter/BasicEventQueue.cpp15
-rw-r--r--src/uscxml/interpreter/BasicEventQueue.h6
-rw-r--r--src/uscxml/interpreter/ContentExecutor.h2
-rw-r--r--src/uscxml/interpreter/EventQueue.cpp4
-rw-r--r--src/uscxml/interpreter/EventQueue.h2
-rw-r--r--src/uscxml/interpreter/EventQueueImpl.h2
-rw-r--r--src/uscxml/interpreter/FastMicroStep.cpp24
-rw-r--r--src/uscxml/interpreter/FastMicroStep.h2
-rw-r--r--src/uscxml/interpreter/InterpreterImpl.cpp4
-rw-r--r--src/uscxml/interpreter/InterpreterImpl.h6
-rw-r--r--src/uscxml/interpreter/InterpreterMonitor.h6
-rw-r--r--src/uscxml/interpreter/InterpreterState.h3
-rw-r--r--src/uscxml/interpreter/MicroStep.cpp4
-rw-r--r--src/uscxml/interpreter/MicroStep.h4
-rw-r--r--src/uscxml/interpreter/MicroStepImpl.h4
-rw-r--r--src/uscxml/messages/Data.h4
-rw-r--r--src/uscxml/plugins/DataModel.h2
-rw-r--r--src/uscxml/plugins/DataModelImpl.h52
-rw-r--r--src/uscxml/plugins/EventHandler.h2
-rw-r--r--src/uscxml/plugins/ExecutableContent.h4
-rw-r--r--src/uscxml/plugins/IOProcessor.h2
-rw-r--r--src/uscxml/plugins/IOProcessorImpl.h5
-rw-r--r--src/uscxml/plugins/Invoker.h4
-rw-r--r--src/uscxml/plugins/InvokerImpl.h9
-rw-r--r--src/uscxml/util/DOM.cpp4
-rw-r--r--src/uscxml/util/DOM.h2
-rw-r--r--src/uscxml/util/URL.cpp4
-rw-r--r--src/uscxml/util/URL.h2
-rw-r--r--test/CMakeLists.txt8
-rw-r--r--test/bindings/java/org/uscxml/dm/jexl/JEXLDataModel.java261
-rw-r--r--test/bindings/java/org/uscxml/tests/BasicExample.java43
-rw-r--r--test/bindings/java/org/uscxml/tests/DataModelExample.java58
-rw-r--r--test/bindings/java/org/uscxml/tests/MonitorExample.java46
-rw-r--r--test/bindings/java/org/uscxml/tests/helper/TestMonitor.java76
-rw-r--r--test/src/test-bindings.cpp11
-rw-r--r--test/src/test-snippets.cpp35
-rw-r--r--test/src/test-validating.cpp16
-rw-r--r--test/w3c/confJEXL.xsl748
-rwxr-xr-xtest/w3c/convert-tests.sh80
-rw-r--r--test/w3c/jexl/robots.txt103
-rw-r--r--test/w3c/jexl/test144.scxml27
-rw-r--r--test/w3c/jexl/test147.scxml35
-rw-r--r--test/w3c/jexl/test148.scxml36
-rw-r--r--test/w3c/jexl/test149.scxml31
-rw-r--r--test/w3c/jexl/test150.scxml45
-rw-r--r--test/w3c/jexl/test151.scxml45
-rw-r--r--test/w3c/jexl/test152.scxml51
-rw-r--r--test/w3c/jexl/test153.scxml42
-rw-r--r--test/w3c/jexl/test155.scxml31
-rw-r--r--test/w3c/jexl/test156.scxml33
-rw-r--r--test/w3c/jexl/test158.scxml29
-rw-r--r--test/w3c/jexl/test159.scxml26
-rw-r--r--test/w3c/jexl/test172.scxml25
-rw-r--r--test/w3c/jexl/test173.scxml26
-rw-r--r--test/w3c/jexl/test174.scxml26
-rw-r--r--test/w3c/jexl/test175.scxml32
-rw-r--r--test/w3c/jexl/test176.scxml35
-rw-r--r--test/w3c/jexl/test178.scxml27
-rw-r--r--test/w3c/jexl/test179.scxml23
-rw-r--r--test/w3c/jexl/test183.scxml25
-rw-r--r--test/w3c/jexl/test185.scxml27
-rw-r--r--test/w3c/jexl/test186.scxml36
-rw-r--r--test/w3c/jexl/test187.scxml38
-rw-r--r--test/w3c/jexl/test189.scxml27
-rw-r--r--test/w3c/jexl/test190.scxml40
-rw-r--r--test/w3c/jexl/test191.scxml37
-rw-r--r--test/w3c/jexl/test192.scxml52
-rw-r--r--test/w3c/jexl/test193.scxml29
-rw-r--r--test/w3c/jexl/test194.scxml26
-rw-r--r--test/w3c/jexl/test198.scxml23
-rw-r--r--test/w3c/jexl/test199.scxml22
-rw-r--r--test/w3c/jexl/test200.scxml22
-rw-r--r--test/w3c/jexl/test201.scxml23
-rw-r--r--test/w3c/jexl/test205.scxml34
-rw-r--r--test/w3c/jexl/test207.scxml55
-rw-r--r--test/w3c/jexl/test208.scxml24
-rw-r--r--test/w3c/jexl/test210.scxml28
-rw-r--r--test/w3c/jexl/test215.scxml35
-rw-r--r--test/w3c/jexl/test216.scxml28
-rw-r--r--test/w3c/jexl/test216sub1.scxml5
-rw-r--r--test/w3c/jexl/test220.scxml29
-rw-r--r--test/w3c/jexl/test223.scxml35
-rw-r--r--test/w3c/jexl/test224.scxml36
-rw-r--r--test/w3c/jexl/test225.scxml42
-rw-r--r--test/w3c/jexl/test226.scxml26
-rw-r--r--test/w3c/jexl/test226sub1.scxml14
-rw-r--r--test/w3c/jexl/test228.scxml37
-rw-r--r--test/w3c/jexl/test229.scxml46
-rw-r--r--test/w3c/jexl/test230.scxml60
-rw-r--r--test/w3c/jexl/test232.scxml41
-rw-r--r--test/w3c/jexl/test233.scxml42
-rw-r--r--test/w3c/jexl/test234.scxml69
-rw-r--r--test/w3c/jexl/test235.scxml29
-rw-r--r--test/w3c/jexl/test236.scxml43
-rw-r--r--test/w3c/jexl/test237.scxml45
-rw-r--r--test/w3c/jexl/test239.scxml35
-rw-r--r--test/w3c/jexl/test239sub1.scxml5
-rw-r--r--test/w3c/jexl/test240.scxml71
-rw-r--r--test/w3c/jexl/test241.scxml96
-rw-r--r--test/w3c/jexl/test242.scxml56
-rw-r--r--test/w3c/jexl/test242sub1.scxml5
-rw-r--r--test/w3c/jexl/test243.scxml41
-rw-r--r--test/w3c/jexl/test244.scxml45
-rw-r--r--test/w3c/jexl/test245.scxml40
-rw-r--r--test/w3c/jexl/test247.scxml28
-rw-r--r--test/w3c/jexl/test250.scxml39
-rw-r--r--test/w3c/jexl/test252.scxml48
-rw-r--r--test/w3c/jexl/test253.scxml75
-rw-r--r--test/w3c/jexl/test276.scxml22
-rw-r--r--test/w3c/jexl/test276sub1.scxml16
-rw-r--r--test/w3c/jexl/test277.scxml32
-rw-r--r--test/w3c/jexl/test278.scxml23
-rw-r--r--test/w3c/jexl/test279.scxml24
-rw-r--r--test/w3c/jexl/test280.scxml33
-rw-r--r--test/w3c/jexl/test286.scxml23
-rw-r--r--test/w3c/jexl/test287.scxml24
-rw-r--r--test/w3c/jexl/test288.scxml25
-rw-r--r--test/w3c/jexl/test294.scxml46
-rw-r--r--test/w3c/jexl/test298.scxml32
-rw-r--r--test/w3c/jexl/test301.scxml19
-rw-r--r--test/w3c/jexl/test302.scxml21
-rw-r--r--test/w3c/jexl/test303.scxml26
-rw-r--r--test/w3c/jexl/test304.scxml19
-rw-r--r--test/w3c/jexl/test307.scxml35
-rw-r--r--test/w3c/jexl/test309.scxml18
-rw-r--r--test/w3c/jexl/test310.scxml21
-rw-r--r--test/w3c/jexl/test311.scxml22
-rw-r--r--test/w3c/jexl/test312.scxml25
-rw-r--r--test/w3c/jexl/test313.scxml26
-rw-r--r--test/w3c/jexl/test314.scxml35
-rw-r--r--test/w3c/jexl/test318.scxml32
-rw-r--r--test/w3c/jexl/test319.scxml25
-rw-r--r--test/w3c/jexl/test321.scxml21
-rw-r--r--test/w3c/jexl/test322.scxml34
-rw-r--r--test/w3c/jexl/test323.scxml21
-rw-r--r--test/w3c/jexl/test324.scxml25
-rw-r--r--test/w3c/jexl/test325.scxml23
-rw-r--r--test/w3c/jexl/test326.scxml37
-rw-r--r--test/w3c/jexl/test329.scxml54
-rw-r--r--test/w3c/jexl/test330.scxml28
-rw-r--r--test/w3c/jexl/test331.scxml59
-rw-r--r--test/w3c/jexl/test332.scxml34
-rw-r--r--test/w3c/jexl/test333.scxml21
-rw-r--r--test/w3c/jexl/test335.scxml21
-rw-r--r--test/w3c/jexl/test336.scxml31
-rw-r--r--test/w3c/jexl/test337.scxml21
-rw-r--r--test/w3c/jexl/test338.scxml43
-rw-r--r--test/w3c/jexl/test339.scxml21
-rw-r--r--test/w3c/jexl/test342.scxml31
-rw-r--r--test/w3c/jexl/test343.scxml35
-rw-r--r--test/w3c/jexl/test344.scxml28
-rw-r--r--test/w3c/jexl/test346.scxml54
-rw-r--r--test/w3c/jexl/test347.scxml44
-rw-r--r--test/w3c/jexl/test348.scxml21
-rw-r--r--test/w3c/jexl/test349.scxml33
-rw-r--r--test/w3c/jexl/test350.scxml28
-rw-r--r--test/w3c/jexl/test351.scxml47
-rw-r--r--test/w3c/jexl/test352.scxml32
-rw-r--r--test/w3c/jexl/test354.scxml52
-rw-r--r--test/w3c/jexl/test355.scxml20
-rw-r--r--test/w3c/jexl/test364.scxml79
-rw-r--r--test/w3c/jexl/test372.scxml33
-rw-r--r--test/w3c/jexl/test375.scxml28
-rw-r--r--test/w3c/jexl/test376.scxml28
-rw-r--r--test/w3c/jexl/test377.scxml31
-rw-r--r--test/w3c/jexl/test378.scxml31
-rw-r--r--test/w3c/jexl/test387.scxml93
-rw-r--r--test/w3c/jexl/test388.scxml74
-rw-r--r--test/w3c/jexl/test396.scxml21
-rw-r--r--test/w3c/jexl/test399.scxml65
-rw-r--r--test/w3c/jexl/test401.scxml25
-rw-r--r--test/w3c/jexl/test402.scxml42
-rw-r--r--test/w3c/jexl/test403a.scxml46
-rw-r--r--test/w3c/jexl/test403b.scxml40
-rw-r--r--test/w3c/jexl/test403c.scxml53
-rw-r--r--test/w3c/jexl/test404.scxml56
-rw-r--r--test/w3c/jexl/test405.scxml66
-rw-r--r--test/w3c/jexl/test406.scxml60
-rw-r--r--test/w3c/jexl/test407.scxml27
-rw-r--r--test/w3c/jexl/test409.scxml36
-rw-r--r--test/w3c/jexl/test411.scxml36
-rw-r--r--test/w3c/jexl/test412.scxml52
-rw-r--r--test/w3c/jexl/test413.scxml44
-rw-r--r--test/w3c/jexl/test415.scxml13
-rw-r--r--test/w3c/jexl/test416.scxml27
-rw-r--r--test/w3c/jexl/test417.scxml36
-rw-r--r--test/w3c/jexl/test419.scxml22
-rw-r--r--test/w3c/jexl/test421.scxml31
-rw-r--r--test/w3c/jexl/test422.scxml81
-rw-r--r--test/w3c/jexl/test423.scxml29
-rw-r--r--test/w3c/jexl/test446.txt1
-rw-r--r--test/w3c/jexl/test487.scxml25
-rw-r--r--test/w3c/jexl/test488.scxml35
-rw-r--r--test/w3c/jexl/test495.scxml28
-rw-r--r--test/w3c/jexl/test496.scxml21
-rw-r--r--test/w3c/jexl/test500.scxml21
-rw-r--r--test/w3c/jexl/test501.scxml25
-rw-r--r--test/w3c/jexl/test503.scxml43
-rw-r--r--test/w3c/jexl/test504.scxml79
-rw-r--r--test/w3c/jexl/test505.scxml52
-rw-r--r--test/w3c/jexl/test506.scxml56
-rw-r--r--test/w3c/jexl/test509.scxml24
-rw-r--r--test/w3c/jexl/test510.scxml29
-rw-r--r--test/w3c/jexl/test513.txt16
-rw-r--r--test/w3c/jexl/test518.scxml25
-rw-r--r--test/w3c/jexl/test519.scxml25
-rw-r--r--test/w3c/jexl/test520.scxml27
-rw-r--r--test/w3c/jexl/test521.scxml27
-rw-r--r--test/w3c/jexl/test522.scxml27
-rw-r--r--test/w3c/jexl/test525.scxml32
-rw-r--r--test/w3c/jexl/test527.scxml28
-rw-r--r--test/w3c/jexl/test528.scxml33
-rw-r--r--test/w3c/jexl/test529.scxml28
-rw-r--r--test/w3c/jexl/test530.scxml34
-rw-r--r--test/w3c/jexl/test531.scxml26
-rw-r--r--test/w3c/jexl/test532.scxml26
-rw-r--r--test/w3c/jexl/test533.scxml67
-rw-r--r--test/w3c/jexl/test534.scxml24
-rw-r--r--test/w3c/jexl/test539.txt4
-rw-r--r--test/w3c/jexl/test540.txt3
-rw-r--r--test/w3c/jexl/test550.scxml23
-rw-r--r--test/w3c/jexl/test551.scxml25
-rw-r--r--test/w3c/jexl/test552.scxml22
-rw-r--r--test/w3c/jexl/test552.txt1
-rw-r--r--test/w3c/jexl/test553.scxml27
-rw-r--r--test/w3c/jexl/test554.scxml31
-rw-r--r--test/w3c/jexl/test557.txt4
-rw-r--r--test/w3c/jexl/test558.txt3
-rw-r--r--test/w3c/jexl/test567.scxml37
-rw-r--r--test/w3c/jexl/test570.scxml48
-rw-r--r--test/w3c/jexl/test576.scxml43
-rw-r--r--test/w3c/jexl/test577.scxml25
-rw-r--r--test/w3c/jexl/test579.scxml60
-rw-r--r--test/w3c/jexl/test580.scxml45
268 files changed, 14138 insertions, 130 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 319fc8f..4ea51da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -194,6 +194,10 @@ else()
add_definitions("-DUSCXML_STATIC")
endif()
+OPTION(BUILD_BINDING_JAVA "Build language bindings for Java" ON)
+OPTION(BUILD_BINDING_CSHARP "Build language bindings for CSharp" ON)
+OPTION(BUILD_BINDING_PHP "Build language bindings for PHP" OFF)
+
#################################################
# Dependent Libraries
@@ -359,6 +363,7 @@ if (NOT IGNORE_LUA)
endif()
add_subdirectory(src/uscxml)
+add_subdirectory(src/bindings)
add_library(uscxml ${USCXML_FILES})
set_property(TARGET uscxml PROPERTY CXX_STANDARD 11)
diff --git a/docs/DEVELOPERS.md b/docs/DEVELOPERS.md
index 01e5792..4de9802 100644
--- a/docs/DEVELOPERS.md
+++ b/docs/DEVELOPERS.md
@@ -2,4 +2,10 @@
## Getting Started
-Did only work on structure and layout of documentation so far
+When you [built SCXML](@ref building), you have three possibilities to work with SCXML state-charts:
+
+1. Embed the uSCXML interpreter in your program and parse and interpret state-chart documents at runtime. This allows for the most flexibility as the complete SCXML DOM is still available.
+
+2. Transpile SCXML state-charts onto one of the available target languages. These are currently VHDL and ANSI-C with C# and Java as likely additional targets. The benefit of this approach is the reduced footprint at runtime and fewer dependencies.
+
+3. Interpret SCXML documents directly with the `uscxml-browser`. \ No newline at end of file
diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in
index def8570..7a79a1d 100644
--- a/docs/Doxyfile.in
+++ b/docs/Doxyfile.in
@@ -109,7 +109,7 @@ BRIEF_MEMBER_DESC = YES
# brief descriptions will be completely suppressed.
# The default value is: YES.
-REPEAT_BRIEF = YES
+REPEAT_BRIEF = NO
# This tag implements a quasi-intelligent brief description abbreviator that is
# used to form the text in various listings. Each string in this list, if found
@@ -564,7 +564,7 @@ SORT_MEMBER_DOCS = YES
# this will also influence the order of the classes in the class list.
# The default value is: NO.
-SORT_BRIEF_DOCS = NO
+SORT_BRIEF_DOCS = YES
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
# (brief and detailed) documentation of class members so that constructors and
@@ -576,7 +576,7 @@ SORT_BRIEF_DOCS = NO
# detailed member documentation.
# The default value is: NO.
-SORT_MEMBERS_CTORS_1ST = NO
+SORT_MEMBERS_CTORS_1ST = YES
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
# of group names into alphabetical order. If set to NO the group names will
@@ -689,7 +689,7 @@ FILE_VERSION_FILTER =
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
-LAYOUT_FILE =
+LAYOUT_FILE = @PROJECT_SOURCE_DIR@/docs/DoxygenLayout.xml
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
@@ -847,7 +847,7 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).
-EXAMPLE_PATH =
+EXAMPLE_PATH = @PROJECT_SOURCE_DIR@/test/src/
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -861,7 +861,7 @@ EXAMPLE_PATTERNS = *
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.
-EXAMPLE_RECURSIVE = NO
+EXAMPLE_RECURSIVE = YES
# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
diff --git a/docs/DoxygenLayout.xml b/docs/DoxygenLayout.xml
new file mode 100644
index 0000000..c7e65b9
--- /dev/null
+++ b/docs/DoxygenLayout.xml
@@ -0,0 +1,194 @@
+<doxygenlayout version="1.0">
+ <!-- Generated by doxygen 1.8.10 -->
+ <!-- Navigation index tabs for HTML output -->
+ <navindex>
+ <tab type="mainpage" visible="yes" title=""/>
+ <tab type="pages" visible="yes" title="" intro=""/>
+ <tab type="modules" visible="yes" title="" intro=""/>
+ <tab type="namespaces" visible="yes" title="">
+ <tab type="namespacelist" visible="yes" title="" intro=""/>
+ <tab type="namespacemembers" visible="yes" title="" intro=""/>
+ </tab>
+ <tab type="classes" visible="yes" title="">
+ <tab type="classlist" visible="yes" title="" intro=""/>
+ <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
+ <tab type="hierarchy" visible="yes" title="" intro=""/>
+ <tab type="classmembers" visible="yes" title="" intro=""/>
+ </tab>
+ <tab type="files" visible="yes" title="">
+ <tab type="filelist" visible="yes" title="" intro=""/>
+ <tab type="globals" visible="yes" title="" intro=""/>
+ </tab>
+ <tab type="examples" visible="yes" title="" intro=""/>
+ </navindex>
+
+ <!-- Layout definition for a class page -->
+ <class>
+ <briefdescription visible="yes"/>
+ <includes visible="$SHOW_INCLUDE_FILES"/>
+ <inheritancegraph visible="$CLASS_GRAPH"/>
+ <collaborationgraph visible="$COLLABORATION_GRAPH"/>
+ <memberdecl>
+ <nestedclasses visible="yes" title=""/>
+ <publictypes title=""/>
+ <services title=""/>
+ <interfaces title=""/>
+ <publicslots title=""/>
+ <signals title=""/>
+ <publicmethods title=""/>
+ <publicstaticmethods title=""/>
+ <publicattributes title=""/>
+ <publicstaticattributes title=""/>
+ <protectedtypes title=""/>
+ <protectedslots title=""/>
+ <protectedmethods title=""/>
+ <protectedstaticmethods title=""/>
+ <protectedattributes title=""/>
+ <protectedstaticattributes title=""/>
+ <packagetypes title=""/>
+ <packagemethods title=""/>
+ <packagestaticmethods title=""/>
+ <packageattributes title=""/>
+ <packagestaticattributes title=""/>
+ <properties title=""/>
+ <events title=""/>
+ <privatetypes title=""/>
+ <privateslots title=""/>
+ <privatemethods title=""/>
+ <privatestaticmethods title=""/>
+ <privateattributes title=""/>
+ <privatestaticattributes title=""/>
+ <friends title=""/>
+ <related title="" subtitle=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <inlineclasses title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <services title=""/>
+ <interfaces title=""/>
+ <constructors title=""/>
+ <functions title=""/>
+ <related title=""/>
+ <variables title=""/>
+ <properties title=""/>
+ <events title=""/>
+ </memberdef>
+ <allmemberslink visible="yes"/>
+ <usedfiles visible="$SHOW_USED_FILES"/>
+ <authorsection visible="yes"/>
+ </class>
+
+ <!-- Layout definition for a namespace page -->
+ <namespace>
+ <briefdescription visible="yes"/>
+ <memberdecl>
+ <nestednamespaces visible="yes" title=""/>
+ <constantgroups visible="yes" title=""/>
+ <classes visible="yes" title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <inlineclasses title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ </memberdef>
+ <authorsection visible="yes"/>
+ </namespace>
+
+ <!-- Layout definition for a file page -->
+ <file>
+ <briefdescription visible="yes"/>
+ <includes visible="$SHOW_INCLUDE_FILES"/>
+ <includegraph visible="$INCLUDE_GRAPH"/>
+ <includedbygraph visible="$INCLUDED_BY_GRAPH"/>
+ <sourcelink visible="yes"/>
+ <memberdecl>
+ <classes visible="yes" title=""/>
+ <namespaces visible="yes" title=""/>
+ <constantgroups visible="yes" title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <inlineclasses title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ </memberdef>
+ <authorsection/>
+ </file>
+
+ <!-- Layout definition for a group page -->
+ <group>
+ <briefdescription visible="yes"/>
+ <groupgraph visible="$GROUP_GRAPHS"/>
+ <memberdecl>
+ <nestedgroups visible="yes" title=""/>
+ <dirs visible="yes" title=""/>
+ <files visible="yes" title=""/>
+ <namespaces visible="yes" title=""/>
+ <classes visible="yes" title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <enumvalues title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <signals title=""/>
+ <publicslots title=""/>
+ <protectedslots title=""/>
+ <privateslots title=""/>
+ <events title=""/>
+ <properties title=""/>
+ <friends title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <pagedocs/>
+ <inlineclasses title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <enumvalues title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <signals title=""/>
+ <publicslots title=""/>
+ <protectedslots title=""/>
+ <privateslots title=""/>
+ <events title=""/>
+ <properties title=""/>
+ <friends title=""/>
+ </memberdef>
+ <authorsection visible="yes"/>
+ </group>
+
+ <!-- Layout definition for a directory page -->
+ <directory>
+ <briefdescription visible="yes"/>
+ <directorygraph visible="yes"/>
+ <memberdecl>
+ <dirs visible="yes"/>
+ <files visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ </directory>
+</doxygenlayout>
diff --git a/docs/bootstrap/customdoxygen.css b/docs/bootstrap/customdoxygen.css
index 6c71e58..aa2c2bf 100755
--- a/docs/bootstrap/customdoxygen.css
+++ b/docs/bootstrap/customdoxygen.css
@@ -242,12 +242,35 @@ div.groupText {
/* OWN */
+.table> tbody > .mdetail > td {
+ padding: 0px;
+ border-top: 0px;
+}
+
+.table> tbody > .mdetail > td > div.panel {
+ border-radius: 0px;
+ box-shadow: none;
+ -webkit-box-shadow: none;
+ margin-bottom: 0px;
+ border: 0px;
+}
+
+.table> tbody > .mdetail {
+ border: 1px solid #ddd;
+}
+
+
div.mbrief {
padding: 0px 8px;
margin: 5px 0px;
border-left: 4px solid #DDD;
}
+.mdetail div.fragment {
+ margin-bottom: 15px;
+}
+
+
div.toc, div.toc li {
font: 400 10px/22px Roboto, sans-serif;
line-height: 1.2;
@@ -410,11 +433,20 @@ span.SRScope {
.table-hover;
padding: 3px;
/* border-bottom: 2px solid #e0e0e0;*/
+ border-bottom: 0px;
+}
+
+table.memname td.memname > a,
+table.memname td.paramtype > a,
+.table > tbody > tr > td.memItemLeft > a,
+.table > tbody > tr > td.memItemRight > a {
+ font-weight: bold;
}
.table > tbody > tr > td.memItemLeft {
border-top: 1px solid #e0e0e0;
}
+
.table > tbody > tr > td.mdescRight {
border-bottom: 1px solid #e0e0e0;
}
@@ -424,6 +456,8 @@ span.SRScope {
.table > tbody > tr > td.memItemRight {
border-left: 1px solid #e0e0e0;
border-right: 1px solid #e0e0e0;
+ padding: 5px 8px;
+/* line-height: 1.2;*/
/* width: auto;*/
}
diff --git a/docs/bootstrap/doxy-boot.js b/docs/bootstrap/doxy-boot.js
index 39c6a5d..6fe56b0 100755
--- a/docs/bootstrap/doxy-boot.js
+++ b/docs/bootstrap/doxy-boot.js
@@ -315,6 +315,46 @@ $( document ).ready(function() {
$(this).parent().remove();
});
+ /* Move detailled collapsible under brief */
+ $('div.mbrief a').each(function(){
+ var detailLink = $(this);
+ var detailAnchor = $(this).attr('href');
+
+ if ($(detailAnchor).length) {
+
+ var detailContent = $(detailAnchor).next();
+ detailContent.addClass("collapse");
+
+ $(this).removeAttr('href');
+
+ $(this).click(function() {
+ if (!$(detailContent).hasClass("in")) {
+ detailContent.addClass("in");
+ $(detailLink).text("Less ...");
+ } else {
+ detailContent.removeClass("in");
+ $(detailLink).text("More ...");
+ }
+ });
+
+ $(detailContent).find('.panel-heading').remove();
+
+ $(this).parent().parent().prev().append($(detailAnchor));
+ // $(this).parent().parent().append($(detailContent));
+
+ $(this).parent().parent().parent()
+ .after("<tr>").next().addClass("mdetail")
+ .append("<td>").children('td:last').attr("colspan", "2")
+ .append($(detailContent));
+ }
+ });
+
+ $('h2.groupheader').each(function(){
+ if ($(this).text() == "Member Function Documentation") {
+ $(this).remove();
+ }
+ });
+
// $('.mdescLeft').each(function(){
// if($(this).html()=="&nbsp;") {
// $(this).siblings('.mdescRight').attr('colspan', 2);
diff --git a/src/bindings/CMakeLists.txt b/src/bindings/CMakeLists.txt
new file mode 100644
index 0000000..57388f2
--- /dev/null
+++ b/src/bindings/CMakeLists.txt
@@ -0,0 +1,46 @@
+# if you build swig from sources on windows, this is where it will end up
+# see also: http://www.swig.org/Doc2.0/Windows.html#Windows_mingw_msys
+if (CMAKE_CROSSCOMPILING)
+ return()
+endif()
+
+if (WIN32)
+ if(EXISTS "${PROJECT_BINARY_DIR}/../swig/")
+ LIST(APPEND CMAKE_PROGRAM_PATH "${PROJECT_BINARY_DIR}/../swig/")
+ elseif(EXISTS "${PROJECT_BINARY_DIR}/../../swig/")
+ LIST(APPEND CMAKE_PROGRAM_PATH "${PROJECT_BINARY_DIR}/../../swig/")
+ endif()
+
+ file(GLOB POTENTIAL_SWIG "C:/Program Files/swig*" "C:/Program Files (x86)/swig*")
+ LIST(APPEND CMAKE_PROGRAM_PATH ${POTENTIAL_SWIG}) # swig.exe
+ # message(FATAL_ERROR "POTENTIAL_SWIG: ${POTENTIAL_SWIG}")
+
+endif()
+LIST(APPEND CMAKE_PROGRAM_PATH $ENV{SWIG_DIR})
+
+find_package(SWIG)
+
+if (SWIG_FOUND)
+ if(SWIG_VERSION VERSION_GREATER 2.0.4)
+ MARK_AS_ADVANCED(SWIG_DIR SWIG_EXECUTABLE SWIG_VERSION)
+ INCLUDE(${SWIG_USE_FILE})
+ if (BUILD_BINDING_JAVA)
+ add_subdirectory(swig/java)
+ endif()
+ # if (BUILD_BINDING_CSHARP)
+ # add_subdirectory(swig/csharp)
+ # endif()
+ # if (BUILD_BINDING_PHP)
+ # add_subdirectory(swig/php)
+ # endif()
+
+ if(SWIG_VERSION VERSION_LESS 3.0.0)
+ message(STATUS "SWIG version > 3.0 is recommended, found ${SWIG_VERSION}")
+ endif()
+ else()
+ message(STATUS "SWIG version 2.0.5 is required, found ${SWIG_VERSION} - skipping wrapper generation")
+ endif()
+else()
+ message(STATUS "SWIG not found - skipping wrapper generation")
+endif()
+set(USCXML_LANGUAGE_BINDINGS ${USCXML_LANGUAGE_BINDINGS} PARENT_SCOPE)
diff --git a/src/bindings/swig/csharp/CMakeLists.txt b/src/bindings/swig/csharp/CMakeLists.txt
new file mode 100644
index 0000000..384507b
--- /dev/null
+++ b/src/bindings/swig/csharp/CMakeLists.txt
@@ -0,0 +1,88 @@
+# generate JNI library and create a jar
+# Make from within Eclipse fails miserably with the whole thing
+
+if (WIN32)
+ LIST(APPEND CMAKE_PROGRAM_PATH "C:/Windows/Microsoft.NET/Framework/v3.5") # CSharp compiler
+ LIST(APPEND CMAKE_PROGRAM_PATH "C:/Windows/Microsoft.NET/Framework/v4.0.30319") # CSharp compiler
+endif()
+
+FIND_PROGRAM(DMCS_EXECUTABLE dmcs PATHS $ENV{DMCS_HOME} ENV PATH ) # Mono compiler
+FIND_PROGRAM(CSC_EXECUTABLE csc PATHS $ENV{CSC_HOME} ENV PATH ) # CSharp compiler
+
+if (DMCS_EXECUTABLE OR CSC_EXECUTABLE)
+
+ # unset all library suffixes as swig will hardcode a library without
+ SET(LIB_POSTFIX ${CMAKE_LIBRARY_POSTFIX})
+
+ SET(CMAKE_DEBUG_POSTFIX "")
+ SET(CMAKE_RELEASE_POSTFIX "")
+ SET(CMAKE_RELWITHDEBINFO_POSTFIX "")
+ SET(CMAKE_MINSIZEREL_POSTFIX "")
+ SET(CMAKE_LIBRARY_POSTFIX "")
+
+ if (MSVC)
+ # MSVC does not include inttypes.h but SWIG needs it
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../msvc)
+ endif()
+
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
+ SET(CMAKE_SWIG_FLAGS "")
+ SET(USCXML_CSHARP_NAMESPACE "org.uscxml")
+ SET(USCXML_CSHARP_DIR "org/uscxml")
+
+ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ list(APPEND CMAKE_SWIG_FLAGS "-DDEBUG")
+ endif()
+
+
+ # we need ; to produce a space with the package .. weird
+ SET_SOURCE_FILES_PROPERTIES(uscxml.i PROPERTIES SWIG_FLAGS "-w401;-namespace;${USCXML_CSHARP_NAMESPACE}")
+ SET_SOURCE_FILES_PROPERTIES(uscxml.i PROPERTIES CPLUSPLUS ON)
+ SET(CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/${USCXML_CSHARP_DIR}")
+
+ set(USCXML_LANGUAGE_BINDINGS "csharp ${USCXML_LANGUAGE_BINDINGS}")
+
+ SWIG_ADD_MODULE(uscxmlNativeCSharp csharp uscxml.i)
+ set_target_properties(uscxmlNativeCSharp PROPERTIES FOLDER "Bindings")
+ set_target_properties(uscxmlNativeCSharp
+ PROPERTIES
+ ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/csharp${LIB_POSTFIX}"
+ LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/csharp${LIB_POSTFIX}"
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/csharp${LIB_POSTFIX}"
+ )
+
+ set_target_properties(uscxmlNativeCSharp PROPERTIES COMPILE_FLAGS "-DSWIG")
+ swig_link_libraries(uscxmlNativeCSharp uscxml)
+
+ # build managed code part
+ if (CSC_EXECUTABLE)
+ ADD_CUSTOM_TARGET(csharp
+ COMMAND ${CMAKE_COMMAND} -E
+ copy ${CMAKE_CURRENT_SOURCE_DIR}/org/uscxml/InterpreterException.cs ${PROJECT_BINARY_DIR}/src/bindings/swig/csharp/org/uscxml
+ COMMAND ${CSC_EXECUTABLE}
+ /target:library
+ /out:${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/uscxmlCSharp.dll
+ *.cs
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/src/bindings/swig/csharp/org/uscxml
+ COMMENT "Creating umundoCSharp.dll for C# ...")
+ else()
+ ADD_CUSTOM_TARGET(csharp
+ COMMAND ${CMAKE_COMMAND} -E
+ copy ${CMAKE_CURRENT_SOURCE_DIR}/org/uscxml/InterpreterException.cs ${PROJECT_BINARY_DIR}/src/bindings/swig/csharp/org/uscxml
+ COMMAND ${DMCS_EXECUTABLE}
+ -target:library
+ /out:${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/uscxmlCSharp.dll
+ *.cs
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/src/bindings/swig/csharp/org/uscxml
+ COMMENT "Creating umundoCSharp.dll for Mono ...")
+ endif()
+
+ add_dependencies(csharp uscxmlNativeCSharp)
+ if (BUILD_TESTS)
+ add_dependencies(ALL_TESTS csharp)
+ endif()
+ set_target_properties(csharp PROPERTIES FOLDER "Bindings")
+
+ set(USCXML_LANGUAGE_BINDINGS ${USCXML_LANGUAGE_BINDINGS} PARENT_SCOPE)
+endif() \ No newline at end of file
diff --git a/src/bindings/swig/csharp/org/uscxml/InterpreterException.cs b/src/bindings/swig/csharp/org/uscxml/InterpreterException.cs
new file mode 100644
index 0000000..38430d8
--- /dev/null
+++ b/src/bindings/swig/csharp/org/uscxml/InterpreterException.cs
@@ -0,0 +1,7 @@
+namespace org.uscxml {
+ public class InterpreterException : System.ApplicationException {
+ public InterpreterException(string message)
+ : base(message) {
+ }
+ }
+} \ No newline at end of file
diff --git a/src/bindings/swig/csharp/uscxml.i b/src/bindings/swig/csharp/uscxml.i
new file mode 100644
index 0000000..fbc5f20
--- /dev/null
+++ b/src/bindings/swig/csharp/uscxml.i
@@ -0,0 +1,429 @@
+%module(directors="1", allprotected="1") uscxmlNativeCSharp
+
+// provide a macro for the header files
+#define SWIGIMPORTED 1
+
+%include <stl.i>
+%include <std_map.i>
+%include <std_string.i>
+%include <inttypes.i>
+%include "../stl_set.i"
+%include "../stl_list.i"
+
+%include <boost_shared_ptr.i>
+
+// these are needed at least for the templates to work
+typedef uscxml::Blob Blob;
+typedef uscxml::Data Data;
+typedef uscxml::Event Event;
+typedef uscxml::InvokeRequest InvokeRequest;
+typedef uscxml::SendRequest SendRequest;
+typedef uscxml::Invoker Invoker;
+typedef uscxml::IOProcessor IOProcessor;
+typedef uscxml::DataModel DataModel;
+typedef uscxml::DataModelExtension DataModelExtension;
+typedef uscxml::ExecutableContent ExecutableContent;
+typedef uscxml::InvokerImpl InvokerImpl;
+typedef uscxml::IOProcessorImpl IOProcessorImpl;
+typedef uscxml::DataModelImpl DataModelImpl;
+typedef uscxml::ExecutableContentImpl ExecutableContentImpl;
+typedef uscxml::InterpreterIssue InterpreterIssue;
+
+%feature("director") uscxml::WrappedInvoker;
+%feature("director") uscxml::WrappedDataModel;
+%feature("director") uscxml::WrappedDataModelExtension;
+%feature("director") uscxml::WrappedIOProcessor;
+%feature("director") uscxml::WrappedExecutableContent;
+%feature("director") uscxml::WrappedInterpreterMonitor;
+
+// disable warnings
+
+// unknown base class
+#pragma SWIG nowarn=401
+// override symbols via extend
+#pragma SWIG nowarn=302
+// ignoring overrided method
+#pragma SWIG nowarn=516
+// pointer from director
+#pragma SWIG nowarn=473
+// renamed params -> _params
+#pragma SWIG nowarn=314
+
+%csconst(1);
+
+%rename(equals) operator==;
+%rename(isValid) operator bool;
+
+
+//**************************************************
+// This ends up in the generated wrapper code
+//**************************************************
+
+%{
+
+#include "../../../uscxml/Message.h"
+#include "../../../uscxml/Factory.h"
+#include "../../../uscxml/Interpreter.h"
+#include "../../../uscxml/concurrency/BlockingQueue.h"
+#include "../../../uscxml/server/HTTPServer.h"
+//#include "../../../uscxml/debug/DebuggerServlet.h"
+
+#include "../wrapped/WrappedInvoker.h"
+#include "../wrapped/WrappedDataModel.h"
+#include "../wrapped/WrappedExecutableContent.h"
+#include "../wrapped/WrappedIOProcessor.h"
+#include "../wrapped/WrappedInterpreterMonitor.h"
+
+using namespace uscxml;
+using namespace Arabica::DOM;
+
+// the wrapped* C++ classes get rid of DOM nodes and provide more easily wrapped base classes
+#include "../wrapped/WrappedInvoker.cpp"
+#include "../wrapped/WrappedDataModel.cpp"
+#include "../wrapped/WrappedExecutableContent.cpp"
+#include "../wrapped/WrappedIOProcessor.cpp"
+#include "../wrapped/WrappedInterpreterMonitor.cpp"
+
+%}
+
+// see http://binf.gmu.edu/software/SWIG/CSharp.html#csharp_exceptions
+%insert(runtime) %{
+ // Code to handle throwing of C# CustomApplicationException from C/C++ code.
+ // The equivalent delegate to the callback, CSharpExceptionCallback_t, is CustomExceptionDelegate
+ // and the equivalent customExceptionCallback instance is customDelegate
+ typedef void (SWIGSTDCALL* CSharpExceptionCallback_t)(const char *);
+ CSharpExceptionCallback_t customExceptionCallback = NULL;
+
+ extern "C" SWIGEXPORT
+ void SWIGSTDCALL CustomExceptionRegisterCallback(CSharpExceptionCallback_t customCallback) {
+ customExceptionCallback = customCallback;
+ }
+
+ // Note that SWIG detects any method calls named starting with
+ // SWIG_CSharpSetPendingException for warning 845
+ static void SWIG_CSharpSetPendingExceptionCustom(const char *msg) {
+ customExceptionCallback(msg);
+ }
+%}
+
+%pragma(csharp) imclasscode=%{
+ class CustomExceptionHelper {
+ // C# delegate for the C/C++ customExceptionCallback
+ public delegate void CustomExceptionDelegate(string message);
+ static CustomExceptionDelegate customDelegate =
+ new CustomExceptionDelegate(SetPendingCustomException);
+
+ [System.Runtime.InteropServices.DllImport("$dllimport", EntryPoint="CustomExceptionRegisterCallback")]
+ public static extern
+ void CustomExceptionRegisterCallback(CustomExceptionDelegate customCallback);
+
+ static void SetPendingCustomException(string message) {
+ SWIGPendingException.Set(new org.uscxml.InterpreterException(message));
+ }
+
+ static CustomExceptionHelper() {
+ CustomExceptionRegisterCallback(customDelegate);
+ }
+ }
+ static CustomExceptionHelper exceptionHelper = new CustomExceptionHelper();
+%}
+
+
+%define WRAP_THROW_EXCEPTION( MATCH )
+%exception MATCH %{
+try {
+ $action
+} catch (uscxml::Event& e) {
+ std::stringstream ss;
+ ss << std::endl << e;
+ SWIG_CSharpSetPendingExceptionCustom(ss.str().c_str());
+}
+%}
+%enddef
+
+WRAP_THROW_EXCEPTION(uscxml::Interpreter::fromXML);
+WRAP_THROW_EXCEPTION(uscxml::Interpreter::fromURI);
+WRAP_THROW_EXCEPTION(uscxml::Interpreter::step);
+WRAP_THROW_EXCEPTION(uscxml::Interpreter::interpret);
+
+
+%define WRAP_TO_STRING( CLASSNAME )
+%csmethodmodifiers CLASSNAME::ToString() "public override";
+%extend CLASSNAME {
+ virtual std::string ToString() {
+ std::stringstream ss;
+ ss << *self;
+ return ss.str();
+ }
+};
+%enddef
+
+WRAP_TO_STRING(uscxml::Event);
+WRAP_TO_STRING(uscxml::Data);
+WRAP_TO_STRING(uscxml::SendRequest);
+WRAP_TO_STRING(uscxml::InvokeRequest);
+WRAP_TO_STRING(uscxml::InterpreterIssue);
+
+%include "../uscxml_ignores.i"
+
+// InterpreterMonitor -> StateTransitionMonitor
+%ignore uscxml::StateTransitionMonitor;
+
+//***********************************************
+// Beautify important classes
+//***********************************************
+
+
+// byte[] signature for Blob get/setData
+// see http://permalink.gmane.org/gmane.comp.programming.swig/5804
+
+%csmethodmodifiers uscxml::Blob::setData(const char* data, size_t length) "private";
+%csmethodmodifiers uscxml::Blob::setMimeType(const std::string& mimeType) "private";
+%csmethodmodifiers uscxml::Blob::Blob(const char* data, size_t size, const std::string& mimeType) "private";
+%csmethodmodifiers uscxml::Blob::Blob(const char* data, size_t size) "private";
+
+%typemap(cscode) uscxml::Blob %{
+ public Blob(byte[] data, string mimeType) : this(uscxmlNativeCSharpPINVOKE.new_Blob__SWIG_2(data, (uint)data.Length, mimeType), true) {
+ if (uscxmlNativeCSharpPINVOKE.SWIGPendingException.Pending) throw uscxmlNativeCSharpPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+%}
+
+%typemap(imtype, out="System.IntPtr") const char *data "byte[]"
+%typemap(cstype) const char *data "byte[]"
+%typemap(in) const char *data %{ $1 = ($1_ltype)$input; %}
+%typemap(csin) const char *data "$csinput"
+
+%typemap(imtype, out="System.IntPtr") char* getData "byte[]"
+%typemap(cstype) char* getData "byte[]"
+
+%typemap(csout) char* getData %{
+ {
+ byte[] ret = new byte[this.getSize()];
+ System.IntPtr data = $imcall;
+ System.Runtime.InteropServices.Marshal.Copy(data, ret, 0, (int)this.getSize());
+ return ret;
+ }
+%}
+
+// make sure we do not get the default with SWIG_csharp_string_callback
+%typemap(out) char* getData {
+ $result = (char *)result;
+}
+
+
+
+%csmethodmodifiers uscxml::Event::getParamMap() "private";
+%csmethodmodifiers uscxml::Event::getParamMapKeys() "private";
+%csmethodmodifiers uscxml::Event::setParamMap(const std::map<std::string, std::list<uscxml::Data> >&) "private";
+%csmethodmodifiers uscxml::Event::getNameListKeys() "private";
+%csmethodmodifiers uscxml::Interpreter::getIOProcessorKeys() "private";
+%csmethodmodifiers uscxml::Interpreter::getInvokerKeys() "private";
+%csmethodmodifiers uscxml::Interpreter::getInvokers() "private";
+%csmethodmodifiers uscxml::Interpreter::getIOProcessors() "private";
+%csmethodmodifiers uscxml::Data::getCompoundKeys() "private";
+
+%include "../uscxml_beautify.i"
+
+%typemap(csimports) uscxml::Interpreter %{
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+%}
+
+%typemap(cscode) uscxml::Interpreter %{
+ public Dictionary<string, NativeIOProcessor> getIOProcessors() {
+ Dictionary<string, NativeIOProcessor> ioProcs = new Dictionary<string, NativeIOProcessor>();
+ StringVector keys = getIOProcessorKeys();
+ IOProcMap ioProcMap = getIOProcessorsNative();
+ for (size_t i = 0; i < keys.Count; i++) {
+ ioProcs[keys[i]] = ioProcMap[keys[i]];
+ }
+ return ioProcs;
+ }
+
+ public Dictionary<string, NativeInvoker> getInvokers() {
+ Dictionary<string, NativeInvoker> invokers = new Dictionary<string, NativeInvoker>();
+ StringVector keys = getInvokerKeys();
+ InvokerMap invokerMap = getInvokersNative();
+ for (size_t i = 0; i < keys.Count; i++) {
+ invokers[keys[i]] = invokerMap[keys[i]];
+ }
+ return invokers;
+ }
+
+%}
+
+
+%rename(getCompoundNative) uscxml::Data::getCompound();
+%rename(getArrayNative) uscxml::Data::getArray();
+%rename(setCompoundNative) uscxml::Data::setCompound(const std::map<std::string, Data>&);
+%rename(setArrayNative) uscxml::Data::setArray(const std::list<Data>&);
+%csmethodmodifiers uscxml::Data::getCompound() "private";
+%csmethodmodifiers uscxml::Data::getArray() "private";
+%csmethodmodifiers uscxml::Data::setCompound(const std::map<std::string, Data>&) "private";
+%csmethodmodifiers uscxml::Data::setArray(const std::list<Data>&) "private";
+%csmethodmodifiers uscxml::Data::getCompoundKeys() "private";
+
+%typemap(csimports) uscxml::Data %{
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+%}
+
+%typemap(cscode) uscxml::Data %{
+ public Data(byte[] data, String mimeType) : this() {
+ setBinary(new Blob(data, mimeType));
+ }
+
+ public Data(List<Data> arr) : this() {
+ setArray(arr);
+ }
+
+ public Data(Dictionary<string, Data> compound) : this() {
+ setCompound(compound);
+ }
+
+ public Dictionary<string, Data> getCompound() {
+ Dictionary<string, Data> compound = new Dictionary<string, Data>();
+ DataMap dataMap = getCompoundNative();
+ StringVector dataMapKeys = getCompoundKeys();
+ for (size_t i = 0; i < dataMapKeys.Count; i++) {
+ compound[dataMapKeys[i]] = dataMap[dataMapKeys[i]];
+ }
+ return compound;
+ }
+
+ public void setCompound(Dictionary<string, Data> compound) {
+ DataMap dataMap = new DataMap();
+ foreach(KeyValuePair<string, Data> entry in compound) {
+ dataMap.Add(entry);
+ }
+ setCompoundNative(dataMap);
+ }
+
+ public List<Data> getArray() {
+ List<Data> arr = new List<Data>();
+ DataList dataList = getArrayNative();
+ for (size_t i = 0; i < dataList.size(); i++) {
+ arr.Add(dataList.get(i));
+ }
+ return arr;
+ }
+
+ public void setArray(List<Data> arr) {
+ DataList dataList = new DataList();
+ foreach (Data data in arr) {
+ dataList.add(data);
+ }
+ setArrayNative(dataList);
+ }
+
+%}
+
+%rename(getNameListNative) uscxml::Event::getNameList();
+%rename(getParamsNative) uscxml::Event::getParams();
+%rename(setNameListNative) uscxml::Event::setNameList(const std::map<std::string, Data>&);
+%rename(setParamsNative) uscxml::Event::setParams(const std::multimap<std::string, Data>&);
+%csmethodmodifiers uscxml::Event::getNameList() "private";
+%csmethodmodifiers uscxml::Event::getNameListKeys() "private";
+%csmethodmodifiers uscxml::Event::getParams() "private";
+%csmethodmodifiers uscxml::Event::setNameList(const std::map<std::string, Data>&) "private";
+%csmethodmodifiers uscxml::Event::setParams(const std::multimap<std::string, Data>&) "private";
+
+%typemap(csimports) uscxml::Event %{
+ using System;
+ using System.Collections.Generic;
+ using System.Runtime.InteropServices;
+%}
+
+%typemap(cscode) uscxml::Event %{
+ public Dictionary<string, List<Data> > getParams() {
+ Dictionary<string, List<Data>> parameters = new Dictionary<string, List<Data>>();
+ ParamMap paramMap = getParamMap();
+
+ foreach (KeyValuePair<string, DataList> entry in paramMap) {
+ DataList dataList = entry.Value;
+ List<Data> paramList = new List<Data>();
+ for (size_t i = 0; i < dataList.size(); i++) {
+ Data data = dataList.get(i);
+ paramList.Add(data);
+ }
+ parameters.Add(entry.Key, paramList);
+ }
+ return parameters;
+ }
+
+ public void setParams(Dictionary<string, List<Data>> parameters) {
+ ParamMap paramMap = new ParamMap();
+ foreach(KeyValuePair<string, List<Data>> entry in parameters) {
+ DataList dataList = new DataList();
+ foreach (Data data in entry.Value) {
+ dataList.add(data);
+ }
+ paramMap.Add(entry.Key, dataList);
+ }
+ setParamMap(paramMap);
+ }
+
+ public Dictionary<string, Data> getNameList() {
+ Dictionary<string, Data> nameList = new Dictionary<string, Data>();
+ DataMap nameListMap = getNameListNative();
+ StringVector nameListMapKeys = getNameListKeys();
+ for (size_t i = 0; i < nameListMapKeys.Count; i++) {
+ nameList[nameListMapKeys[i]] = nameListMap[nameListMapKeys[i]];
+ }
+ return nameList;
+ }
+
+ public void setNameList(Dictionary<string, Data> nameList) {
+ DataMap dataMap = new DataMap();
+ foreach (KeyValuePair<string, Data> entry in nameList) {
+ dataMap.Add(entry);
+ }
+ setNameListNative(dataMap);
+ }
+%}
+
+//***********************************************
+// Parse the header file to generate wrappers
+//***********************************************
+
+%include "../../../uscxml/Common.h"
+%include "../../../uscxml/Factory.h"
+%include "../../../uscxml/Message.h"
+%include "../../../uscxml/Interpreter.h"
+%include "../../../uscxml/concurrency/BlockingQueue.h"
+%include "../../../uscxml/server/HTTPServer.h"
+//%include "../../../uscxml/debug/DebuggerServlet.h"
+%include "../../../uscxml/debug/InterpreterIssue.h"
+
+%include "../../../uscxml/messages/Blob.h"
+%include "../../../uscxml/messages/Data.h"
+%include "../../../uscxml/messages/Event.h"
+%include "../../../uscxml/messages/InvokeRequest.h"
+%include "../../../uscxml/messages/SendRequest.h"
+
+%include "../../../uscxml/plugins/DataModel.h"
+%include "../../../uscxml/plugins/EventHandler.h"
+%include "../../../uscxml/plugins/ExecutableContent.h"
+%include "../../../uscxml/plugins/Invoker.h"
+%include "../../../uscxml/plugins/IOProcessor.h"
+
+%include "../wrapped/WrappedInvoker.h"
+%include "../wrapped/WrappedDataModel.h"
+%include "../wrapped/WrappedExecutableContent.h"
+%include "../wrapped/WrappedIOProcessor.h"
+%include "../wrapped/WrappedInterpreterMonitor.h"
+
+
+%template(IssueList) std::list<uscxml::InterpreterIssue>;
+%template(DataList) std::list<uscxml::Data>;
+%template(DataMap) std::map<std::string, uscxml::Data>;
+%template(StringSet) std::set<std::string>;
+%template(StringVector) std::vector<std::string>;
+%template(StringList) std::list<std::string>;
+%template(ParamMap) std::map<std::string, std::list<uscxml::Data> >;
+%template(IOProcMap) std::map<std::string, IOProcessor>;
+%template(InvokerMap) std::map<std::string, Invoker>;
+%template(ParentQueue) uscxml::concurrency::BlockingQueue<uscxml::SendRequest>;
diff --git a/src/bindings/swig/java/CMakeLists.txt b/src/bindings/swig/java/CMakeLists.txt
new file mode 100644
index 0000000..148199e
--- /dev/null
+++ b/src/bindings/swig/java/CMakeLists.txt
@@ -0,0 +1,77 @@
+# generate JNI library and create a jar
+# Make from within Eclipse fails miserably with the whole thing
+
+find_package(JNI)
+if(JNI_FOUND)
+ include_directories(${JNI_INCLUDE_DIRS})
+else()
+ message(STATUS "No JNI libraries found - not building Java wrappers")
+ return()
+endif()
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
+SET(CMAKE_SWIG_FLAGS "")
+SET(USCXML_JAVA_PACKAGE "org.uscxml")
+SET(USCXML_JAVA_DIR "org/uscxml")
+
+# we need ; to produce a space with the package .. weird
+SET_SOURCE_FILES_PROPERTIES(uscxml.i PROPERTIES SWIG_FLAGS "-w473;-package;${USCXML_JAVA_PACKAGE}")
+SET_SOURCE_FILES_PROPERTIES(uscxml.i PROPERTIES CPLUSPLUS ON)
+SET(CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/${USCXML_JAVA_DIR}")
+
+SWIG_ADD_MODULE(uscxmlNativeJava java uscxml.i)
+foreach(JNI_LIBRARY ${JNI_LIBRARIES})
+ if (NOT ${JNI_LIBRARY} MATCHES ".*jawt.*")
+ SWIG_LINK_LIBRARIES(uscxmlNativeJava ${JNI_LIBRARY})
+ endif()
+endforeach()
+set_target_properties(uscxmlNativeJava PROPERTIES FOLDER "Bindings")
+set_target_properties(uscxmlNativeJava PROPERTIES COMPILE_FLAGS "-DSWIG")
+
+swig_link_libraries(uscxmlNativeJava uscxml)
+
+file(GLOB POTENTIAL_ANT "C:/Program Files/apache-ant**/bin" "C:/Program Files (x86)/apache-ant**/bin")
+
+FIND_PROGRAM(ANT_EXECUTABLE ant PATHS $ENV{ANT_HOME}/bin ${POTENTIAL_ANT} ENV PATH )
+if (ANT_EXECUTABLE)
+ set(USCXML_LANGUAGE_BINDINGS "java ${USCXML_LANGUAGE_BINDINGS}")
+
+ set(JAR_EXCLUDE_DEBUG OFF)
+ set(JAR_EXCLUDE_JNI OFF)
+
+ # include all the JNI libraries prepared from DIST_PREPARE builds on the various desktop platforms
+ if (DIST_PREPARE)
+ if (CMAKE_CROSSCOMPILING)
+ if (ANDROID)
+ set(JAR_EXCLUDE_JNI ON) # JNI inside jar not allowed with Android
+ SET(JAR_JNI_ROOT_PATH ${PROJECT_SOURCE_DIR}/package/cross-compiled/android)
+ else()
+ SET(JAR_JNI_ROOT_PATH ${PROJECT_SOURCE_DIR}/package/cross-compiled/${CMAKE_CROSSCOMPILING_TARGET_LC})
+ endif()
+ else()
+ SET(JAR_JNI_ROOT_PATH ${PROJECT_SOURCE_DIR}/package)
+ endif()
+ else()
+ # when not preparing a distribution, just put the jar into the libs
+ SET(JAR_JNI_ROOT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+ endif()
+
+ ADD_CUSTOM_TARGET(java
+ COMMAND ${ANT_EXECUTABLE}
+ -Dlib.dir=${JAR_JNI_ROOT_PATH}
+ -Dsrc.dir=${PROJECT_SOURCE_DIR}
+ -Dbuild.dir=${PROJECT_BINARY_DIR}
+ -Dbuild.type=${CMAKE_BUILD_TYPE}
+ -Dexclude.debug=${JAR_EXCLUDE_DEBUG}
+ -Dexclude.jni=${JAR_EXCLUDE_JNI}
+ -f build-java.xml
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/contrib/java
+ COMMENT "Creating the jar ...")
+
+ set_target_properties(java PROPERTIES FOLDER "Bindings")
+else()
+ message(STATUS "Could not find ant binary - will not build jars")
+endif()
+
+set(USCXML_LANGUAGE_BINDINGS ${USCXML_LANGUAGE_BINDINGS} PARENT_SCOPE)
diff --git a/src/bindings/swig/java/org/uscxml/InterpreterException.java b/src/bindings/swig/java/org/uscxml/InterpreterException.java
new file mode 100644
index 0000000..b2baa99
--- /dev/null
+++ b/src/bindings/swig/java/org/uscxml/InterpreterException.java
@@ -0,0 +1,11 @@
+package org.uscxml;
+
+public class InterpreterException extends Exception {
+ private static final long serialVersionUID = -3534919496547591015L;
+
+ public InterpreterException(String name, String msg) {
+ super(msg);
+ }
+
+ public String name;
+}
diff --git a/src/bindings/swig/java/uscxml.i b/src/bindings/swig/java/uscxml.i
new file mode 100644
index 0000000..03d8232
--- /dev/null
+++ b/src/bindings/swig/java/uscxml.i
@@ -0,0 +1,284 @@
+%module(directors="1", allprotected="1") uscxmlNativeJava
+
+// provide a macro for the header files
+#define SWIGIMPORTED 1
+
+%include <stl.i>
+%include <std_map.i>
+%include <std_string.i>
+%include <inttypes.i>
+%include "../stl_set.i"
+%include "../stl_list.i"
+%include "enums.swg"
+
+%include <std_shared_ptr.i>
+
+// these are needed at least for the templates to work
+typedef uscxml::Blob Blob;
+typedef uscxml::Data Data;
+typedef uscxml::Event Event;
+typedef uscxml::Invoker Invoker;
+typedef uscxml::IOProcessor IOProcessor;
+typedef uscxml::DataModel DataModel;
+typedef uscxml::DataModelExtension DataModelExtension;
+typedef uscxml::ExecutableContent ExecutableContent;
+typedef uscxml::InvokerImpl InvokerImpl;
+typedef uscxml::IOProcessorImpl IOProcessorImpl;
+typedef uscxml::DataModelImpl DataModelImpl;
+typedef uscxml::ExecutableContentImpl ExecutableContentImpl;
+typedef uscxml::InterpreterIssue InterpreterIssue;
+
+%feature("director") uscxml::WrappedInvoker;
+%feature("director") uscxml::WrappedDataModel;
+%feature("director") uscxml::WrappedDataModelExtension;
+%feature("director") uscxml::WrappedIOProcessor;
+%feature("director") uscxml::WrappedExecutableContent;
+%feature("director") uscxml::WrappedInterpreterMonitor;
+
+// disable warning related to unknown base class
+#pragma SWIG nowarn=401
+// do not warn when we override symbols via extend
+#pragma SWIG nowarn=302
+// do not warn when ignoring overrided method
+#pragma SWIG nowarn=516
+
+%javaconst(1);
+
+%rename(equals) operator==; // signature is wrong, still useful
+%rename(isValid) operator bool;
+
+//**************************************************
+// This ends up in the generated wrapper code
+//**************************************************
+
+%{
+
+#include "uscxml/config.h"
+#include "../../../uscxml/Interpreter.h"
+#include "../../../uscxml/debug/InterpreterIssue.h"
+#include "../../../uscxml/interpreter/InterpreterState.h"
+#include "../../../uscxml/interpreter/InterpreterMonitor.h"
+
+#include "../../../uscxml/messages/Data.h"
+#include "../../../uscxml/messages/Event.h"
+#include "../../../uscxml/util/DOM.h"
+
+#include "../../../uscxml/plugins/Factory.h"
+#include "../../../uscxml/plugins/DataModelImpl.h"
+
+#include "../wrapped/WrappedInvoker.h"
+#include "../wrapped/WrappedDataModel.h"
+#include "../wrapped/WrappedExecutableContent.h"
+#include "../wrapped/WrappedIOProcessor.h"
+#include "../wrapped/WrappedInterpreterMonitor.h"
+
+using namespace uscxml;
+using namespace XERCESC_NS;
+
+// the wrapped* C++ classes get rid of DOM nodes and provide more easily wrapped base classes
+#include "../wrapped/WrappedInvoker.cpp"
+#include "../wrapped/WrappedDataModel.cpp"
+#include "../wrapped/WrappedExecutableContent.cpp"
+#include "../wrapped/WrappedIOProcessor.cpp"
+#include "../wrapped/WrappedInterpreterMonitor.cpp"
+
+%}
+
+// throw from c++ to java
+%define WRAP_THROW_EXCEPTION( MATCH )
+%javaexception("org.uscxml.InterpreterException") MATCH {
+ try {
+ $action
+ }
+ catch ( uscxml::Event& e ) {
+ jclass eclass = jenv->FindClass("org/uscxml/InterpreterException");
+ if ( eclass ) {
+ std::stringstream ss;
+ jenv->ThrowNew( eclass, ss.str().c_str() );
+ }
+ }
+}
+%enddef
+
+WRAP_THROW_EXCEPTION(uscxml::Interpreter::fromXML);
+WRAP_THROW_EXCEPTION(uscxml::Interpreter::fromURL);
+WRAP_THROW_EXCEPTION(uscxml::Interpreter::step);
+
+// throw from java directors to c++
+%typemap(javabase) uscxml::Event "java.lang.RuntimeException";
+%rename(getMessage) uscxml::ErrorEvent::toString;
+
+%define WRAP_THROWS_ERROREVENT( MATCH )
+%feature("director:except") MATCH {
+ jthrowable swigerror = jenv->ExceptionOccurred();
+ if (Swig::ExceptionMatches(jenv, swigerror, "org/uscxml/ErrorEvent")) {
+ jenv->ExceptionClear();
+ jenv->DeleteLocalRef(swigjobj);
+ ERROR_EXECUTION_THROW(Swig::JavaExceptionMessage(jenv, swigerror).message());
+ }
+}
+%enddef
+WRAP_THROWS_ERROREVENT(uscxml::WrappedDataModel::getLength);
+WRAP_THROWS_ERROREVENT(uscxml::WrappedDataModel::setForeach);
+
+
+%typemap(directorthrows) uscxml::ErrorEvent %{
+ if (Swig::ExceptionMatches(jenv, $error, "$packagepath/$javaclassname"))
+ throw $1_type(Swig::JavaExceptionMessage(jenv, $error).message());
+%}
+
+%catches(uscxml::ErrorEvent) uscxml::WrappedDataModel::getLength;
+
+
+// provide a hashcode
+%define WRAP_HASHCODE( CLASSNAME )
+%extend CLASSNAME {
+ virtual int hashCode() {
+/* std::cout << "Calc hashcode as " << (int)(size_t)self->getImpl().get() << std::endl << std::flush;*/
+ return (int)(size_t)self->getImpl().get();
+ }
+};
+%enddef
+
+%define WRAP_TO_STRING( CLASSNAME )
+%extend CLASSNAME {
+ virtual std::string toString() {
+ std::stringstream ss;
+ ss << *self;
+ return ss.str();
+ }
+};
+%enddef
+
+WRAP_TO_STRING(uscxml::Event);
+WRAP_TO_STRING(uscxml::Data);
+WRAP_TO_STRING(uscxml::InterpreterIssue);
+
+WRAP_HASHCODE(uscxml::Interpreter);
+
+%include "../uscxml_ignores.i"
+
+#if 0
+// see http://swig.org/Doc2.0/Java.html#Java_date_marshalling
+%define BEAUTIFY_NATIVE( MATCH, WRAPPER, NATIVE )
+
+%rename WRAPPER NATIVE;
+
+%typemap(jstype) const MATCH & "WRAPPER"
+%typemap(jstype) MATCH "WRAPPER"
+
+%typemap(javain,
+ pre=" NATIVE temp$javainput = $javainput.toNative();",
+ pgcppname="temp$javainput") const MATCH &
+ "$javaclassname.getCPtr(temp$javainput)"
+
+ %typemap(javain,
+ pre=" NATIVE temp$javainput = $javainput.toNative();",
+ pgcppname="temp$javainput") MATCH
+ "$javaclassname.getCPtr(temp$javainput)"
+
+%typemap(javaout) const MATCH & {
+ NATIVE nativeData = new NATIVE($jnicall, $owner);
+ return new WRAPPER(nativeData);
+}
+
+%typemap(javaout) MATCH {
+ NATIVE nativeData = new NATIVE($jnicall, $owner);
+ return new WRAPPER(nativeData);
+}
+
+%typemap(javadirectorout) MATCH "NATIVE.getCPtr($javacall.toNative())"
+
+%typemap(javadirectorin) MATCH "WRAPPER.fromNative(new NATIVE($jniinput, false))";
+%typemap(javadirectorin) const MATCH & "WRAPPER.fromNative(new NATIVE($jniinput, false))";
+
+%typemap(directorin,descriptor="L/org/uscxml/"##"WRAPPER;") const MATCH & "*(MATCH **)&$input = (MATCH *) &$1;"
+
+%typemap(directorout) MATCH ($&1_type argp)
+%{ argp = *($&1_ltype*)&$input;
+ if (!argp) {
+ SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type");
+ return $null;
+ }
+ $result = *argp; %}
+
+%enddef
+
+/*
+// not used as it will not work for directors :(
+BEAUTIFY_NATIVE(uscxml::Data, Data, DataNative);
+BEAUTIFY_NATIVE(uscxml::Event, Event, EventNative);
+*/
+#endif
+
+// bytearray for Blob::data
+// see: http://stackoverflow.com/questions/9934059/swig-technique-to-wrap-unsigned-binary-data
+
+%apply (char *STRING, size_t LENGTH) { (const char* data, size_t size) };
+
+%typemap(jni) char* getData "jbyteArray"
+%typemap(jtype) char* getData "byte[]"
+%typemap(jstype) char* getData "byte[]"
+%typemap(javaout) char* getData {
+ return $jnicall;
+}
+
+%typemap(out) char* getData {
+ $result = JCALL1(NewByteArray, jenv, ((uscxml::Blob const *)arg1)->getSize());
+ JCALL4(SetByteArrayRegion, jenv, $result, 0, ((uscxml::Blob const *)arg1)->getSize(), (jbyte *)$1);
+}
+
+//***********************************************
+// Beautify important classes
+//***********************************************
+
+
+%include "../uscxml_beautify.i"
+
+
+//***********************************************
+// Parse the header file to generate wrappers
+//***********************************************
+
+%include "../../../uscxml/Common.h"
+%include "../../../uscxml/messages/Blob.h"
+%include "../../../uscxml/messages/Data.h"
+%include "../../../uscxml/messages/Event.h"
+
+%include "../../../uscxml/plugins/Factory.h"
+%include "../../../uscxml/interpreter/InterpreterState.h"
+%include "../../../uscxml/interpreter/InterpreterMonitor.h"
+
+//%include "../../../uscxml/interpreter/MicroStep.h"
+//%include "../../../uscxml/interpreter/ContentExecutor.h"
+
+%include "../../../uscxml/Interpreter.h"
+%include "../../../uscxml/debug/InterpreterIssue.h"
+
+%include "../../../uscxml/plugins/EventHandler.h"
+
+%include "../../../uscxml/plugins/DataModel.h"
+%include "../../../uscxml/plugins/DataModelImpl.h"
+%include "../../../uscxml/plugins/ExecutableContent.h"
+%include "../../../uscxml/plugins/ExecutableContentImpl.h"
+%include "../../../uscxml/plugins/Invoker.h"
+%include "../../../uscxml/plugins/InvokerImpl.h"
+%include "../../../uscxml/plugins/IOProcessor.h"
+%include "../../../uscxml/plugins/IOProcessorImpl.h"
+
+%include "../wrapped/WrappedInvoker.h"
+%include "../wrapped/WrappedDataModel.h"
+%include "../wrapped/WrappedExecutableContent.h"
+%include "../wrapped/WrappedIOProcessor.h"
+%include "../wrapped/WrappedInterpreterMonitor.h"
+
+
+%template(IssueList) std::list<uscxml::InterpreterIssue>;
+%template(DataList) std::list<uscxml::Data>;
+%template(DataMap) std::map<std::string, uscxml::Data>;
+%template(StringSet) std::set<std::string>;
+%template(StringVector) std::vector<std::string>;
+%template(StringList) std::list<std::string>;
+%template(ParamMap) std::map<std::string, std::list<uscxml::Data> >;
+%template(IOProcMap) std::map<std::string, IOProcessor>;
+%template(InvokerMap) std::map<std::string, Invoker>;
diff --git a/src/bindings/swig/php/CMakeLists.txt b/src/bindings/swig/php/CMakeLists.txt
new file mode 100644
index 0000000..802f3a2
--- /dev/null
+++ b/src/bindings/swig/php/CMakeLists.txt
@@ -0,0 +1,100 @@
+# generate PHP module
+
+find_package(PHP5)
+if(PHP5_FOUND)
+ include_directories(${PHP5_INCLUDE_PATH})
+else()
+ message(STATUS "No PHP5 libraries found - not building php module")
+ return()
+endif()
+
+# copied from cmake's FindPHP4.cmake and adapted
+if(APPLE)
+ # this is a hack for now
+ set(PHP_MODULE_CXX_FLAGS "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -Wl")
+ foreach(symbol
+ __efree
+ __emalloc
+ __estrdup
+ __estrndup
+ __object_init
+ __object_init_ex
+ __zend_get_parameters_array_ex
+ __zend_list_find
+ __zval_copy_ctor
+ __zval_copy_ctor_func
+ _add_property_zval_ex
+ _alloc_globals
+ _compiler_globals
+ _convert_to_double
+ _convert_to_long
+ _convert_to_boolean
+ __convert_to_string
+ _gc_remove_zval_from_buffer
+ _call_user_function
+ _php_sprintf
+ _executor_globals
+ _zend_get_constant
+ _zend_lookup_class
+ _zend_register_long_constant
+ _zval_is_true
+ _zend_error
+ _zend_hash_find
+ __zend_hash_add_or_update
+ _zend_register_internal_class_ex
+ _zend_register_list_destructors_ex
+ _zend_register_resource
+ _zend_rsrc_list_get_rsrc_type
+ _zend_wrong_param_count
+ _zend_throw_exception
+ _zval_used_for_init
+ )
+ set(PHP_MODULE_CXX_FLAGS
+ "${PHP_MODULE_CXX_FLAGS},-U,${symbol}")
+ endforeach()
+endif()
+
+#message(FATAL_ERROR "PHP_LDFLAGS: ${PHP_LDFLAGS}")
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${PHP_INCLUDE_DIRS})
+
+SET(CMAKE_SWIG_FLAGS "")
+
+# we need ; to produce a space with the package .. weird
+SET_SOURCE_FILES_PROPERTIES(uscxml.i PROPERTIES CPLUSPLUS ON)
+
+SWIG_ADD_MODULE(uscxmlNativePHP php5 uscxml.i)
+foreach(PHP_LIBRARY ${PHP_LIBRARIES})
+# SWIG_LINK_LIBRARIES(uscxmlNativePHP ${PHP_LIBRARY})
+endforeach()
+SWIG_LINK_LIBRARIES(uscxmlNativePHP uscxml)
+
+if (APPLE)
+ set_target_properties(uscxmlNativePHP PROPERTIES LINK_FLAGS ${PHP_MODULE_CXX_FLAGS})
+endif()
+
+set(PHP_COMPILE_FLAGS "-DSWIG")
+
+if (PHP_ZTS_ENABLED)
+ # we are only building php bindings for unices anyhow
+ set(PHP_COMPILE_FLAGS "${PHP_COMPILE_FLAGS} -DZTS")
+ set(PHP_COMPILE_FLAGS "${PHP_COMPILE_FLAGS} -DPTHREADS")
+endif()
+if (PHP_DEBUG_ENABLED)
+ set(PHP_COMPILE_FLAGS "${PHP_COMPILE_FLAGS} -DZEND_DEBUG")
+endif()
+
+ADD_CUSTOM_COMMAND(
+ TARGET uscxmlNativePHP
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_BINARY_DIR}/uscxmlNativePHP.php
+ ${PROJECT_SOURCE_DIR}/src/bindings/swig/php/uscxmlNativePHP.php
+)
+
+set_target_properties(uscxmlNativePHP PROPERTIES COMPILE_FLAGS ${PHP_COMPILE_FLAGS})
+set_target_properties(uscxmlNativePHP PROPERTIES FOLDER "Bindings")
+
+set(USCXML_LANGUAGE_BINDINGS "php ${USCXML_LANGUAGE_BINDINGS}")
+set(USCXML_LANGUAGE_BINDINGS ${USCXML_LANGUAGE_BINDINGS} PARENT_SCOPE)
diff --git a/src/bindings/swig/php/test.php b/src/bindings/swig/php/test.php
new file mode 100644
index 0000000..739c6a1
--- /dev/null
+++ b/src/bindings/swig/php/test.php
@@ -0,0 +1,85 @@
+<?php
+
+require_once('uscxmlNativePHP.php');
+
+// $exts = get_loaded_extensions();
+// foreach ($exts as $e)
+// {
+// echo "Name: ".$e." --";
+// print_r(get_extension_funcs($e));
+// }
+
+class MyMonitor extends InterpreterMonitor {
+ function beforeExitingStates($interpreter,$statesToExit) {
+ print "MyMonitor.beforeExitingStates()\n";
+ }
+ function afterExitingStates($interpreter) {
+ print "MyMonitor.afterExitingStates()\n";
+ }
+ function beforeEnteringStates($interpreter,$statesToEnter) {
+ print "MyMonitor.beforeEnteringStates()\n";
+ }
+ function afterEnteringStates($interpreter) {
+ print "MyMonitor.afterEnteringStates()\n";
+ }
+ function onStableConfiguration($interpreter) {
+ print "MyMonitor.onStableConfiguration()\n";
+ }
+ function beforeCompletion($interpreter) {
+ print "MyMonitor.beforeCompletion()\n";
+ }
+ function afterCompletion($interpreter) {
+ print "MyMonitor.afterCompletion()\n";
+ }
+ function beforeMicroStep($interpreter) {
+ print "MyMonitor.beforeMicroStep()\n";
+ }
+ function afterMicroStep($interpreter) {
+ print "MyMonitor.afterMicroStep()\n";
+ }
+ function beforeTakingTransitions($interpreter,$transitions) {
+ print "MyMonitor.beforeTakingTransitions()\n";
+ }
+}
+
+$monitor = new MyMonitor();
+
+// run interpreter in blocking mode
+$interpreter = Interpreter::fromURL('https://raw.githubusercontent.com/tklab-tud/uscxml/master/test/uscxml/test-invoked.scxml');
+$interpreter->addMonitor($monitor);
+$interpreter->interpret();
+
+// interleave interpreter execution with this thread
+$interpreter = Interpreter::fromURL('https://raw.githubusercontent.com/tklab-tud/uscxml/master/test/uscxml/test-invoked.scxml');
+$parentQueue = new ParentQueue();
+$interpreter->setParentQueue($parentQueue);
+
+while($interpreter->step() > 0) {
+ $event = $parentQueue->pop();
+ print("Name: " . $event->getName() . "\n");
+ print("Type: " . $event->getType() . "\n");
+ print("Origin: " . $event->getOrigin() . "\n");
+ print("OriginType: " . $event->getOriginType() . "\n");
+ print("Content " . strlen($event->getContent()) . " bytes: \n'" . $event->getContent() . "'\n");
+
+ $namelist = $event->getNameList();
+ print("Namelist ".$namelist->size()." elements: \n");
+ $keys = $event->getNameListKeys();
+ for ($i = 0; $i < $keys->size(); $i++) {
+ print($keys->get($i) . "\t" . Data::toJSON($namelist->get($keys->get($i))) . "\n");
+ }
+
+ $params = $event->getParamMap();
+ print("Params ". $params->size() ." elements: \n");
+ $keys = $event->getParamMapKeys();
+ for ($i = 0; $i < $keys->size(); $i++) {
+ print($keys->get($i)."\n");
+ $paramList = $params->get($keys->get($i));
+ for ($j = 0; $j < $paramList->size(); $j++) {
+ print("\t" . Data::toJSON($paramList->get($i)) . "\n");
+ }
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/src/bindings/swig/php/uscxml.i b/src/bindings/swig/php/uscxml.i
new file mode 100644
index 0000000..12a29e9
--- /dev/null
+++ b/src/bindings/swig/php/uscxml.i
@@ -0,0 +1,400 @@
+%module(directors="1", allprotected="1") uscxmlNativePHP
+
+// provide a macro for the header files
+#define SWIGIMPORTED 1
+
+%include <stl.i>
+%include <std_map.i>
+%include <std_string.i>
+%include <inttypes.i>
+%include "../stl_set.i"
+%include "../stl_list.i"
+
+//%include <boost_shared_ptr.i>
+
+// these are needed at least for the templates to work
+typedef uscxml::Blob Blob;
+typedef uscxml::Data Data;
+typedef uscxml::Event Event;
+typedef uscxml::Invoker Invoker;
+typedef uscxml::IOProcessor IOProcessor;
+typedef uscxml::DataModel DataModel;
+typedef uscxml::DataModelExtension DataModelExtension;
+typedef uscxml::ExecutableContent ExecutableContent;
+typedef uscxml::InvokerImpl InvokerImpl;
+typedef uscxml::IOProcessorImpl IOProcessorImpl;
+typedef uscxml::DataModelImpl DataModelImpl;
+typedef uscxml::ExecutableContentImpl ExecutableContentImpl;
+typedef uscxml::InterpreterIssue InterpreterIssue;
+
+%feature("director") uscxml::WrappedInvoker;
+%feature("director") uscxml::WrappedDataModel;
+%feature("director") uscxml::WrappedDataModelExtension;
+%feature("director") uscxml::WrappedIOProcessor;
+%feature("director") uscxml::WrappedExecutableContent;
+%feature("director") uscxml::WrappedInterpreterMonitor;
+
+// disable warning related to unknown base class
+#pragma SWIG nowarn=401
+// do not warn when we override symbols via extend
+#pragma SWIG nowarn=302
+// do not warn when ignoring overrided method
+#pragma SWIG nowarn=516
+
+//%javaconst(1);
+
+%rename(equals) operator==; // signature is wrong, still useful
+%rename(isValid) operator bool;
+
+//**************************************************
+// This ends up in the generated wrapper code
+//**************************************************
+
+%{
+
+#include "../../../uscxml/Message.h"
+#include "../../../uscxml/Factory.h"
+#include "../../../uscxml/Interpreter.h"
+#include "../../../uscxml/concurrency/BlockingQueue.h"
+#include "../../../uscxml/server/HTTPServer.h"
+//#include "../../../uscxml/debug/DebuggerServlet.h"
+
+#include "../wrapped/WrappedInvoker.h"
+#include "../wrapped/WrappedDataModel.h"
+#include "../wrapped/WrappedExecutableContent.h"
+#include "../wrapped/WrappedIOProcessor.h"
+#include "../wrapped/WrappedInterpreterMonitor.h"
+
+using namespace uscxml;
+using namespace Arabica::DOM;
+
+// the wrapped* C++ classes get rid of DOM nodes and provide more easily wrapped base classes
+#include "../wrapped/WrappedInvoker.cpp"
+#include "../wrapped/WrappedDataModel.cpp"
+#include "../wrapped/WrappedExecutableContent.cpp"
+#include "../wrapped/WrappedIOProcessor.cpp"
+#include "../wrapped/WrappedInterpreterMonitor.cpp"
+
+%}
+
+%insert("begin") %{
+void*** tsrm_ls;
+%}
+
+#if 0
+%define WRAP_THROW_EXCEPTION( MATCH )
+%javaexception("org.uscxml.InterpreterException") MATCH {
+ try {
+ $action
+ }
+ catch ( uscxml::Event& e ) {
+ jclass eclass = jenv->FindClass("org/uscxml/InterpreterException");
+ if ( eclass ) {
+ std::stringstream ss;
+ ss << std::endl << e;
+ jenv->ThrowNew( eclass, ss.str().c_str() );
+ }
+ }
+}
+%enddef
+
+WRAP_THROW_EXCEPTION(uscxml::Interpreter::fromXML);
+WRAP_THROW_EXCEPTION(uscxml::Interpreter::fromURL);
+WRAP_THROW_EXCEPTION(uscxml::Interpreter::step);
+WRAP_THROW_EXCEPTION(uscxml::Interpreter::interpret);
+#endif
+
+%define WRAP_HASHCODE( CLASSNAME )
+%extend CLASSNAME {
+ virtual int hashCode() {
+/* std::cout << "Calc hashcode as " << (int)(size_t)self->getImpl().get() << std::endl << std::flush;*/
+ return (int)(size_t)self->getImpl().get();
+ }
+};
+%enddef
+
+%define WRAP_TO_STRING( CLASSNAME )
+%extend CLASSNAME {
+ virtual std::string toString() {
+ std::stringstream ss;
+ ss << *self;
+ return ss.str();
+ }
+};
+%enddef
+
+WRAP_TO_STRING(uscxml::Event);
+WRAP_TO_STRING(uscxml::Data);
+WRAP_TO_STRING(uscxml::InterpreterIssue);
+
+WRAP_HASHCODE(uscxml::Interpreter);
+
+%include "../uscxml_ignores.i"
+
+// bytearray for Blob::data
+// see: http://stackoverflow.com/questions/9934059/swig-technique-to-wrap-unsigned-binary-data
+
+%apply (char *STRING, size_t LENGTH) { (const char* data, size_t size) };
+
+#if 0
+%typemap(jni) char* getData "jbyteArray"
+%typemap(jtype) char* getData "byte[]"
+%typemap(jstype) char* getData "byte[]"
+%typemap(javaout) char* getData {
+ return $jnicall;
+}
+
+%typemap(out) char* getData {
+ $result = JCALL1(NewByteArray, jenv, ((uscxml::Blob const *)arg1)->getSize());
+ JCALL4(SetByteArrayRegion, jenv, $result, 0, ((uscxml::Blob const *)arg1)->getSize(), (jbyte *)$1);
+}
+#endif
+
+//***********************************************
+// Beautify important classes
+//***********************************************
+
+#if 0
+%javamethodmodifiers uscxml::Event::getParamMap() "private";
+%javamethodmodifiers uscxml::Event::getParamMapKeys() "private";
+%javamethodmodifiers uscxml::Event::setParamMap(const std::map<std::string, std::list<uscxml::Data> >&) "private";
+%javamethodmodifiers uscxml::Event::getNameListKeys() "private";
+%javamethodmodifiers uscxml::Interpreter::getIOProcessorKeys() "private";
+%javamethodmodifiers uscxml::Interpreter::getInvokerKeys() "private";
+%javamethodmodifiers uscxml::Interpreter::getInvokers() "private";
+%javamethodmodifiers uscxml::Interpreter::getIOProcessors() "private";
+%javamethodmodifiers uscxml::Data::getCompoundKeys() "private";
+
+%javamethodmodifiers uscxml::Blob::setData(const char* data, size_t length) "private";
+%javamethodmodifiers uscxml::Blob::setMimeType(const std::string& mimeType) "private";
+#endif
+
+%include "../uscxml_beautify.i"
+
+
+%typemap(javaimports) uscxml::Interpreter %{
+import java.util.Map;
+import java.util.HashMap;
+import java.util.List;
+import java.util.LinkedList;
+import java.net.URL;
+%}
+
+%typemap(javacode) uscxml::Interpreter %{
+ public static Interpreter fromURL(URL uri) throws org.uscxml.InterpreterException {
+ return Interpreter.fromURL(uri.toString());
+ }
+
+ public Map<String, NativeIOProcessor> getIOProcessors() {
+ Map<String, NativeIOProcessor> ioProcs = new HashMap<String, NativeIOProcessor>();
+ StringVector keys = getIOProcessorKeys();
+ IOProcMap ioProcMap = getIOProcessorsNative();
+ for (int i = 0; i < keys.size(); i++) {
+ ioProcs.put(keys.get(i), ioProcMap.get(keys.get(i)));
+ }
+ return ioProcs;
+ }
+
+ public Map<String, NativeInvoker> getInvokers() {
+ Map<String, NativeInvoker> invokers = new HashMap<String, NativeInvoker>();
+ StringVector keys = getInvokerKeys();
+ InvokerMap invokerMap = getInvokersNative();
+ for (int i = 0; i < keys.size(); i++) {
+ invokers.put(keys.get(i), invokerMap.get(keys.get(i)));
+ }
+ return invokers;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other instanceof Interpreter) {
+ return equals((Interpreter)other);
+ }
+ return hashCode() == other.hashCode();
+ }
+%}
+
+#if 0
+%rename(getCompoundNative) uscxml::Data::getCompound();
+%rename(getArrayNative) uscxml::Data::getArray();
+%rename(setCompoundNative) uscxml::Data::setCompound(const std::map<std::string, Data>&);
+%rename(setArrayNative) uscxml::Data::setArray(const std::list<Data>&);
+%javamethodmodifiers uscxml::Data::getCompound() "private";
+%javamethodmodifiers uscxml::Data::getArray() "private";
+%javamethodmodifiers uscxml::Data::setCompound(const std::map<std::string, Data>&) "private";
+%javamethodmodifiers uscxml::Data::setArray(const std::list<Data>&) "private";
+%javamethodmodifiers uscxml::Data::getCompoundKeys() "private";
+#endif
+
+%typemap(javaimports) uscxml::Data %{
+import java.util.Map;
+import java.util.HashMap;
+import java.util.List;
+import java.util.LinkedList;
+%}
+
+%typemap(javacode) uscxml::Data %{
+ public Data(byte[] data, String mimeType) {
+ this(uscxmlNativeJavaJNI.new_Data__SWIG_0(), true);
+ setBinary(new Blob(data, mimeType));
+ }
+
+ public Data(Map<String, Data> compound) {
+ this(uscxmlNativeJavaJNI.new_Data__SWIG_0(), true);
+ setCompound(compound);
+ }
+
+ public Data(List<Data> array) {
+ this(uscxmlNativeJavaJNI.new_Data__SWIG_0(), true);
+ setArray(array);
+ }
+
+ public Map<String, Data> getCompound() {
+ Map<String, Data> compound = new HashMap<String, Data>();
+ DataMap dataMap = getCompoundNative();
+ StringVector dataMapKeys = getCompoundKeys();
+ for (int i = 0; i < dataMapKeys.size(); i++) {
+ compound.put(dataMapKeys.get(i), dataMap.get(dataMapKeys.get(i)));
+ }
+ return compound;
+ }
+
+ public void setCompound(Map<String, Data> compound) {
+ DataMap dataMap = new DataMap();
+ for (String key : compound.keySet()) {
+ dataMap.set(key, compound.get(key));
+ }
+ setCompoundNative(dataMap);
+ }
+
+ public List<Data> getArray() {
+ List<Data> array = new LinkedList<Data>();
+ DataList dataList = getArrayNative();
+ for (int i = 0; i < dataList.size(); i++) {
+ array.add(dataList.get(i));
+ }
+ return array;
+ }
+
+ public void setArray(List<Data> array) {
+ DataList dataList = new DataList();
+ for (Data data : array) {
+ dataList.add(data);
+ }
+ setArrayNative(dataList);
+ }
+
+%}
+
+#if 0
+%rename(getNameListNative) uscxml::Event::getNameList();
+%rename(getParamsNative) uscxml::Event::getParams();
+%rename(setNameListNative) uscxml::Event::setNameList(const std::map<std::string, Data>&);
+%rename(setParamsNative) uscxml::Event::setParams(const std::multimap<std::string, Data>&);
+%javamethodmodifiers uscxml::Event::getNameList() "private";
+%javamethodmodifiers uscxml::Event::getNameListKeys() "private";
+%javamethodmodifiers uscxml::Event::getParams() "private";
+%javamethodmodifiers uscxml::Event::setNameList(const std::map<std::string, Data>&) "private";
+%javamethodmodifiers uscxml::Event::setParams(const std::multimap<std::string, Data>&) "private";
+#endif
+
+%typemap(javaimports) uscxml::Event %{
+import java.util.Map;
+import java.util.HashMap;
+import java.util.List;
+import java.util.LinkedList;
+%}
+
+%typemap(javacode) uscxml::Event %{
+ public Map<String, List<Data>> getParams() {
+ Map<String, List<Data>> params = new HashMap<String, List<Data>>();
+ ParamMap paramMap = getParamMap();
+ StringVector paramMapKeys = getParamMapKeys();
+
+ for (int i = 0; i < paramMapKeys.size(); i++) {
+ String key = paramMapKeys.get(i);
+ DataList dataList = paramMap.get(key);
+
+ for (int j = 0; j < dataList.size(); j++) {
+ Data data = dataList.get(j);
+ if (!params.containsKey(key))
+ params.put(key, new LinkedList<Data>());
+ params.get(key).add(data);
+ }
+ }
+ return params;
+ }
+
+ public void setParams(Map<String, List<Data>> params) {
+ ParamMap paramMap = new ParamMap();
+ for (String key : params.keySet()) {
+ DataList datalist = new DataList();
+ for (Data data : params.get(key)) {
+ datalist.add(data);
+ }
+ paramMap.set(key, datalist);
+ }
+ setParamMap(paramMap);
+ }
+
+ public Map<String, Data> getNameList() {
+ Map<String, Data> namelist = new HashMap<String, Data>();
+ StringVector nameMapKeys = getNameListKeys();
+ DataMap nameMap = getNameListNative();
+
+ for (int i = 0; i < nameMapKeys.size(); i++) {
+ namelist.put(nameMapKeys.get(i), nameMap.get(nameMapKeys.get(i)));
+ }
+ return namelist;
+ }
+
+ public void setNameList(Map<String, Data> namelist) {
+ DataMap nameListMap = new DataMap();
+ for (String key : namelist.keySet()) {
+ nameListMap.set(key, namelist.get(key));
+ }
+ setNameListNative(nameListMap);
+ }
+%}
+
+
+//***********************************************
+// Parse the header file to generate wrappers
+//***********************************************
+
+%include "../../../uscxml/Common.h"
+%include "../../../uscxml/Factory.h"
+%include "../../../uscxml/Message.h"
+%include "../../../uscxml/Interpreter.h"
+%include "../../../uscxml/interpreter/InterpreterState.h"
+%include "../../../uscxml/concurrency/BlockingQueue.h"
+%include "../../../uscxml/server/HTTPServer.h"
+//%include "../../../uscxml/debug/DebuggerServlet.h"
+%include "../../../uscxml/debug/InterpreterIssue.h"
+
+%include "../../../uscxml/messages/Blob.h"
+%include "../../../uscxml/messages/Data.h"
+%include "../../../uscxml/messages/Event.h"
+
+%include "../../../uscxml/plugins/DataModel.h"
+%include "../../../uscxml/plugins/EventHandler.h"
+%include "../../../uscxml/plugins/ExecutableContent.h"
+%include "../../../uscxml/plugins/Invoker.h"
+%include "../../../uscxml/plugins/IOProcessor.h"
+
+%include "../wrapped/WrappedInvoker.h"
+%include "../wrapped/WrappedDataModel.h"
+%include "../wrapped/WrappedExecutableContent.h"
+%include "../wrapped/WrappedIOProcessor.h"
+%include "../wrapped/WrappedInterpreterMonitor.h"
+
+
+%template(IssueList) std::list<uscxml::InterpreterIssue>;
+%template(DataList) std::list<uscxml::Data>;
+%template(DataMap) std::map<std::string, uscxml::Data>;
+%template(StringSet) std::set<std::string>;
+%template(StringVector) std::vector<std::string>;
+%template(StringList) std::list<std::string>;
+%template(ParamMap) std::map<std::string, std::list<uscxml::Data> >;
+%template(IOProcMap) std::map<std::string, IOProcessor>;
+%template(InvokerMap) std::map<std::string, Invoker>;
diff --git a/src/bindings/swig/php/uscxmlNativePHP.php b/src/bindings/swig/php/uscxmlNativePHP.php
new file mode 100644
index 0000000..eac292b
--- /dev/null
+++ b/src/bindings/swig/php/uscxmlNativePHP.php
@@ -0,0 +1,3121 @@
+<?php
+
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 3.0.7
+ *
+ * This file is not intended to be easily readable and contains a number of
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+// Try to load our extension if it's not already loaded.
+if (!extension_loaded('uscxmlNativePHP')) {
+ if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
+ if (!dl('php_uscxmlNativePHP.dll')) return;
+ } else {
+ // PHP_SHLIB_SUFFIX gives 'dylib' on MacOS X but modules are 'so'.
+ if (PHP_SHLIB_SUFFIX === 'dylib') {
+ if (!dl('uscxmlNativePHP.so')) return;
+ } else {
+ if (!dl('uscxmlNativePHP.'.PHP_SHLIB_SUFFIX)) return;
+ }
+ }
+}
+
+
+
+abstract class uscxmlNativePHP {
+ const SWIGIMPORTED = SWIGIMPORTED;
+
+ static function imaxabs($n) {
+ return imaxabs($n);
+ }
+
+ static function imaxdiv($numer,$denom) {
+ $r=imaxdiv($numer,$denom);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new imaxdiv_t($r);
+ }
+ return $r;
+ }
+
+ static function strtoimax($nptr,$endptr,$base) {
+ return strtoimax($nptr,$endptr,$base);
+ }
+
+ static function strtoumax($nptr,$endptr,$base) {
+ return strtoumax($nptr,$endptr,$base);
+ }
+
+ const CAN_NOTHING = 0;
+
+ const CAN_BASIC_HTTP = 1;
+
+ const CAN_GENERIC_HTTP = 2;
+
+ const USCXML_DESTROYED = -2;
+
+ const USCXML_FINISHED = -1;
+
+ const USCXML_IDLE = 0;
+
+ const USCXML_INSTANTIATED = 1;
+
+ const USCXML_MICROSTEPPED = 2;
+
+ const USCXML_MACROSTEPPED = 4;
+
+ static function _dataIndentation_set($_dataIndentation) {
+ _dataIndentation_set($_dataIndentation);
+ }
+
+ static function _dataIndentation_get() {
+ return _dataIndentation_get();
+ }
+}
+
+/* PHP Proxy Classes */
+class imaxdiv_t {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'quot') return imaxdiv_t_quot_set($this->_cPtr,$value);
+ if ($var === 'rem') return imaxdiv_t_rem_set($this->_cPtr,$value);
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'quot') return imaxdiv_t_quot_get($this->_cPtr);
+ if ($var === 'rem') return imaxdiv_t_rem_get($this->_cPtr);
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if (function_exists('imaxdiv_t_'.$var.'_get')) return true;
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_imaxdiv_t') {
+ $this->_cPtr=$res;
+ return;
+ }
+ $this->_cPtr=new_imaxdiv_t();
+ }
+}
+
+class Factory {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($parentFactory_or_pluginPath,$parentFactory=null) {
+ if (is_resource($parentFactory_or_pluginPath) && get_resource_type($parentFactory_or_pluginPath) === '_p_uscxml__Factory') {
+ $this->_cPtr=$parentFactory_or_pluginPath;
+ return;
+ }
+ switch (func_num_args()) {
+ case 1: $this->_cPtr=new_Factory($parentFactory_or_pluginPath); break;
+ default: $this->_cPtr=new_Factory($parentFactory_or_pluginPath,$parentFactory);
+ }
+ }
+
+ function registerIOProcessor($ioProcessor) {
+ Factory_registerIOProcessor($this->_cPtr,$ioProcessor);
+ }
+
+ function registerDataModel($dataModel) {
+ Factory_registerDataModel($this->_cPtr,$dataModel);
+ }
+
+ function registerInvoker($invoker) {
+ Factory_registerInvoker($this->_cPtr,$invoker);
+ }
+
+ function registerExecutableContent($executableContent) {
+ Factory_registerExecutableContent($this->_cPtr,$executableContent);
+ }
+
+ function hasDataModel($type) {
+ return Factory_hasDataModel($this->_cPtr,$type);
+ }
+
+ function hasIOProcessor($type) {
+ return Factory_hasIOProcessor($this->_cPtr,$type);
+ }
+
+ function hasInvoker($type) {
+ return Factory_hasInvoker($this->_cPtr,$type);
+ }
+
+ function hasExecutableContent($localName,$nameSpace) {
+ return Factory_hasExecutableContent($this->_cPtr,$localName,$nameSpace);
+ }
+
+ function listComponents() {
+ Factory_listComponents($this->_cPtr);
+ }
+
+ static function getInstance() {
+ $r=Factory_getInstance();
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Factory($r);
+ }
+ return $r;
+ }
+
+ static function setDefaultPluginPath($path) {
+ Factory_setDefaultPluginPath($path);
+ }
+
+ static function getDefaultPluginPath() {
+ return Factory_getDefaultPluginPath();
+ }
+}
+
+class InterpreterOptions {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ $func = 'InterpreterOptions_'.$var.'_set';
+ if (function_exists($func)) return call_user_func($func,$this->_cPtr,$value);
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ $func = 'InterpreterOptions_'.$var.'_get';
+ if (function_exists($func)) return call_user_func($func,$this->_cPtr);
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if (function_exists('InterpreterOptions_'.$var.'_get')) return true;
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__InterpreterOptions') {
+ $this->_cPtr=$res;
+ return;
+ }
+ $this->_cPtr=new_InterpreterOptions();
+ }
+
+ function isValid() {
+ return InterpreterOptions_isValid($this->_cPtr);
+ }
+
+ static function printUsageAndExit($progName) {
+ InterpreterOptions_printUsageAndExit($progName);
+ }
+
+ function getCapabilities() {
+ return InterpreterOptions_getCapabilities($this->_cPtr);
+ }
+}
+
+class NameSpaceInfo {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__NameSpaceInfo') {
+ $this->_cPtr=$res;
+ return;
+ }
+ $this->_cPtr=new_NameSpaceInfo();
+ }
+
+ function getXMLPrefixForNS($ns) {
+ return NameSpaceInfo_getXMLPrefixForNS($this->_cPtr,$ns);
+ }
+}
+
+class Interpreter {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ static function fromXML($xml,$sourceURL) {
+ $r=Interpreter_fromXML($xml,$sourceURL);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Interpreter($r);
+ }
+ return $r;
+ }
+
+ static function fromURL($URL) {
+ $r=Interpreter_fromURL($URL);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Interpreter($r);
+ }
+ return $r;
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__Interpreter') {
+ $this->_cPtr=$res;
+ return;
+ }
+ $this->_cPtr=new_Interpreter();
+ }
+
+ function isValid() {
+ return Interpreter_isValid($this->_cPtr);
+ }
+
+ function equals($other) {
+ return Interpreter_equals($this->_cPtr,$other);
+ }
+
+ function writeTo($stream) {
+ Interpreter_writeTo($this->_cPtr,$stream);
+ }
+
+ function reset() {
+ Interpreter_reset($this->_cPtr);
+ }
+
+ function interpret() {
+ Interpreter_interpret($this->_cPtr);
+ }
+
+ function step($waitForMS_or_blocking=null) {
+ switch (func_num_args()) {
+ case 0: $r=Interpreter_step($this->_cPtr); break;
+ default: $r=Interpreter_step($this->_cPtr,$waitForMS_or_blocking);
+ }
+ return $r;
+ }
+
+ function validate() {
+ $r=Interpreter_validate($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new IssueList($r);
+ }
+ return $r;
+ }
+
+ function getState() {
+ return Interpreter_getState($this->_cPtr);
+ }
+
+ function addMonitor($monitor) {
+ Interpreter_addMonitor($this->_cPtr,$monitor);
+ }
+
+ function removeMonitor($monitor) {
+ Interpreter_removeMonitor($this->_cPtr,$monitor);
+ }
+
+ function setSourceURL($sourceURL) {
+ Interpreter_setSourceURL($this->_cPtr,$sourceURL);
+ }
+
+ function getSourceURL() {
+ return Interpreter_getSourceURL($this->_cPtr);
+ }
+
+ function getBaseURL($xpathExpr=null) {
+ switch (func_num_args()) {
+ case 0: $r=Interpreter_getBaseURL($this->_cPtr); break;
+ default: $r=Interpreter_getBaseURL($this->_cPtr,$xpathExpr);
+ }
+ return $r;
+ }
+
+ function setNameSpaceInfo($nsInfo) {
+ Interpreter_setNameSpaceInfo($this->_cPtr,$nsInfo);
+ }
+
+ function getNameSpaceInfo() {
+ $r=Interpreter_getNameSpaceInfo($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new NameSpaceInfo($r);
+ }
+ return $r;
+ }
+
+ function getCmdLineOptions() {
+ $r=Interpreter_getCmdLineOptions($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function getDataModel() {
+ $r=Interpreter_getDataModel($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new NativeDataModel($r);
+ }
+ return $r;
+ }
+
+ function getIOProcessorsNative() {
+ $r=Interpreter_getIOProcessorsNative($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new IOProcMap($r);
+ }
+ return $r;
+ }
+
+ function getInvokersNative() {
+ $r=Interpreter_getInvokersNative($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new InvokerMap($r);
+ }
+ return $r;
+ }
+
+ function addDataModelExtension($ext) {
+ Interpreter_addDataModelExtension($this->_cPtr,$ext);
+ }
+
+ function setParentQueue($parentQueue) {
+ Interpreter_setParentQueue($this->_cPtr,$parentQueue);
+ }
+
+ function setFactory($factory) {
+ Interpreter_setFactory($this->_cPtr,$factory);
+ }
+
+ function getFactory() {
+ $r=Interpreter_getFactory($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Factory($r);
+ }
+ return $r;
+ }
+
+ function receiveInternal($event) {
+ Interpreter_receiveInternal($this->_cPtr,$event);
+ }
+
+ function receive($event,$toFront=false) {
+ Interpreter_receive($this->_cPtr,$event,$toFront);
+ }
+
+ function getCurrentEvent() {
+ $r=Interpreter_getCurrentEvent($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Event($r);
+ }
+ return $r;
+ }
+
+ function isInState($stateId) {
+ return Interpreter_isInState($this->_cPtr,$stateId);
+ }
+
+ function setInitalConfiguration($states) {
+ Interpreter_setInitalConfiguration($this->_cPtr,$states);
+ }
+
+ function setCapabilities($capabilities) {
+ Interpreter_setCapabilities($this->_cPtr,$capabilities);
+ }
+
+ function setName($name) {
+ Interpreter_setName($this->_cPtr,$name);
+ }
+
+ function getName() {
+ return Interpreter_getName($this->_cPtr);
+ }
+
+ function getSessionId() {
+ return Interpreter_getSessionId($this->_cPtr);
+ }
+
+ function hasLegalConfiguration() {
+ return Interpreter_hasLegalConfiguration($this->_cPtr);
+ }
+
+ function isLegalConfiguration($config) {
+ return Interpreter_isLegalConfiguration($this->_cPtr,$config);
+ }
+
+ function hashCode() {
+ return Interpreter_hashCode($this->_cPtr);
+ }
+
+ function addIOProcessor($ioProc) {
+ Interpreter_addIOProcessor($this->_cPtr,$ioProc);
+ }
+
+ function setDataModel($dataModel) {
+ Interpreter_setDataModel($this->_cPtr,$dataModel);
+ }
+
+ function setInvoker($invokeId,$invoker) {
+ Interpreter_setInvoker($this->_cPtr,$invokeId,$invoker);
+ }
+
+ function getBasicConfiguration() {
+ $r=Interpreter_getBasicConfiguration($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringVector($r);
+ }
+ return $r;
+ }
+
+ function getConfiguration() {
+ $r=Interpreter_getConfiguration($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringVector($r);
+ }
+ return $r;
+ }
+
+ function getIOProcessorKeys() {
+ $r=Interpreter_getIOProcessorKeys($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringVector($r);
+ }
+ return $r;
+ }
+
+ function getInvokerKeys() {
+ $r=Interpreter_getInvokerKeys($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringVector($r);
+ }
+ return $r;
+ }
+}
+
+class NativeInterpreterMonitor {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__InterpreterMonitor') {
+ $this->_cPtr=$res;
+ return;
+ }
+ $this->_cPtr=new_NativeInterpreterMonitor();
+ }
+
+ function beforeProcessingEvent($interpreter,$event) {
+ NativeInterpreterMonitor_beforeProcessingEvent($this->_cPtr,$interpreter,$event);
+ }
+
+ function beforeMicroStep($interpreter) {
+ NativeInterpreterMonitor_beforeMicroStep($this->_cPtr,$interpreter);
+ }
+
+ function afterMicroStep($interpreter) {
+ NativeInterpreterMonitor_afterMicroStep($this->_cPtr,$interpreter);
+ }
+
+ function onStableConfiguration($interpreter) {
+ NativeInterpreterMonitor_onStableConfiguration($this->_cPtr,$interpreter);
+ }
+
+ function beforeCompletion($interpreter) {
+ NativeInterpreterMonitor_beforeCompletion($this->_cPtr,$interpreter);
+ }
+
+ function afterCompletion($interpreter) {
+ NativeInterpreterMonitor_afterCompletion($this->_cPtr,$interpreter);
+ }
+
+ function reportIssue($interpreter,$issue) {
+ NativeInterpreterMonitor_reportIssue($this->_cPtr,$interpreter,$issue);
+ }
+
+ function copyToInvokers($copy=null) {
+ switch (func_num_args()) {
+ case 0: $r=NativeInterpreterMonitor_copyToInvokers($this->_cPtr); break;
+ default: $r=NativeInterpreterMonitor_copyToInvokers($this->_cPtr,$copy);
+ }
+ return $r;
+ }
+}
+
+class StateTransitionMonitor extends NativeInterpreterMonitor {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ NativeInterpreterMonitor::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return NativeInterpreterMonitor::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return NativeInterpreterMonitor::__isset($var);
+ }
+
+ function beforeTakingTransition($interpreter,$transition,$moreComing) {
+ StateTransitionMonitor_beforeTakingTransition($this->_cPtr,$interpreter,$transition,$moreComing);
+ }
+
+ function onStableConfiguration($interpreter) {
+ StateTransitionMonitor_onStableConfiguration($this->_cPtr,$interpreter);
+ }
+
+ function beforeProcessingEvent($interpreter,$event) {
+ StateTransitionMonitor_beforeProcessingEvent($this->_cPtr,$interpreter,$event);
+ }
+
+ function beforeExitingState($interpreter,$state,$moreComing) {
+ StateTransitionMonitor_beforeExitingState($this->_cPtr,$interpreter,$state,$moreComing);
+ }
+
+ function beforeEnteringState($interpreter,$state,$moreComing) {
+ StateTransitionMonitor_beforeEnteringState($this->_cPtr,$interpreter,$state,$moreComing);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__StateTransitionMonitor') {
+ $this->_cPtr=$res;
+ return;
+ }
+ $this->_cPtr=new_StateTransitionMonitor();
+ }
+}
+
+class HTTPServer {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+ function __construct($h) {
+ $this->_cPtr=$h;
+ }
+
+ const HTTPS = 0;
+
+ const HTTP = HTTPServer_HTTP;
+
+ const WebSockets = HTTPServer_WebSockets;
+
+ static function getInstance($port=null,$wsPort=null,$sslConf=null) {
+ switch (func_num_args()) {
+ case 0: $r=HTTPServer_getInstance(); break;
+ case 1: $r=HTTPServer_getInstance($port); break;
+ default: $r=HTTPServer_getInstance($port,$wsPort,$sslConf);
+ }
+ if (!is_resource($r)) return $r;
+ return new HTTPServer($r);
+ }
+
+ static function getBaseURL($type=null) {
+ switch (func_num_args()) {
+ case 0: $r=HTTPServer_getBaseURL(); break;
+ default: $r=HTTPServer_getBaseURL($type);
+ }
+ return $r;
+ }
+
+ static function registerServlet($path,$servlet) {
+ return HTTPServer_registerServlet($path,$servlet);
+ }
+
+ static function unregisterServlet($servlet) {
+ HTTPServer_unregisterServlet($servlet);
+ }
+}
+
+abstract class HTTPServlet {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+ function __construct($h) {
+ $this->_cPtr=$h;
+ }
+
+ function httpRecvRequest($request) {
+ return HTTPServlet_httpRecvRequest($this->_cPtr,$request);
+ }
+
+ function setURL($url) {
+ HTTPServlet_setURL($this->_cPtr,$url);
+ }
+
+ function canAdaptPath() {
+ return HTTPServlet_canAdaptPath($this->_cPtr);
+ }
+}
+
+abstract class WebSocketServlet {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+ function __construct($h) {
+ $this->_cPtr=$h;
+ }
+
+ function wsRecvRequest($conn,$frame) {
+ return WebSocketServlet_wsRecvRequest($this->_cPtr,$conn,$frame);
+ }
+
+ function setURL($url) {
+ WebSocketServlet_setURL($this->_cPtr,$url);
+ }
+
+ function canAdaptPath() {
+ return WebSocketServlet_canAdaptPath($this->_cPtr);
+ }
+}
+
+class InterpreterIssue {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ $func = 'InterpreterIssue_'.$var.'_set';
+ if (function_exists($func)) return call_user_func($func,$this->_cPtr,$value);
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ $func = 'InterpreterIssue_'.$var.'_get';
+ if (function_exists($func)) return call_user_func($func,$this->_cPtr);
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if (function_exists('InterpreterIssue_'.$var.'_get')) return true;
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ const USCXML_ISSUE_FATAL = 0;
+
+ const USCXML_ISSUE_WARNING = InterpreterIssue_USCXML_ISSUE_WARNING;
+
+ const USCXML_ISSUE_INFO = InterpreterIssue_USCXML_ISSUE_INFO;
+
+ function __construct($msg,$node,$severity,$specRef=null) {
+ if (is_resource($msg) && get_resource_type($msg) === '_p_uscxml__InterpreterIssue') {
+ $this->_cPtr=$msg;
+ return;
+ }
+ switch (func_num_args()) {
+ case 3: $this->_cPtr=new_InterpreterIssue($msg,$node,$severity); break;
+ default: $this->_cPtr=new_InterpreterIssue($msg,$node,$severity,$specRef);
+ }
+ }
+
+ function toString() {
+ return InterpreterIssue_toString($this->_cPtr);
+ }
+}
+
+class Blob {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($other_or_data=null,$mimeType=null) {
+ if (is_resource($other_or_data) && get_resource_type($other_or_data) === '_p_uscxml__Blob') {
+ $this->_cPtr=$other_or_data;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_Blob(); break;
+ case 1: $this->_cPtr=new_Blob($other_or_data); break;
+ default: $this->_cPtr=new_Blob($other_or_data,$mimeType);
+ }
+ }
+
+ function isValid() {
+ return Blob_isValid($this->_cPtr);
+ }
+
+ function equals($other) {
+ return Blob_equals($this->_cPtr,$other);
+ }
+
+ static function fromBase64($base64,$mimeType=null) {
+ switch (func_num_args()) {
+ case 1: $r=Blob_fromBase64($base64); break;
+ default: $r=Blob_fromBase64($base64,$mimeType);
+ }
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Blob($r);
+ }
+ return $r;
+ }
+
+ function base64() {
+ return Blob_base64($this->_cPtr);
+ }
+
+ function md5() {
+ return Blob_md5($this->_cPtr);
+ }
+
+ function getData() {
+ return Blob_getData($this->_cPtr);
+ }
+
+ function getSize() {
+ return Blob_getSize($this->_cPtr);
+ }
+
+ function getMimeType() {
+ return Blob_getMimeType($this->_cPtr);
+ }
+
+ function setMimeType($mimeType) {
+ Blob_setMimeType($this->_cPtr,$mimeType);
+ }
+}
+
+class Data {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ const VERBATIM = 0;
+
+ const INTERPRETED = Data_INTERPRETED;
+
+ function __construct($atom=null,$type=null) {
+ if (is_resource($atom) && get_resource_type($atom) === '_p_uscxml__Data') {
+ $this->_cPtr=$atom;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_Data(); break;
+ case 1: $this->_cPtr=new_Data($atom); break;
+ default: $this->_cPtr=new_Data($atom,$type);
+ }
+ }
+
+ function c_empty() {
+ return Data_c_empty($this->_cPtr);
+ }
+
+ function merge($other) {
+ Data_merge($this->_cPtr,$other);
+ }
+
+ function hasKey($key) {
+ return Data_hasKey($this->_cPtr,$key);
+ }
+
+ function at($key) {
+ $r=Data_at($this->_cPtr,$key);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function item($index) {
+ $r=Data_item($this->_cPtr,$index);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function put($key_or_index,$data) {
+ Data_put($this->_cPtr,$key_or_index,$data);
+ }
+
+ function equals($other) {
+ return Data_equals($this->_cPtr,$other);
+ }
+
+ static function fromJSON($jsonString) {
+ $r=Data_fromJSON($jsonString);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ static function toJSON($data) {
+ return Data_toJSON($data);
+ }
+
+ static function fromXML($xmlString) {
+ $r=Data_fromXML($xmlString);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function toXMLString() {
+ return Data_toXMLString($this->_cPtr);
+ }
+
+ function getCompound() {
+ $r=Data_getCompound($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new DataMap($r);
+ }
+ return $r;
+ }
+
+ function setCompound($compound) {
+ Data_setCompound($this->_cPtr,$compound);
+ }
+
+ function getArray() {
+ $r=Data_getArray($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new DataList($r);
+ }
+ return $r;
+ }
+
+ function setArray($array) {
+ Data_setArray($this->_cPtr,$array);
+ }
+
+ function getAtom() {
+ return Data_getAtom($this->_cPtr);
+ }
+
+ function setAtom($atom) {
+ Data_setAtom($this->_cPtr,$atom);
+ }
+
+ function getBinary() {
+ $r=Data_getBinary($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Blob($r);
+ }
+ return $r;
+ }
+
+ function setBinary($binary) {
+ Data_setBinary($this->_cPtr,$binary);
+ }
+
+ function getType() {
+ return Data_getType($this->_cPtr);
+ }
+
+ function setType($type) {
+ Data_setType($this->_cPtr,$type);
+ }
+
+ function toString() {
+ return Data_toString($this->_cPtr);
+ }
+
+ function getCompoundKeys() {
+ $r=Data_getCompoundKeys($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringVector($r);
+ }
+ return $r;
+ }
+
+ function getXML() {
+ return Data_getXML($this->_cPtr);
+ }
+
+ function setXML($xml) {
+ Data_setXML($this->_cPtr,$xml);
+ }
+}
+
+class Event {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ const INTERNAL = 1;
+
+ const EXTERNAL = 2;
+
+ const PLATFORM = 3;
+
+ function __construct($name=null,$type=null) {
+ if (is_resource($name) && get_resource_type($name) === '_p_uscxml__Event') {
+ $this->_cPtr=$name;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_Event(); break;
+ case 1: $this->_cPtr=new_Event($name); break;
+ default: $this->_cPtr=new_Event($name,$type);
+ }
+ }
+
+ function equals($other) {
+ return Event_equals($this->_cPtr,$other);
+ }
+
+ function getName() {
+ return Event_getName($this->_cPtr);
+ }
+
+ function setName($name) {
+ Event_setName($this->_cPtr,$name);
+ }
+
+ function getEventType() {
+ return Event_getEventType($this->_cPtr);
+ }
+
+ function setEventType($type) {
+ Event_setEventType($this->_cPtr,$type);
+ }
+
+ function getOrigin() {
+ return Event_getOrigin($this->_cPtr);
+ }
+
+ function setOrigin($origin) {
+ Event_setOrigin($this->_cPtr,$origin);
+ }
+
+ function getOriginType() {
+ return Event_getOriginType($this->_cPtr);
+ }
+
+ function setOriginType($originType) {
+ Event_setOriginType($this->_cPtr,$originType);
+ }
+
+ function getDOM() {
+ return Event_getDOM($this->_cPtr);
+ }
+
+ function getRaw() {
+ return Event_getRaw($this->_cPtr);
+ }
+
+ function setRaw($raw) {
+ Event_setRaw($this->_cPtr,$raw);
+ }
+
+ function getContent() {
+ return Event_getContent($this->_cPtr);
+ }
+
+ function setContent($content) {
+ Event_setContent($this->_cPtr,$content);
+ }
+
+ function getXML() {
+ return Event_getXML($this->_cPtr);
+ }
+
+ function setXML($xml) {
+ Event_setXML($this->_cPtr,$xml);
+ }
+
+ function getSendId() {
+ return Event_getSendId($this->_cPtr);
+ }
+
+ function setSendId($sendId) {
+ Event_setSendId($this->_cPtr,$sendId);
+ }
+
+ function getInvokeId() {
+ return Event_getInvokeId($this->_cPtr);
+ }
+
+ function setInvokeId($invokeId) {
+ Event_setInvokeId($this->_cPtr,$invokeId);
+ }
+
+ function getData() {
+ $r=Event_getData($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function setData($data) {
+ Event_setData($this->_cPtr,$data);
+ }
+
+ static function fromXML($xmlString) {
+ $r=Event_fromXML($xmlString);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Event($r);
+ }
+ return $r;
+ }
+
+ function toXMLString() {
+ return Event_toXMLString($this->_cPtr);
+ }
+
+ function getNameList() {
+ $r=Event_getNameList($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new DataMap($r);
+ }
+ return $r;
+ }
+
+ function setNameList($nameList) {
+ Event_setNameList($this->_cPtr,$nameList);
+ }
+
+ function toString() {
+ return Event_toString($this->_cPtr);
+ }
+
+ function getParamMap() {
+ $r=Event_getParamMap($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new ParamMap($r);
+ }
+ return $r;
+ }
+
+ function getParamMapKeys() {
+ $r=Event_getParamMapKeys($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringVector($r);
+ }
+ return $r;
+ }
+
+ function setParamMap($paramMap) {
+ Event_setParamMap($this->_cPtr,$paramMap);
+ }
+
+ function getNameListKeys() {
+ $r=Event_getNameListKeys($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringVector($r);
+ }
+ return $r;
+ }
+}
+
+class InvokeRequest extends Event {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ Event::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return Event::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return Event::__isset($var);
+ }
+
+ function __construct($event=null) {
+ if (is_resource($event) && get_resource_type($event) === '_p_uscxml__InvokeRequest') {
+ $this->_cPtr=$event;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_InvokeRequest(); break;
+ default: $this->_cPtr=new_InvokeRequest($event);
+ }
+ }
+
+ function getType() {
+ return InvokeRequest_getType($this->_cPtr);
+ }
+
+ function setType($type) {
+ InvokeRequest_setType($this->_cPtr,$type);
+ }
+
+ function getSource() {
+ return InvokeRequest_getSource($this->_cPtr);
+ }
+
+ function setSource($src) {
+ InvokeRequest_setSource($this->_cPtr,$src);
+ }
+
+ function isAutoForwarded() {
+ return InvokeRequest_isAutoForwarded($this->_cPtr);
+ }
+
+ function setAutoForwarded($autoForward) {
+ InvokeRequest_setAutoForwarded($this->_cPtr,$autoForward);
+ }
+
+ function toXMLString() {
+ return InvokeRequest_toXMLString($this->_cPtr);
+ }
+
+ function toString() {
+ return InvokeRequest_toString($this->_cPtr);
+ }
+}
+
+class SendRequest extends Event {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ Event::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return Event::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return Event::__isset($var);
+ }
+
+ function __construct($event=null) {
+ if (is_resource($event) && get_resource_type($event) === '_p_uscxml__SendRequest') {
+ $this->_cPtr=$event;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_SendRequest(); break;
+ default: $this->_cPtr=new_SendRequest($event);
+ }
+ }
+
+ function getTarget() {
+ return SendRequest_getTarget($this->_cPtr);
+ }
+
+ function setTarget($target) {
+ SendRequest_setTarget($this->_cPtr,$target);
+ }
+
+ function getType() {
+ return SendRequest_getType($this->_cPtr);
+ }
+
+ function setType($type) {
+ SendRequest_setType($this->_cPtr,$type);
+ }
+
+ function getDelayMs() {
+ return SendRequest_getDelayMs($this->_cPtr);
+ }
+
+ function setDelayMs($delayMs) {
+ SendRequest_setDelayMs($this->_cPtr,$delayMs);
+ }
+
+ function toXMLString() {
+ return SendRequest_toXMLString($this->_cPtr);
+ }
+
+ function toString() {
+ return SendRequest_toString($this->_cPtr);
+ }
+}
+
+abstract class NativeDataModelExtension {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+ function __construct($h) {
+ $this->_cPtr=$h;
+ }
+
+ function provides() {
+ return NativeDataModelExtension_provides($this->_cPtr);
+ }
+
+ function getValueOf($member) {
+ $r=NativeDataModelExtension_getValueOf($this->_cPtr,$member);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function setValueOf($member,$data) {
+ NativeDataModelExtension_setValueOf($this->_cPtr,$member,$data);
+ }
+}
+
+abstract class DataModelImpl {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+ function __construct($h) {
+ $this->_cPtr=$h;
+ }
+
+ function getNames() {
+ $r=DataModelImpl_getNames($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringList($r);
+ }
+ return $r;
+ }
+
+ function validate($location,$schema) {
+ return DataModelImpl_validate($this->_cPtr,$location,$schema);
+ }
+
+ function isLocation($expr) {
+ return DataModelImpl_isLocation($this->_cPtr,$expr);
+ }
+
+ function isValidSyntax($expr) {
+ return DataModelImpl_isValidSyntax($this->_cPtr,$expr);
+ }
+
+ function setEvent($event) {
+ DataModelImpl_setEvent($this->_cPtr,$event);
+ }
+
+ function getStringAsData($content) {
+ $r=DataModelImpl_getStringAsData($this->_cPtr,$content);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function getLength($expr) {
+ return DataModelImpl_getLength($this->_cPtr,$expr);
+ }
+
+ function setForeach($item,$array,$index,$iteration) {
+ DataModelImpl_setForeach($this->_cPtr,$item,$array,$index,$iteration);
+ }
+
+ function pushContext() {
+ DataModelImpl_pushContext($this->_cPtr);
+ }
+
+ function popContext() {
+ DataModelImpl_popContext($this->_cPtr);
+ }
+
+ function evalAsString($expr) {
+ return DataModelImpl_evalAsString($this->_cPtr,$expr);
+ }
+
+ function evalAsBool($scriptNode_or_expr,$expr=null) {
+ switch (func_num_args()) {
+ case 1: $r=DataModelImpl_evalAsBool($this->_cPtr,$scriptNode_or_expr); break;
+ default: $r=DataModelImpl_evalAsBool($this->_cPtr,$scriptNode_or_expr,$expr);
+ }
+ return $r;
+ }
+
+ function isDeclared($expr) {
+ return DataModelImpl_isDeclared($this->_cPtr,$expr);
+ }
+
+ function addExtension($ext) {
+ DataModelImpl_addExtension($this->_cPtr,$ext);
+ }
+
+ function andExpressions($arg1) {
+ return DataModelImpl_andExpressions($this->_cPtr,$arg1);
+ }
+}
+
+class NativeDataModel {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__DataModel') {
+ $this->_cPtr=$res;
+ return;
+ }
+ $this->_cPtr=new_NativeDataModel();
+ }
+
+ function isValid() {
+ return NativeDataModel_isValid($this->_cPtr);
+ }
+
+ function equals($other) {
+ return NativeDataModel_equals($this->_cPtr,$other);
+ }
+
+ function getNames() {
+ $r=NativeDataModel_getNames($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringList($r);
+ }
+ return $r;
+ }
+
+ function validate($location,$schema) {
+ return NativeDataModel_validate($this->_cPtr,$location,$schema);
+ }
+
+ function isLocation($expr) {
+ return NativeDataModel_isLocation($this->_cPtr,$expr);
+ }
+
+ function isValidSyntax($expr) {
+ return NativeDataModel_isValidSyntax($this->_cPtr,$expr);
+ }
+
+ function setEvent($event) {
+ NativeDataModel_setEvent($this->_cPtr,$event);
+ }
+
+ function getStringAsData($content) {
+ $r=NativeDataModel_getStringAsData($this->_cPtr,$content);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function pushContext() {
+ NativeDataModel_pushContext($this->_cPtr);
+ }
+
+ function popContext() {
+ NativeDataModel_popContext($this->_cPtr);
+ }
+
+ function evalAsString($expr) {
+ return NativeDataModel_evalAsString($this->_cPtr,$expr);
+ }
+
+ function evalAsBool($scriptNode,$expr) {
+ return NativeDataModel_evalAsBool($this->_cPtr,$scriptNode,$expr);
+ }
+
+ function getLength($expr) {
+ return NativeDataModel_getLength($this->_cPtr,$expr);
+ }
+
+ function setForeach($item,$array,$index,$iteration) {
+ NativeDataModel_setForeach($this->_cPtr,$item,$array,$index,$iteration);
+ }
+
+ function assign($location,$data) {
+ NativeDataModel_assign($this->_cPtr,$location,$data);
+ }
+
+ function init($location,$data) {
+ NativeDataModel_init($this->_cPtr,$location,$data);
+ }
+
+ function isDeclared($expr) {
+ return NativeDataModel_isDeclared($this->_cPtr,$expr);
+ }
+
+ function andExpressions($expressions) {
+ return NativeDataModel_andExpressions($this->_cPtr,$expressions);
+ }
+
+ function addExtension($ext) {
+ NativeDataModel_addExtension($this->_cPtr,$ext);
+ }
+}
+
+abstract class EventHandlerImpl {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+ function __construct($h) {
+ $this->_cPtr=$h;
+ }
+
+ function getNames() {
+ $r=EventHandlerImpl_getNames($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringList($r);
+ }
+ return $r;
+ }
+
+ function setInvokeId($invokeId) {
+ EventHandlerImpl_setInvokeId($this->_cPtr,$invokeId);
+ }
+
+ function setType($type) {
+ EventHandlerImpl_setType($this->_cPtr,$type);
+ }
+
+ function getType() {
+ return EventHandlerImpl_getType($this->_cPtr);
+ }
+
+ function getDataModelVariables() {
+ $r=EventHandlerImpl_getDataModelVariables($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function send($req) {
+ EventHandlerImpl_send($this->_cPtr,$req);
+ }
+
+ function returnErrorExecution($arg1) {
+ EventHandlerImpl_returnErrorExecution($this->_cPtr,$arg1);
+ }
+
+ function returnErrorCommunication($arg1) {
+ EventHandlerImpl_returnErrorCommunication($this->_cPtr,$arg1);
+ }
+
+ function returnEvent($event,$internal=false) {
+ EventHandlerImpl_returnEvent($this->_cPtr,$event,$internal);
+ }
+}
+
+class EventHandler {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($other=null) {
+ if (is_resource($other) && get_resource_type($other) === '_p_uscxml__EventHandler') {
+ $this->_cPtr=$other;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_EventHandler(); break;
+ default: $this->_cPtr=new_EventHandler($other);
+ }
+ }
+
+ function getNames() {
+ $r=EventHandler_getNames($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringList($r);
+ }
+ return $r;
+ }
+
+ function getDataModelVariables() {
+ $r=EventHandler_getDataModelVariables($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function send($req) {
+ EventHandler_send($this->_cPtr,$req);
+ }
+
+ function setInvokeId($invokeId) {
+ EventHandler_setInvokeId($this->_cPtr,$invokeId);
+ }
+
+ function setType($type) {
+ EventHandler_setType($this->_cPtr,$type);
+ }
+
+ function getType() {
+ return EventHandler_getType($this->_cPtr);
+ }
+}
+
+abstract class ExecutableContentImpl {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+ function __construct($h) {
+ $this->_cPtr=$h;
+ }
+
+ function getLocalName() {
+ return ExecutableContentImpl_getLocalName($this->_cPtr);
+ }
+
+ function getNamespace() {
+ return ExecutableContentImpl_getNamespace($this->_cPtr);
+ }
+
+ function enterElement($node) {
+ ExecutableContentImpl_enterElement($this->_cPtr,$node);
+ }
+
+ function exitElement($node) {
+ ExecutableContentImpl_exitElement($this->_cPtr,$node);
+ }
+
+ function processChildren() {
+ return ExecutableContentImpl_processChildren($this->_cPtr);
+ }
+}
+
+class NativeExecutableContent {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__ExecutableContent') {
+ $this->_cPtr=$res;
+ return;
+ }
+ $this->_cPtr=new_NativeExecutableContent();
+ }
+
+ function isValid() {
+ return NativeExecutableContent_isValid($this->_cPtr);
+ }
+
+ function equals($other) {
+ return NativeExecutableContent_equals($this->_cPtr,$other);
+ }
+
+ function getLocalName() {
+ return NativeExecutableContent_getLocalName($this->_cPtr);
+ }
+
+ function getNamespace() {
+ return NativeExecutableContent_getNamespace($this->_cPtr);
+ }
+
+ function enterElement($node) {
+ NativeExecutableContent_enterElement($this->_cPtr,$node);
+ }
+
+ function exitElement($node) {
+ NativeExecutableContent_exitElement($this->_cPtr,$node);
+ }
+
+ function processChildren() {
+ return NativeExecutableContent_processChildren($this->_cPtr);
+ }
+}
+
+abstract class InvokerImpl extends EventHandlerImpl {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ EventHandlerImpl::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return EventHandlerImpl::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return EventHandlerImpl::__isset($var);
+ }
+ function __construct($h) {
+ $this->_cPtr=$h;
+ }
+
+ function invoke($req) {
+ InvokerImpl_invoke($this->_cPtr,$req);
+ }
+
+ function uninvoke() {
+ InvokerImpl_uninvoke($this->_cPtr);
+ }
+
+ function deleteOnUninvoke() {
+ return InvokerImpl_deleteOnUninvoke($this->_cPtr);
+ }
+}
+
+class NativeInvoker extends EventHandler {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ EventHandler::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return EventHandler::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return EventHandler::__isset($var);
+ }
+
+ function __construct($other=null) {
+ if (is_resource($other) && get_resource_type($other) === '_p_uscxml__Invoker') {
+ $this->_cPtr=$other;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_NativeInvoker(); break;
+ default: $this->_cPtr=new_NativeInvoker($other);
+ }
+ }
+
+ function isValid() {
+ return NativeInvoker_isValid($this->_cPtr);
+ }
+
+ function equals($other) {
+ return NativeInvoker_equals($this->_cPtr,$other);
+ }
+
+ function invoke($req) {
+ NativeInvoker_invoke($this->_cPtr,$req);
+ }
+
+ function uninvoke() {
+ NativeInvoker_uninvoke($this->_cPtr);
+ }
+
+ function deleteOnUninvoke() {
+ return NativeInvoker_deleteOnUninvoke($this->_cPtr);
+ }
+}
+
+abstract class IOProcessorImpl extends EventHandlerImpl {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ EventHandlerImpl::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return EventHandlerImpl::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return EventHandlerImpl::__isset($var);
+ }
+ function __construct($h) {
+ $this->_cPtr=$h;
+ }
+}
+
+class NativeIOProcessor extends EventHandler {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ EventHandler::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return EventHandler::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return EventHandler::__isset($var);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__IOProcessor') {
+ $this->_cPtr=$res;
+ return;
+ }
+ $this->_cPtr=new_NativeIOProcessor();
+ }
+
+ function isValid() {
+ return NativeIOProcessor_isValid($this->_cPtr);
+ }
+
+ function equals($other) {
+ return NativeIOProcessor_equals($this->_cPtr,$other);
+ }
+}
+
+class Invoker extends InvokerImpl {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ InvokerImpl::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return InvokerImpl::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return InvokerImpl::__isset($var);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__WrappedInvoker') {
+ $this->_cPtr=$res;
+ return;
+ }
+ if (get_class($this) === 'Invoker') {
+ $_this = null;
+ } else {
+ $_this = $this;
+ }
+ $this->_cPtr=new_Invoker($_this);
+ }
+
+ function getNames() {
+ $r=Invoker_getNames($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringList($r);
+ }
+ return $r;
+ }
+
+ function getDataModelVariables() {
+ $r=Invoker_getDataModelVariables($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function send($req) {
+ Invoker_send($this->_cPtr,$req);
+ }
+
+ function invoke($req) {
+ Invoker_invoke($this->_cPtr,$req);
+ }
+
+ function uninvoke() {
+ Invoker_uninvoke($this->_cPtr);
+ }
+
+ function deleteOnUninvoke() {
+ return Invoker_deleteOnUninvoke($this->_cPtr);
+ }
+
+ function create($interpreter) {
+ $r=Invoker_create($this->_cPtr,$interpreter);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Invoker($r);
+ }
+ return $r;
+ }
+}
+
+class DataModelExtension extends NativeDataModelExtension {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ NativeDataModelExtension::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return NativeDataModelExtension::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return NativeDataModelExtension::__isset($var);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__WrappedDataModelExtension') {
+ $this->_cPtr=$res;
+ return;
+ }
+ if (get_class($this) === 'DataModelExtension') {
+ $_this = null;
+ } else {
+ $_this = $this;
+ }
+ $this->_cPtr=new_DataModelExtension($_this);
+ }
+
+ function provides() {
+ return DataModelExtension_provides($this->_cPtr);
+ }
+
+ function getValueOf($member) {
+ $r=DataModelExtension_getValueOf($this->_cPtr,$member);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function setValueOf($member,$data) {
+ DataModelExtension_setValueOf($this->_cPtr,$member,$data);
+ }
+}
+
+class DataModel extends DataModelImpl {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ DataModelImpl::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return DataModelImpl::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return DataModelImpl::__isset($var);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__WrappedDataModel') {
+ $this->_cPtr=$res;
+ return;
+ }
+ if (get_class($this) === 'DataModel') {
+ $_this = null;
+ } else {
+ $_this = $this;
+ }
+ $this->_cPtr=new_DataModel($_this);
+ }
+
+ function create($interpreter) {
+ $r=DataModel_create($this->_cPtr,$interpreter);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new DataModel($r);
+ }
+ return $r;
+ }
+
+ function getNames() {
+ $r=DataModel_getNames($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringList($r);
+ }
+ return $r;
+ }
+
+ function andExpressions($arg0) {
+ return DataModel_andExpressions($this->_cPtr,$arg0);
+ }
+
+ function validate($location,$schema) {
+ return DataModel_validate($this->_cPtr,$location,$schema);
+ }
+
+ function setEvent($event) {
+ DataModel_setEvent($this->_cPtr,$event);
+ }
+
+ function getStringAsData($content) {
+ $r=DataModel_getStringAsData($this->_cPtr,$content);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function getLength($expr) {
+ return DataModel_getLength($this->_cPtr,$expr);
+ }
+
+ function setForeach($item,$array,$index,$iteration) {
+ DataModel_setForeach($this->_cPtr,$item,$array,$index,$iteration);
+ }
+
+ function pushContext() {
+ DataModel_pushContext($this->_cPtr);
+ }
+
+ function popContext() {
+ DataModel_popContext($this->_cPtr);
+ }
+
+ function evalAsString($expr) {
+ return DataModel_evalAsString($this->_cPtr,$expr);
+ }
+
+ function isDeclared($expr) {
+ return DataModel_isDeclared($this->_cPtr,$expr);
+ }
+
+ function isLocation($expr) {
+ return DataModel_isLocation($this->_cPtr,$expr);
+ }
+
+ function evalAsBool($expr_or_node_or_elem,$expr_or_content=null) {
+ switch (func_num_args()) {
+ case 1: $this->_cPtr=DataModel_evalAsBool($this->_cPtr,$expr_or_node_or_elem); break;
+ default: $this->_cPtr=DataModel_evalAsBool($this->_cPtr,$expr_or_node_or_elem,$expr_or_content);
+ }
+ return $r;
+ }
+
+ function init($dataElem,$location,$content) {
+ DataModel_init($this->_cPtr,$dataElem,$location,$content);
+ }
+
+ function assign($assignElem,$location,$content) {
+ DataModel_assign($this->_cPtr,$assignElem,$location,$content);
+ }
+
+ function c_eval($scriptElem,$expr) {
+ DataModel_c_eval($this->_cPtr,$scriptElem,$expr);
+ }
+}
+
+class ExecutableContent extends ExecutableContentImpl {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ ExecutableContentImpl::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return ExecutableContentImpl::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return ExecutableContentImpl::__isset($var);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__WrappedExecutableContent') {
+ $this->_cPtr=$res;
+ return;
+ }
+ if (get_class($this) === 'ExecutableContent') {
+ $_this = null;
+ } else {
+ $_this = $this;
+ }
+ $this->_cPtr=new_ExecutableContent($_this);
+ }
+
+ function create($interpreter) {
+ $r=ExecutableContent_create($this->_cPtr,$interpreter);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new ExecutableContent($r);
+ }
+ return $r;
+ }
+
+ function getLocalName() {
+ return ExecutableContent_getLocalName($this->_cPtr);
+ }
+
+ function getNamespace() {
+ return ExecutableContent_getNamespace($this->_cPtr);
+ }
+
+ function processChildren() {
+ return ExecutableContent_processChildren($this->_cPtr);
+ }
+
+ function enterElement($node) {
+ ExecutableContent_enterElement($this->_cPtr,$node);
+ }
+
+ function exitElement($node) {
+ ExecutableContent_exitElement($this->_cPtr,$node);
+ }
+}
+
+class IOProcessor extends IOProcessorImpl {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ IOProcessorImpl::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return IOProcessorImpl::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return IOProcessorImpl::__isset($var);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__WrappedIOProcessor') {
+ $this->_cPtr=$res;
+ return;
+ }
+ if (get_class($this) === 'IOProcessor') {
+ $_this = null;
+ } else {
+ $_this = $this;
+ }
+ $this->_cPtr=new_IOProcessor($_this);
+ }
+
+ function create($interpreter) {
+ $r=IOProcessor_create($this->_cPtr,$interpreter);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new IOProcessor($r);
+ }
+ return $r;
+ }
+
+ function getNames() {
+ $r=IOProcessor_getNames($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new StringList($r);
+ }
+ return $r;
+ }
+
+ function getDataModelVariables() {
+ $r=IOProcessor_getDataModelVariables($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function send($req) {
+ IOProcessor_send($this->_cPtr,$req);
+ }
+}
+
+class InterpreterMonitor extends NativeInterpreterMonitor {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ NativeInterpreterMonitor::__set($var,$value);
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return NativeInterpreterMonitor::__get($var);
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return NativeInterpreterMonitor::__isset($var);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__WrappedInterpreterMonitor') {
+ $this->_cPtr=$res;
+ return;
+ }
+ if (get_class($this) === 'InterpreterMonitor') {
+ $_this = null;
+ } else {
+ $_this = $this;
+ }
+ $this->_cPtr=new_InterpreterMonitor($_this);
+ }
+
+ function beforeExitingState($interpreter,$stateId,$xpath,$state,$moreComing) {
+ InterpreterMonitor_beforeExitingState($this->_cPtr,$interpreter,$stateId,$xpath,$state,$moreComing);
+ }
+
+ function afterExitingState($interpreter,$stateId,$xpath,$state,$moreComing) {
+ InterpreterMonitor_afterExitingState($this->_cPtr,$interpreter,$stateId,$xpath,$state,$moreComing);
+ }
+
+ function beforeExecutingContent($interpreter,$tagName,$xpath,$element) {
+ InterpreterMonitor_beforeExecutingContent($this->_cPtr,$interpreter,$tagName,$xpath,$element);
+ }
+
+ function afterExecutingContent($interpreter,$tagName,$xpath,$element) {
+ InterpreterMonitor_afterExecutingContent($this->_cPtr,$interpreter,$tagName,$xpath,$element);
+ }
+
+ function beforeUninvoking($interpreter,$xpath,$invokeid,$element) {
+ InterpreterMonitor_beforeUninvoking($this->_cPtr,$interpreter,$xpath,$invokeid,$element);
+ }
+
+ function afterUninvoking($interpreter,$xpath,$invokeid,$element) {
+ InterpreterMonitor_afterUninvoking($this->_cPtr,$interpreter,$xpath,$invokeid,$element);
+ }
+
+ function beforeTakingTransition($interpreter,$xpath,$source,$targets,$element,$moreComing) {
+ InterpreterMonitor_beforeTakingTransition($this->_cPtr,$interpreter,$xpath,$source,$targets,$element,$moreComing);
+ }
+
+ function afterTakingTransition($interpreter,$xpath,$source,$targets,$element,$moreComing) {
+ InterpreterMonitor_afterTakingTransition($this->_cPtr,$interpreter,$xpath,$source,$targets,$element,$moreComing);
+ }
+
+ function beforeEnteringState($interpreter,$stateId,$xpath,$state,$moreComing) {
+ InterpreterMonitor_beforeEnteringState($this->_cPtr,$interpreter,$stateId,$xpath,$state,$moreComing);
+ }
+
+ function afterEnteringState($interpreter,$stateId,$xpath,$state,$moreComing) {
+ InterpreterMonitor_afterEnteringState($this->_cPtr,$interpreter,$stateId,$xpath,$state,$moreComing);
+ }
+
+ function beforeInvoking($interpreter,$xpath,$invokeid,$element) {
+ InterpreterMonitor_beforeInvoking($this->_cPtr,$interpreter,$xpath,$invokeid,$element);
+ }
+
+ function afterInvoking($interpreter,$xpath,$invokeid,$element) {
+ InterpreterMonitor_afterInvoking($this->_cPtr,$interpreter,$xpath,$invokeid,$element);
+ }
+
+ function reportIssue($interpreter,$issue) {
+ InterpreterMonitor_reportIssue($this->_cPtr,$interpreter,$issue);
+ }
+}
+
+class IssueList {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function c_list($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_std__listT_uscxml__InterpreterIssue_t') {
+ $this->_cPtr=$res;
+ return;
+ }
+ return new IssueList(new_c_list());
+ }
+
+ function size() {
+ return IssueList_size($this->_cPtr);
+ }
+
+ function c_empty() {
+ return IssueList_c_empty($this->_cPtr);
+ }
+
+ function clear() {
+ IssueList_clear($this->_cPtr);
+ }
+
+ function add($x) {
+ IssueList_add($this->_cPtr,$x);
+ }
+
+ function get($i) {
+ $r=IssueList_get($this->_cPtr,$i);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new InterpreterIssue($r);
+ }
+ return $r;
+ }
+}
+
+class DataList {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+ function __construct($h) {
+ $this->_cPtr=$h;
+ }
+
+ function size() {
+ return DataList_size($this->_cPtr);
+ }
+
+ function c_empty() {
+ return DataList_c_empty($this->_cPtr);
+ }
+
+ function clear() {
+ DataList_clear($this->_cPtr);
+ }
+
+ function add($x) {
+ DataList_add($this->_cPtr,$x);
+ }
+
+ function get($i) {
+ $r=DataList_get($this->_cPtr,$i);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+}
+
+class DataMap {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($arg1=null) {
+ if (is_resource($arg1) && get_resource_type($arg1) === '_p_std__mapT_std__string_uscxml__Data_t') {
+ $this->_cPtr=$arg1;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_DataMap(); break;
+ default: $this->_cPtr=new_DataMap($arg1);
+ }
+ }
+
+ function size() {
+ return DataMap_size($this->_cPtr);
+ }
+
+ function clear() {
+ DataMap_clear($this->_cPtr);
+ }
+
+ function get($key) {
+ $r=DataMap_get($this->_cPtr,$key);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new Data($r);
+ }
+ return $r;
+ }
+
+ function set($key,$x) {
+ DataMap_set($this->_cPtr,$key,$x);
+ }
+
+ function del($key) {
+ DataMap_del($this->_cPtr,$key);
+ }
+
+ function has_key($key) {
+ return DataMap_has_key($this->_cPtr,$key);
+ }
+
+ function is_empty() {
+ return DataMap_is_empty($this->_cPtr);
+ }
+}
+
+class StringSet {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($arg1=null) {
+ if (is_resource($arg1) && get_resource_type($arg1) === '_p_std__setT_std__string_t') {
+ $this->_cPtr=$arg1;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_StringSet(); break;
+ default: $this->_cPtr=new_StringSet($arg1);
+ }
+ }
+
+ function size() {
+ return StringSet_size($this->_cPtr);
+ }
+
+ function c_empty() {
+ return StringSet_c_empty($this->_cPtr);
+ }
+
+ function clear() {
+ StringSet_clear($this->_cPtr);
+ }
+
+ function get($key) {
+ return StringSet_get($this->_cPtr,$key);
+ }
+
+ function insert($key) {
+ StringSet_insert($this->_cPtr,$key);
+ }
+
+ function del($key) {
+ StringSet_del($this->_cPtr,$key);
+ }
+
+ function has_key($key) {
+ return StringSet_has_key($this->_cPtr,$key);
+ }
+}
+
+class StringVector {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($n=null) {
+ if (is_resource($n) && get_resource_type($n) === '_p_std__vectorT_std__string_t') {
+ $this->_cPtr=$n;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_StringVector(); break;
+ default: $this->_cPtr=new_StringVector($n);
+ }
+ }
+
+ function size() {
+ return StringVector_size($this->_cPtr);
+ }
+
+ function capacity() {
+ return StringVector_capacity($this->_cPtr);
+ }
+
+ function reserve($n) {
+ StringVector_reserve($this->_cPtr,$n);
+ }
+
+ function clear() {
+ StringVector_clear($this->_cPtr);
+ }
+
+ function push($x) {
+ StringVector_push($this->_cPtr,$x);
+ }
+
+ function is_empty() {
+ return StringVector_is_empty($this->_cPtr);
+ }
+
+ function pop() {
+ return StringVector_pop($this->_cPtr);
+ }
+
+ function get($i) {
+ return StringVector_get($this->_cPtr,$i);
+ }
+
+ function set($i,$val) {
+ StringVector_set($this->_cPtr,$i,$val);
+ }
+}
+
+class StringList {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+ function __construct($h) {
+ $this->_cPtr=$h;
+ }
+
+ function size() {
+ return StringList_size($this->_cPtr);
+ }
+
+ function c_empty() {
+ return StringList_c_empty($this->_cPtr);
+ }
+
+ function clear() {
+ StringList_clear($this->_cPtr);
+ }
+
+ function add($x) {
+ StringList_add($this->_cPtr,$x);
+ }
+
+ function get($i) {
+ return StringList_get($this->_cPtr,$i);
+ }
+}
+
+class ParamMap {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($arg1=null) {
+ if (is_resource($arg1) && get_resource_type($arg1) === '_p_std__mapT_std__string_std__listT_uscxml__Data_t_t') {
+ $this->_cPtr=$arg1;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_ParamMap(); break;
+ default: $this->_cPtr=new_ParamMap($arg1);
+ }
+ }
+
+ function size() {
+ return ParamMap_size($this->_cPtr);
+ }
+
+ function clear() {
+ ParamMap_clear($this->_cPtr);
+ }
+
+ function get($key) {
+ $r=ParamMap_get($this->_cPtr,$key);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new DataList($r);
+ }
+ return $r;
+ }
+
+ function set($key,$x) {
+ ParamMap_set($this->_cPtr,$key,$x);
+ }
+
+ function del($key) {
+ ParamMap_del($this->_cPtr,$key);
+ }
+
+ function has_key($key) {
+ return ParamMap_has_key($this->_cPtr,$key);
+ }
+
+ function is_empty() {
+ return ParamMap_is_empty($this->_cPtr);
+ }
+}
+
+class IOProcMap {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($arg1=null) {
+ if (is_resource($arg1) && get_resource_type($arg1) === '_p_std__mapT_std__string_uscxml__IOProcessor_t') {
+ $this->_cPtr=$arg1;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_IOProcMap(); break;
+ default: $this->_cPtr=new_IOProcMap($arg1);
+ }
+ }
+
+ function size() {
+ return IOProcMap_size($this->_cPtr);
+ }
+
+ function clear() {
+ IOProcMap_clear($this->_cPtr);
+ }
+
+ function get($key) {
+ $r=IOProcMap_get($this->_cPtr,$key);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new NativeIOProcessor($r);
+ }
+ return $r;
+ }
+
+ function set($key,$x) {
+ IOProcMap_set($this->_cPtr,$key,$x);
+ }
+
+ function del($key) {
+ IOProcMap_del($this->_cPtr,$key);
+ }
+
+ function has_key($key) {
+ return IOProcMap_has_key($this->_cPtr,$key);
+ }
+
+ function is_empty() {
+ return IOProcMap_is_empty($this->_cPtr);
+ }
+}
+
+class InvokerMap {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($arg1=null) {
+ if (is_resource($arg1) && get_resource_type($arg1) === '_p_std__mapT_std__string_uscxml__Invoker_t') {
+ $this->_cPtr=$arg1;
+ return;
+ }
+ switch (func_num_args()) {
+ case 0: $this->_cPtr=new_InvokerMap(); break;
+ default: $this->_cPtr=new_InvokerMap($arg1);
+ }
+ }
+
+ function size() {
+ return InvokerMap_size($this->_cPtr);
+ }
+
+ function clear() {
+ InvokerMap_clear($this->_cPtr);
+ }
+
+ function get($key) {
+ $r=InvokerMap_get($this->_cPtr,$key);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new NativeInvoker($r);
+ }
+ return $r;
+ }
+
+ function set($key,$x) {
+ InvokerMap_set($this->_cPtr,$key,$x);
+ }
+
+ function del($key) {
+ InvokerMap_del($this->_cPtr,$key);
+ }
+
+ function has_key($key) {
+ return InvokerMap_has_key($this->_cPtr,$key);
+ }
+
+ function is_empty() {
+ return InvokerMap_is_empty($this->_cPtr);
+ }
+}
+
+class ParentQueue {
+ public $_cPtr=null;
+ protected $_pData=array();
+
+ function __set($var,$value) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_alter_newobject($this->_cPtr,$value);
+ $this->_pData[$var] = $value;
+ }
+
+ function __get($var) {
+ if ($var === 'thisown') return swig_uscxmlNativePHP_get_newobject($this->_cPtr);
+ return $this->_pData[$var];
+ }
+
+ function __isset($var) {
+ if ($var === 'thisown') return true;
+ return array_key_exists($var, $this->_pData);
+ }
+
+ function __construct($res=null) {
+ if (is_resource($res) && get_resource_type($res) === '_p_uscxml__concurrency__BlockingQueueT_uscxml__SendRequest_t') {
+ $this->_cPtr=$res;
+ return;
+ }
+ $this->_cPtr=new_ParentQueue();
+ }
+
+ function push($elem) {
+ ParentQueue_push($this->_cPtr,$elem);
+ }
+
+ function push_front($elem) {
+ ParentQueue_push_front($this->_cPtr,$elem);
+ }
+
+ function pop() {
+ $r=ParentQueue_pop($this->_cPtr);
+ if (is_resource($r)) {
+ $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
+ if (class_exists($c)) return new $c($r);
+ return new SendRequest($r);
+ }
+ return $r;
+ }
+
+ function clear() {
+ ParentQueue_clear($this->_cPtr);
+ }
+
+ function isEmpty() {
+ return ParentQueue_isEmpty($this->_cPtr);
+ }
+}
+
+
+?>
diff --git a/src/bindings/swig/stl_list.i b/src/bindings/swig/stl_list.i
new file mode 100644
index 0000000..aabd448
--- /dev/null
+++ b/src/bindings/swig/stl_list.i
@@ -0,0 +1,49 @@
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * std_list.i
+ * ----------------------------------------------------------------------------- */
+
+%include <std_common.i>
+
+%{
+#include <list>
+#include <stdexcept>
+%}
+
+namespace std {
+
+ template<class T> class list {
+ public:
+ typedef size_t size_type;
+ typedef T value_type;
+ typedef const value_type& const_reference;
+ list();
+ size_type size() const;
+ %rename(isEmpty) empty;
+ bool empty() const;
+ void clear();
+ %rename(add) push_back;
+ void push_back(const value_type& x);
+ %extend {
+ const_reference get(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ int j;
+ if (i>=0 && i<size) {
+ std::list<T>::const_iterator p;
+ p=self->begin();
+ for (j=0; j<i; j++) {p++;}
+ return (*p);
+ }
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ }
+ };
+}
+
+%define specialize_std_list(T)
+#warning "specialize_std_list - specialization for type T no longer needed"
+%enddef
+
diff --git a/src/bindings/swig/stl_set.i b/src/bindings/swig/stl_set.i
new file mode 100644
index 0000000..d009a7b
--- /dev/null
+++ b/src/bindings/swig/stl_set.i
@@ -0,0 +1,73 @@
+/*=========================================================================
+
+ Program: GDCM (Grassroots DICOM). A DICOM library
+
+ Copyright (c) 2006-2011 Mathieu Malaterre
+ All rights reserved.
+ See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notice for more information.
+
+=========================================================================*/
+/* -----------------------------------------------------------------------------
+ * std_set.i
+ *
+ * SWIG typemaps for std::set
+ * ----------------------------------------------------------------------------- */
+
+%include <std_common.i>
+
+// ------------------------------------------------------------------------
+// std::set
+// ------------------------------------------------------------------------
+
+%{
+#include <set>
+#include <algorithm>
+#include <stdexcept>
+%}
+
+// exported class
+
+namespace std {
+
+ template<class V> class set {
+ // add typemaps here
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef V value_type;
+ set();
+ set(const set<V> &);
+
+ unsigned int size() const;
+ bool empty() const;
+ void clear();
+ %extend {
+ const V& get(const V& key) throw (std::out_of_range) {
+ std::set<V>::iterator i = self->find(key);
+ if (i != self->end())
+ return *i;
+ else
+ throw std::out_of_range("key not found");
+ }
+ void insert(const V& key) { // Do NOT call this function 'set' !
+ self->insert(key);
+ }
+ void del(const V& key) throw (std::out_of_range) {
+ std::set<V>::iterator i = self->find(key);
+ if (i != self->end())
+ self->erase(i);
+ else
+ throw std::out_of_range("key not found");
+ }
+ bool has_key(const V& key) {
+ std::set<V>::iterator i = self->find(key);
+ return i != self->end();
+ }
+ }
+ };
+
+} \ No newline at end of file
diff --git a/src/bindings/swig/uscxml_beautify.i b/src/bindings/swig/uscxml_beautify.i
new file mode 100644
index 0000000..52c8ec5
--- /dev/null
+++ b/src/bindings/swig/uscxml_beautify.i
@@ -0,0 +1,54 @@
+%rename(NativeDataModel) DataModel;
+%rename(DataModel) WrappedDataModel;
+%rename(NativeDataModelExtension) DataModelExtension;
+%rename(DataModelExtension) WrappedDataModelExtension;
+%rename(NativeExecutableContent) ExecutableContent;
+%rename(ExecutableContent) WrappedExecutableContent;
+%rename(NativeInvoker) Invoker;
+%rename(Invoker) WrappedInvoker;
+%rename(NativeIOProcessor) IOProcessor;
+%rename(IOProcessor) WrappedIOProcessor;
+%rename(NativeInterpreterMonitor) InterpreterMonitor;
+%rename(InterpreterMonitor) WrappedInterpreterMonitor;
+
+%rename(getInvokersNative) uscxml::Interpreter::getInvokers();
+%rename(getIOProcessorsNative) uscxml::Interpreter::getIOProcessors();
+
+%extend uscxml::ErrorEvent {
+ std::string toString() {
+ std::stringstream ss;
+ ss << *self;
+ return ss.str();
+ }
+};
+
+%extend uscxml::Interpreter {
+
+ std::vector<std::string> getConfiguration() {
+ std::list<XERCESC_NS::DOMElement*> nativeConfig = self->getConfiguration();
+ std::vector<std::string> config;
+ for (auto state : nativeConfig) {
+ if (HAS_ATTR(state, "id"))
+ config.push_back(ATTR(state, "id"));
+ }
+ return config;
+ }
+
+};
+
+%{
+ #include <easylogging++.h>
+%}
+
+%extend uscxml::Data {
+ std::vector<std::string> getCompoundKeys() {
+ std::vector<std::string> keys;
+ std::map<std::string, Data>::const_iterator iter = self->compound.begin();
+ while(iter != self->compound.end()) {
+ keys.push_back(iter->first);
+ iter++;
+ }
+ return keys;
+ }
+
+};
diff --git a/src/bindings/swig/uscxml_ignores.i b/src/bindings/swig/uscxml_ignores.i
new file mode 100644
index 0000000..4146a35
--- /dev/null
+++ b/src/bindings/swig/uscxml_ignores.i
@@ -0,0 +1,155 @@
+%ignore uscxml::NumAttr;
+%ignore uscxml::SCXMLParser;
+%ignore uscxml::InterpreterImpl;
+%ignore uscxml::BlobImpl;
+%ignore uscxml::StateTransitionMonitor;
+%ignore uscxml::ActionLanguage;
+
+#if 0
+%ignore uscxml::EventHandlerImpl;
+#endif
+
+%ignore uscxml::EventHandlerImpl::setInterpreter(InterpreterImpl*);
+%ignore uscxml::EventHandlerImpl::getInterpreter;
+%ignore uscxml::EventHandlerImpl::getElement;
+%ignore uscxml::EventHandlerImpl::runOnMainThread;
+
+%ignore uscxml::EventHandler::EventHandler(const std::shared_ptr<EventHandlerImpl>);
+%ignore uscxml::EventHandler::EventHandler(EventHandler&);
+%ignore uscxml::EventHandler::setInterpreter(InterpreterImpl*);
+%ignore uscxml::EventHandler::getInterpreter;
+%ignore uscxml::EventHandler::getElement;
+%ignore uscxml::EventHandler::runOnMainThread;
+
+// interpreter
+
+%ignore uscxml::Interpreter::Interpreter(const std::shared_ptr<InterpreterImpl>);
+%ignore uscxml::Interpreter::Interpreter(const Interpreter&);
+%ignore uscxml::Interpreter::fromDocument;
+%ignore uscxml::Interpreter::fromElement;
+%ignore uscxml::Interpreter::fromClone;
+%ignore uscxml::Interpreter::getImpl();
+
+%ignore uscxml::InterpreterOptions;
+
+// InterpreterIssues
+%ignore uscxml::InterpreterIssue::node;
+
+
+// InterpreterMonitor
+
+%ignore uscxml::InterpreterMonitor::beforeExitingState(const XERCESC_NS::DOMElement*);
+%ignore uscxml::InterpreterMonitor::afterExitingState(const XERCESC_NS::DOMElement*);
+%ignore uscxml::InterpreterMonitor::beforeEnteringState(const XERCESC_NS::DOMElement*);
+%ignore uscxml::InterpreterMonitor::afterEnteringState(const XERCESC_NS::DOMElement*);
+
+%ignore uscxml::InterpreterMonitor::beforeUninvoking(const XERCESC_NS::DOMElement*, const std::string&);
+%ignore uscxml::InterpreterMonitor::afterUninvoking(const XERCESC_NS::DOMElement*, const std::string&);
+%ignore uscxml::InterpreterMonitor::beforeInvoking(const XERCESC_NS::DOMElement*, const std::string&);
+%ignore uscxml::InterpreterMonitor::afterInvoking(const XERCESC_NS::DOMElement*, const std::string&);
+
+%ignore uscxml::InterpreterMonitor::beforeTakingTransition(const XERCESC_NS::DOMElement*);
+%ignore uscxml::InterpreterMonitor::afterTakingTransition(const XERCESC_NS::DOMElement*);
+
+%ignore uscxml::InterpreterMonitor::beforeExecutingContent(const XERCESC_NS::DOMElement*);
+%ignore uscxml::InterpreterMonitor::afterExecutingContent(const XERCESC_NS::DOMElement*);
+
+
+%ignore uscxml::InterpreterOptions::fromCmdLine(int, char**);
+%ignore uscxml::InterpreterOptions::additionalParameters;
+%ignore uscxml::InterpreterOptions::interpreters;
+
+// Invoker
+
+%ignore uscxml::Invoker::Invoker(const std::shared_ptr<InvokerImpl>);
+%ignore uscxml::Invoker::setInterpreter(InterpreterImpl*);
+%ignore uscxml::Invoker::getInterpreter;
+
+%ignore uscxml::InvokerImpl::create(InterpreterImpl*);
+%ignore uscxml::InvokerImpl::setInterpreter(InterpreterImpl*);
+%ignore uscxml::InvokerImpl::getInterpreter;
+
+
+// DataModel
+
+%ignore uscxml::DataModel::DataModel(const std::shared_ptr<DataModelImpl>);
+%ignore uscxml::DataModel::DataModel(const DataModel&);
+
+
+%ignore uscxml::WrappedDataModel::create(DataModelCallbacks*);
+%ignore uscxml::DataModelExtension::dm;
+
+// Executable Content
+
+%ignore uscxml::ExecutableContent::ExecutableContent(const std::shared_ptr<ExecutableContentImpl>);
+%ignore uscxml::ExecutableContent::ExecutableContent(const ExecutableContent&);
+%ignore uscxml::ExecutableContent::setInterpreter(InterpreterImpl*);
+%ignore uscxml::ExecutableContent::getInterpreter;
+%ignore uscxml::ExecutableContent::enterElement(const XERCESC_NS::DOMElement*);
+%ignore uscxml::ExecutableContent::exitElement(const XERCESC_NS::DOMElement*s);
+
+%ignore uscxml::ExecutableContentImpl::create(InterpreterImpl*);
+%ignore uscxml::ExecutableContentImpl::enterElement(const XERCESC_NS::DOMElement*);
+%ignore uscxml::ExecutableContentImpl::exitElement(const XERCESC_NS::DOMElement*);
+%ignore uscxml::ExecutableContentImpl::setInterpreter(InterpreterImpl*);
+%ignore uscxml::ExecutableContentImpl::getInterpreter;
+
+%ignore uscxml::WrappedExecutableContent::create(InterpreterImpl*);
+%ignore uscxml::WrappedExecutableContent::enterElement(const XERCESC_NS::DOMElement*);
+%ignore uscxml::WrappedExecutableContent::exitElement(const XERCESC_NS::DOMElement*);
+
+
+// IOProcessor
+
+%ignore uscxml::IOProcessorImpl::create(InterpreterImpl*);
+
+%ignore uscxml::IOProcessor::IOProcessor(const std::shared_ptr<IOProcessorImpl>);
+%ignore uscxml::IOProcessor::IOProcessor(const IOProcessor&);
+
+%ignore uscxml::WrappedIOProcessor::create(InterpreterImpl*);
+
+
+// Factory
+
+%ignore uscxml::Factory::createDataModel;
+%ignore uscxml::Factory::createIOProcessor;
+%ignore uscxml::Factory::createInvoker;
+%ignore uscxml::Factory::createExecutableContent;
+%ignore uscxml::Factory::getIOProcessors;
+
+// Event
+
+%ignore uscxml::Event::getParams();
+%ignore uscxml::Event::getParam;
+%ignore uscxml::Event::setParams;
+
+// HTTPServer
+
+%ignore uscxml::HTTPServer::wsSend;
+%ignore uscxml::HTTPServer::wsBroadcast;
+%ignore uscxml::HTTPServer::reply;
+
+
+// Data
+
+%ignore uscxml::Data::toDocument;
+%ignore uscxml::Data::Data(const XERCESC_NS::DOMElement*);
+%ignore uscxml::Data::Data(const char* data, size_t size, const std::string& mimeType, bool adopt);
+%ignore uscxml::Data::Data(const char* data, size_t size, const std::string& mimeType);
+
+// Blob
+
+%ignore uscxml::Blob::Blob(size_t size);
+%ignore uscxml::Blob::Blob(const char* data, size_t size, const std::string& mimeType, bool adopt);
+%ignore uscxml::Blob::Blob(const std::shared_ptr<BlobImpl>);
+
+
+%ignore operator!=;
+%ignore operator<;
+%ignore operator=;
+%ignore operator[];
+%ignore operator std::list<Data>;
+%ignore operator std::string;
+%ignore operator std::map<std::string,Data>;
+%ignore operator<<;
+
diff --git a/src/bindings/swig/wrapped/WrappedDataModel.cpp b/src/bindings/swig/wrapped/WrappedDataModel.cpp
new file mode 100644
index 0000000..8ba57be
--- /dev/null
+++ b/src/bindings/swig/wrapped/WrappedDataModel.cpp
@@ -0,0 +1,27 @@
+/**
+ * @file
+ * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
+#include "WrappedDataModel.h"
+
+namespace uscxml {
+
+WrappedDataModel::WrappedDataModel() {}
+WrappedDataModel::~WrappedDataModel() {}
+
+} \ No newline at end of file
diff --git a/src/bindings/swig/wrapped/WrappedDataModel.h b/src/bindings/swig/wrapped/WrappedDataModel.h
new file mode 100644
index 0000000..49a3482
--- /dev/null
+++ b/src/bindings/swig/wrapped/WrappedDataModel.h
@@ -0,0 +1,98 @@
+/**
+ * @file
+ * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
+#ifndef WRAPPEDDATAMODEL_H_DBAAD6AF
+#define WRAPPEDDATAMODEL_H_DBAAD6AF
+
+#include <vector>
+#include <list>
+#include <ostream>
+#include <string>
+#include <iostream>
+
+#include <xercesc/dom/DOM.hpp>
+
+#include "../../../uscxml/plugins/DataModelImpl.h"
+
+namespace uscxml {
+
+class WrappedDataModel : public DataModelImpl {
+public:
+
+ WrappedDataModel();
+ virtual ~WrappedDataModel();
+
+ virtual std::shared_ptr<DataModelImpl> create(DataModelCallbacks* callbacks) {
+ std::shared_ptr<WrappedDataModel> dm(create());
+ dm->callbacks = callbacks;
+ return dm;
+ }
+
+ virtual std::list<std::string> getNames() {
+ return std::list<std::string>();
+ }
+
+ virtual WrappedDataModel* create() {
+ return new WrappedDataModel();
+ }
+
+ virtual bool isValidSyntax(const std::string& expr) {
+ return true;
+ }
+
+ virtual void setEvent(const Event& event) {}
+
+ // foreach
+ virtual uint32_t getLength(const std::string& expr) {
+ return 0;
+ }
+
+ virtual void setForeach(const std::string& item,
+ const std::string& array,
+ const std::string& index,
+ uint32_t iteration) {}
+
+ virtual Data getAsData(const std::string& content) {
+ return Data();
+ }
+ virtual Data evalAsData(const std::string& expr) {
+ return Data();
+ }
+ virtual bool evalAsBool(const std::string& expr) {
+ return true;
+ }
+
+ virtual bool isDeclared(const std::string& expr) {
+ return true;
+ }
+
+ virtual void assign(const std::string& location, const Data& data) {}
+ virtual void init(const std::string& location, const Data& data) {}
+
+ virtual std::string andExpressions(std::list<std::string>) {
+ return "";
+ }
+
+protected:
+ DataModelCallbacks* callbacks;
+};
+
+}
+
+#endif /* end of include guard: WRAPPEDDATAMODEL_H_DBAAD6AF */
diff --git a/src/bindings/swig/wrapped/WrappedExecutableContent.cpp b/src/bindings/swig/wrapped/WrappedExecutableContent.cpp
new file mode 100644
index 0000000..09aa6fd
--- /dev/null
+++ b/src/bindings/swig/wrapped/WrappedExecutableContent.cpp
@@ -0,0 +1,43 @@
+/**
+ * @file
+ * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
+#include "WrappedExecutableContent.h"
+#include "uscxml/util/DOM.h"
+#include <xercesc/dom/DOM.hpp>
+#include <ostream>
+
+namespace uscxml {
+
+WrappedExecutableContent::WrappedExecutableContent() {}
+WrappedExecutableContent::~WrappedExecutableContent() {}
+
+void WrappedExecutableContent::enterElement(XERCESC_NS::DOMElement* element) {
+ std::stringstream ss;
+ ss << *element;
+ enterElement(ss.str());
+}
+
+void WrappedExecutableContent::exitElement(XERCESC_NS::DOMElement* element) {
+ std::stringstream ss;
+ ss << *element;
+ exitElement(ss.str());
+}
+
+
+} \ No newline at end of file
diff --git a/src/bindings/swig/wrapped/WrappedExecutableContent.h b/src/bindings/swig/wrapped/WrappedExecutableContent.h
new file mode 100644
index 0000000..0ba8d3e
--- /dev/null
+++ b/src/bindings/swig/wrapped/WrappedExecutableContent.h
@@ -0,0 +1,66 @@
+/**
+ * @file
+ * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
+#ifndef WRAPPEDEXECUTABLECONTENT_H_F690F480
+#define WRAPPEDEXECUTABLECONTENT_H_F690F480
+
+#include <string>
+
+
+#include "../../../uscxml/messages/Event.h"
+#include "../../../uscxml/plugins/Factory.h"
+#include "../../../uscxml/plugins/ExecutableContentImpl.h"
+
+namespace uscxml {
+
+class WrappedExecutableContent : public ExecutableContentImpl {
+public:
+ WrappedExecutableContent();
+ virtual ~WrappedExecutableContent();
+
+ virtual std::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter) {
+ std::shared_ptr<WrappedExecutableContent> ec(new WrappedExecutableContent());
+ return ec;
+ }
+
+ virtual std::string getLocalName() {
+ return "";
+ }
+
+ virtual std::string getNamespace() {
+ return "http://www.w3.org/2005/07/scxml";
+ }
+
+
+ void enterElement(XERCESC_NS::DOMElement* element);
+ virtual void enterElement(const std::string& elementXML) {}
+
+ void exitElement(XERCESC_NS::DOMElement* element);
+ virtual void exitElement(const std::string& elementXML) {}
+
+ virtual bool processChildren() {
+ return true;
+ }
+
+};
+
+}
+
+
+#endif /* end of include guard: WRAPPEDEXECUTABLECONTENT_H_F690F480 */
diff --git a/src/bindings/swig/wrapped/WrappedIOProcessor.cpp b/src/bindings/swig/wrapped/WrappedIOProcessor.cpp
new file mode 100644
index 0000000..d034bc3
--- /dev/null
+++ b/src/bindings/swig/wrapped/WrappedIOProcessor.cpp
@@ -0,0 +1,29 @@
+/**
+ * @file
+ * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
+#include "WrappedIOProcessor.h"
+
+namespace uscxml {
+
+WrappedIOProcessor::WrappedIOProcessor(InterpreterImpl* interpreter) {
+ _interpreter = interpreter;
+}
+WrappedIOProcessor::~WrappedIOProcessor() {}
+
+} \ No newline at end of file
diff --git a/src/bindings/swig/wrapped/WrappedIOProcessor.h b/src/bindings/swig/wrapped/WrappedIOProcessor.h
new file mode 100644
index 0000000..aa5f967
--- /dev/null
+++ b/src/bindings/swig/wrapped/WrappedIOProcessor.h
@@ -0,0 +1,64 @@
+/**
+ * @file
+ * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
+#ifndef WRAPPEDIOPROCESSOR_H_AE98064A
+#define WRAPPEDIOPROCESSOR_H_AE98064A
+
+#include <vector>
+#include <list>
+#include <ostream>
+#include <string>
+
+#include <xercesc/dom/DOM.hpp>
+
+#include "../../../uscxml/messages/Event.h"
+#include "../../../uscxml/plugins/Factory.h"
+#include "../../../uscxml/plugins/IOProcessorImpl.h"
+#include "../../../uscxml/Interpreter.h"
+
+namespace uscxml {
+
+class WrappedIOProcessor : public IOProcessorImpl {
+public:
+ WrappedIOProcessor(InterpreterImpl* interpreter);
+ virtual ~WrappedIOProcessor();
+
+ virtual std::list<std::string> getNames() {
+ return std::list<std::string>();
+ };
+
+ virtual std::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter) {
+ std::shared_ptr<IOProcessorImpl> ioProc = std::shared_ptr<IOProcessorImpl>(new WrappedIOProcessor(interpreter));
+ return ioProc;
+ }
+
+ virtual void eventFromSCXML(const std::string& target, const Event& event) {}
+ virtual bool isValidTarget(const std::string& target) {
+ return true;
+ }
+
+ virtual Data getDataModelVariables() {
+ return Data();
+ }
+};
+
+}
+
+
+#endif /* end of include guard: WRAPPEDIOPROCESSOR_H_AE98064A */
diff --git a/src/bindings/swig/wrapped/WrappedInterpreterMonitor.cpp b/src/bindings/swig/wrapped/WrappedInterpreterMonitor.cpp
new file mode 100644
index 0000000..f066a72
--- /dev/null
+++ b/src/bindings/swig/wrapped/WrappedInterpreterMonitor.cpp
@@ -0,0 +1,147 @@
+/**
+ * @file
+ * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
+#include "WrappedInterpreterMonitor.h"
+#include "uscxml/util/Predicates.h"
+#include "uscxml/util/DOM.h"
+#include <xercesc/dom/DOM.hpp>
+#include <ostream>
+
+namespace uscxml {
+
+using namespace XERCESC_NS;
+
+WrappedInterpreterMonitor::WrappedInterpreterMonitor() {}
+WrappedInterpreterMonitor::~WrappedInterpreterMonitor() {}
+
+void WrappedInterpreterMonitor::beforeExitingState(const XERCESC_NS::DOMElement* state) {
+ std::stringstream ss;
+ ss << *state;
+ beforeExitingState(ATTR(state, "id"), DOMUtils::xPathForNode(state), ss.str());
+}
+
+void WrappedInterpreterMonitor::afterExitingState(const XERCESC_NS::DOMElement* state) {
+ std::stringstream ss;
+ ss << *state;
+ afterExitingState(ATTR(state, "id"), DOMUtils::xPathForNode(state), ss.str());
+}
+
+void WrappedInterpreterMonitor::beforeExecutingContent(const XERCESC_NS::DOMElement* content) {
+ std::stringstream ss;
+ ss << *content;
+ beforeExecutingContent(TAGNAME(content), DOMUtils::xPathForNode(content), ss.str());
+}
+
+void WrappedInterpreterMonitor::afterExecutingContent(const XERCESC_NS::DOMElement* content) {
+ std::stringstream ss;
+ ss << *content;
+ afterExecutingContent(TAGNAME(content), DOMUtils::xPathForNode(content), ss.str());
+}
+
+void WrappedInterpreterMonitor::beforeUninvoking(const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) {
+ std::stringstream ss;
+ ss << *invoker;
+ std::string invokeId;
+ if (invoker->getUserData(X("invokeid")) != NULL) {
+ invokeId = (char*)invoker->getUserData(X("invokeid"));
+ }
+
+ beforeUninvoking(DOMUtils::xPathForNode(invoker), invokeId, ss.str());
+}
+
+void WrappedInterpreterMonitor::afterUninvoking(const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) {
+ std::stringstream ss;
+ ss << *invoker;
+ std::string invokeId;
+ if (invoker->getUserData(X("invokeid")) != NULL) {
+ invokeId = (char*)invoker->getUserData(X("invokeid"));
+ }
+
+ afterUninvoking(DOMUtils::xPathForNode(invoker), invokeId, ss.str());
+}
+
+void WrappedInterpreterMonitor::beforeTakingTransition(const XERCESC_NS::DOMElement* transition) {
+ XERCESC_NS::DOMElement* sourceState = getSourceState(transition);
+ const XERCESC_NS::DOMElement* root = DOMUtils::getNearestAncestor(transition, "scxml");
+
+ std::list<XERCESC_NS::DOMElement*> targetStates = getTargetStates(transition, root);
+
+ std::stringstream ss;
+ ss << *transition;
+
+ std::list<std::string> targets;
+ for (auto t : targetStates) {
+ targets.push_back(ATTR_CAST(t, "id"));
+ }
+
+ beforeTakingTransition(DOMUtils::xPathForNode(transition), ATTR_CAST(sourceState, "id"), targets, ss.str());
+}
+
+void WrappedInterpreterMonitor::afterTakingTransition(const XERCESC_NS::DOMElement* transition) {
+ XERCESC_NS::DOMElement* sourceState = getSourceState(transition);
+ const XERCESC_NS::DOMElement* root = DOMUtils::getNearestAncestor(transition, "scxml");
+
+ std::list<XERCESC_NS::DOMElement*> targetStates = getTargetStates(transition, root);
+
+ std::stringstream ss;
+ ss << *transition;
+
+ std::list<std::string> targets;
+ for (auto t : targetStates) {
+ targets.push_back(ATTR_CAST(t, "id"));
+ }
+
+ afterTakingTransition(DOMUtils::xPathForNode(transition), ATTR_CAST(sourceState, "id"), targets, ss.str());
+}
+
+void WrappedInterpreterMonitor::beforeEnteringState(const XERCESC_NS::DOMElement* state) {
+ std::stringstream ss;
+ ss << *state;
+ beforeEnteringState(ATTR(state, "id"), DOMUtils::xPathForNode(state), ss.str());
+}
+
+void WrappedInterpreterMonitor::afterEnteringState(const XERCESC_NS::DOMElement* state) {
+ std::stringstream ss;
+ ss << *state;
+ afterEnteringState(ATTR(state, "id"), DOMUtils::xPathForNode(state), ss.str());
+}
+
+void WrappedInterpreterMonitor::beforeInvoking(const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) {
+ std::stringstream ss;
+ ss << *invoker;
+ std::string invokeId;
+ if (invoker->getUserData(X("invokeid")) != NULL) {
+ invokeId = (char*)invoker->getUserData(X("invokeid"));
+ }
+
+ beforeInvoking(DOMUtils::xPathForNode(invoker), invokeId, ss.str());
+}
+
+void WrappedInterpreterMonitor::afterInvoking(const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) {
+ std::stringstream ss;
+ ss << *invoker;
+ std::string invokeId;
+ if (invoker->getUserData(X("invokeid")) != NULL) {
+ invokeId = (char*)invoker->getUserData(X("invokeid"));
+ }
+
+ afterInvoking(DOMUtils::xPathForNode(invoker), invokeId, ss.str());
+}
+
+} \ No newline at end of file
diff --git a/src/bindings/swig/wrapped/WrappedInterpreterMonitor.h b/src/bindings/swig/wrapped/WrappedInterpreterMonitor.h
new file mode 100644
index 0000000..e83c896
--- /dev/null
+++ b/src/bindings/swig/wrapped/WrappedInterpreterMonitor.h
@@ -0,0 +1,128 @@
+/**
+ * @file
+ * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
+#ifndef WRAPPEDINTERPRETERMONITOR_H_F5C83A0D
+#define WRAPPEDINTERPRETERMONITOR_H_F5C83A0D
+
+#include <vector>
+#include <list>
+#include <ostream>
+#include <string>
+
+#include <xercesc/dom/DOM.hpp>
+
+#include "uscxml/config.h"
+#include "../../../uscxml/messages/Event.h"
+#include "../../../uscxml/interpreter/InterpreterMonitor.h"
+#include "../../../uscxml/util/DOM.h"
+
+// forward declare
+namespace XERCESC_NS {
+ class DOMElement;
+}
+
+namespace uscxml {
+
+class WrappedInterpreterMonitor : public InterpreterMonitor {
+public:
+ WrappedInterpreterMonitor();
+ virtual ~WrappedInterpreterMonitor();
+
+ void beforeExitingState(const XERCESC_NS::DOMElement* state);
+ virtual void beforeExitingState(const std::string& stateId,
+ const std::string& xpath,
+ const std::string& stateXML) {}
+
+
+ void afterExitingState(const XERCESC_NS::DOMElement* state);
+ virtual void afterExitingState(const std::string& stateId,
+ const std::string& xpath,
+ const std::string& stateXML) {}
+
+
+ void beforeExecutingContent(const XERCESC_NS::DOMElement* content);
+ virtual void beforeExecutingContent(const std::string& tagName,
+ const std::string& xpath,
+ const std::string& contentXML) {}
+
+
+ void afterExecutingContent(const XERCESC_NS::DOMElement* content);
+ virtual void afterExecutingContent(const std::string& tagName,
+ const std::string& xpath,
+ const std::string& contentXML) {}
+
+
+ void beforeUninvoking(const XERCESC_NS::DOMElement* invoker,
+ const std::string& invokeid);
+ virtual void beforeUninvoking(const std::string& xpath,
+ const std::string& invokeid,
+ const std::string& invokerXML) {}
+
+
+ void afterUninvoking(const XERCESC_NS::DOMElement* invoker,
+ const std::string& invokeid);
+ virtual void afterUninvoking(const std::string& xpath,
+ const std::string& invokeid,
+ const std::string& invokerXML) {}
+
+
+ void beforeTakingTransition(const XERCESC_NS::DOMElement* transition);
+ virtual void beforeTakingTransition(const std::string& xpath,
+ const std::string& source,
+ const std::list<std::string>& targets,
+ const std::string& transitionXML) {}
+
+ void afterTakingTransition(const XERCESC_NS::DOMElement* transition);
+ virtual void afterTakingTransition(const std::string& xpath,
+ const std::string& source,
+ const std::list<std::string>& targets,
+ const std::string& transitionXML) {}
+
+
+ void beforeEnteringState(const XERCESC_NS::DOMElement* state);
+ virtual void beforeEnteringState(const std::string& stateId,
+ const std::string& xpath,
+ const std::string& stateXML) {}
+
+
+ void afterEnteringState(const XERCESC_NS::DOMElement* state);
+ virtual void afterEnteringState(const std::string& stateId,
+ const std::string& xpath,
+ const std::string& stateXML) {}
+
+
+ void beforeInvoking(const XERCESC_NS::DOMElement* invoker,
+ const std::string& invokeid);
+ virtual void beforeInvoking(const std::string& xpath,
+ const std::string& invokeid,
+ const std::string& invokerXML) {}
+
+ void afterInvoking(const XERCESC_NS::DOMElement* invoker,
+ const std::string& invokeid);
+ virtual void afterInvoking(const std::string& xpath,
+ const std::string& invokeid,
+ const std::string& invokerXML) {}
+
+ virtual void reportIssue(const InterpreterIssue& issue) {}
+};
+
+}
+
+
+#endif /* end of include guard: WRAPPEDINTERPRETERMONITOR_H_F5C83A0D */
diff --git a/src/bindings/swig/wrapped/WrappedInvoker.cpp b/src/bindings/swig/wrapped/WrappedInvoker.cpp
new file mode 100644
index 0000000..ba76420
--- /dev/null
+++ b/src/bindings/swig/wrapped/WrappedInvoker.cpp
@@ -0,0 +1,29 @@
+/**
+ * @file
+ * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
+#include "WrappedInvoker.h"
+
+namespace uscxml {
+
+WrappedInvoker::WrappedInvoker(InterpreterImpl* interpreter) {
+ _interpreter = interpreter;
+}
+WrappedInvoker::~WrappedInvoker() {}
+
+} \ No newline at end of file
diff --git a/src/bindings/swig/wrapped/WrappedInvoker.h b/src/bindings/swig/wrapped/WrappedInvoker.h
new file mode 100644
index 0000000..3eb4a22
--- /dev/null
+++ b/src/bindings/swig/wrapped/WrappedInvoker.h
@@ -0,0 +1,84 @@
+/**
+ * @file
+ * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
+#ifndef WRAPPEDINVOKER_H_F9725D47
+#define WRAPPEDINVOKER_H_F9725D47
+
+#include <vector>
+#include <list>
+#include <ostream>
+#include <string>
+
+#include <xercesc/dom/DOM.hpp>
+
+#include "../../../uscxml/messages/Event.h"
+#include "../../../uscxml/plugins/Factory.h"
+#include "../../../uscxml/plugins/InvokerImpl.h"
+
+// forward declare
+namespace XERCESC_NS {
+ class DOMElement;
+}
+
+namespace uscxml {
+
+class WrappedInvoker : public InvokerImpl {
+public:
+ WrappedInvoker(InterpreterImpl* interpreter);
+ virtual ~WrappedInvoker();
+
+ virtual std::list<std::string> getNames() {
+ return std::list<std::string>();
+ };
+
+ virtual std::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter) {
+ std::shared_ptr<InvokerImpl> inv = std::shared_ptr<InvokerImpl>(new WrappedInvoker(interpreter));
+ return inv;
+ }
+ virtual void invoke(const std::string& source, const Event& invokeEvent) {}
+ virtual void uninvoke() {}
+
+ virtual void eventFromSCXML(const Event& event) {}
+
+ virtual XERCESC_NS::DOMElement* getFinalize() {
+ return _finalize;
+ }
+ virtual void setFinalize(XERCESC_NS::DOMElement* finalize) {
+ _finalize = finalize;
+ }
+ virtual void setInvokeId(const std::string& invokeId) {
+ _invokeId = invokeId;
+ }
+
+ virtual Data getDataModelVariables() {
+ return Data();
+ }
+
+ void eventToSCXML(Event& event, const std::string& type, const std::string& invokeId, bool internal = false) {
+
+ }
+
+private:
+ InterpreterImpl* _interpreter;
+
+};
+
+}
+
+#endif /* end of include guard: WRAPPEDINVOKER_H_F9725D47 */
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp
index 05fb1fc..a050401 100644
--- a/src/uscxml/Interpreter.cpp
+++ b/src/uscxml/Interpreter.cpp
@@ -192,8 +192,8 @@ void Interpreter::reset() {
return _impl->reset();
}
-InterpreterState Interpreter::step(bool blocking) {
- return _impl->step(blocking);
+InterpreterState Interpreter::step(size_t blockMs) {
+ return _impl->step(blockMs);
};
void Interpreter::cancel() {
@@ -239,7 +239,7 @@ static void printNodeSet(const std::list<XERCESC_NS::DOMElement*> nodes) {
}
}
#endif
-
+
void StateTransitionMonitor::beforeTakingTransition(const XERCESC_NS::DOMElement* transition) {
std::lock_guard<std::recursive_mutex> lock(_mutex);
std::cerr << "Transition: " << uscxml::DOMUtils::xPathForNode(transition) << std::endl;
diff --git a/src/uscxml/Interpreter.h b/src/uscxml/Interpreter.h
index 1596914..bab0ebc 100644
--- a/src/uscxml/Interpreter.h
+++ b/src/uscxml/Interpreter.h
@@ -154,13 +154,19 @@ public:
PIMPL_OPERATORS(Interpreter);
/**
- * Perform a single microstep and return.
- * @param blocking Whether or not to block the thread when waiting for events
- * @return The new state of the interpreter object.
+ * Advance the state-machine by a single microstep and return.
+ *
+ * This is the central function to drive the state machine. Calling step()
+ * will perform one *microstep* and return the current state of the
+ * interpreter. Here, the state is not to be confused with the interpreter's
+ * configuration.
*
- * @todo Have Interpreter::step() take a duration to block
+ * \snippet test-snippets.cpp Performing a microstep
+ *
+ * @param blockMs The maximum duration in milli-seconds to wait for an event to become available.
+ * @return The new state of the interpreter object.
*/
- InterpreterState step(bool blocking = true);
+ InterpreterState step(size_t blockMs = std::numeric_limits<size_t>::max());
/**
* Unblock and mark for finalize.
@@ -177,14 +183,14 @@ public:
* @return A list of XML elements of the active states.
*/
std::list<XERCESC_NS::DOMElement*> getConfiguration();
-
+
/**
* Determine whether the state with the given `id` is in the active configuration.
* @param id An identifier for a state from the SCXML document.
* @return Whether the interpreter is in state `id`.
*/
bool isInState(const std::string& stateId);
-
+
/**
* The current state of the interpreter, not to be confused with its configuration.
* @return The current state of the interpreter object.
@@ -202,12 +208,12 @@ public:
* @event An event to be enqueued
*/
void receive(const Event& event);
-
+
/**
* Adapt the constituting components for a SCXML interpreter.
*/
void setActionLanguage(ActionLanguage actionLanguage);
-
+
/**
* Attach a monitor to make more details of the interpreter observable.
*/
diff --git a/src/uscxml/debug/InterpreterIssue.h b/src/uscxml/debug/InterpreterIssue.h
index c807acc..7eede09 100644
--- a/src/uscxml/debug/InterpreterIssue.h
+++ b/src/uscxml/debug/InterpreterIssue.h
@@ -29,7 +29,7 @@
// forward declare
namespace XERCESC_NS {
- class DOMNode;
+class DOMNode;
}
namespace uscxml {
@@ -54,10 +54,10 @@ public:
IssueSeverity severity; ///< Severity of the issue
std::string specRef; ///< If applicable, the violated section from the standard
- /**
- * Constructor is solely used to report issues at runtime.
- */
- InterpreterIssue(const std::string& msg, XERCESC_NS::DOMNode* node, IssueSeverity severity, const std::string& specRef = "");
+ /**
+ * Constructor is solely used to report issues at runtime.
+ */
+ InterpreterIssue(const std::string& msg, XERCESC_NS::DOMNode* node, IssueSeverity severity, const std::string& specRef = "");
private:
diff --git a/src/uscxml/interpreter/BasicEventQueue.cpp b/src/uscxml/interpreter/BasicEventQueue.cpp
index 5d3fa2d..ee2346d 100644
--- a/src/uscxml/interpreter/BasicEventQueue.cpp
+++ b/src/uscxml/interpreter/BasicEventQueue.cpp
@@ -31,13 +31,20 @@ BasicEventQueue::BasicEventQueue() {
BasicEventQueue::~BasicEventQueue() {
}
-Event BasicEventQueue::dequeue(bool blocking) {
+Event BasicEventQueue::dequeue(size_t blockMs) {
std::lock_guard<std::recursive_mutex> lock(_mutex);
- if (blocking) {
- while (_queue.empty()) {
- _cond.wait(_mutex);
+
+ if (blockMs > 0) {
+ // block for given milliseconds or until queue is filled
+ std::chrono::time_point<std::chrono::system_clock> end, now;
+ now = std::chrono::system_clock::now();
+ end = now + std::chrono::milliseconds(blockMs);
+
+ while (std::chrono::system_clock::now() < end && _queue.empty()) {
+ _cond.wait_for(_mutex, std::chrono::system_clock::now() - end);
}
}
+
if (_queue.size() > 0) {
Event event = _queue.front();
_queue.pop_front();
diff --git a/src/uscxml/interpreter/BasicEventQueue.h b/src/uscxml/interpreter/BasicEventQueue.h
index cfb2b5d..15a1c3c 100644
--- a/src/uscxml/interpreter/BasicEventQueue.h
+++ b/src/uscxml/interpreter/BasicEventQueue.h
@@ -42,7 +42,7 @@ class USCXML_API BasicEventQueue : public EventQueueImpl {
public:
BasicEventQueue();
virtual ~BasicEventQueue();
- virtual Event dequeue(bool blocking);
+ virtual Event dequeue(size_t blockMs);
virtual void enqueue(const Event& event);
protected:
@@ -62,8 +62,8 @@ public:
virtual void enqueueDelayed(const Event& event, size_t delayMs, const std::string& eventUUID);
virtual void cancelDelayed(const std::string& eventId);
virtual void cancelAllDelayed();
- virtual Event dequeue(bool blocking) {
- return BasicEventQueue::dequeue(blocking);
+ virtual Event dequeue(size_t blockMs) {
+ return BasicEventQueue::dequeue(blockMs);
}
virtual void enqueue(const Event& event) {
return BasicEventQueue::enqueue(event);
diff --git a/src/uscxml/interpreter/ContentExecutor.h b/src/uscxml/interpreter/ContentExecutor.h
index 64f5a95..be0de78 100644
--- a/src/uscxml/interpreter/ContentExecutor.h
+++ b/src/uscxml/interpreter/ContentExecutor.h
@@ -28,7 +28,7 @@
// forward declare
namespace XERCESC_NS {
- class DOMElement;
+class DOMElement;
}
namespace uscxml {
diff --git a/src/uscxml/interpreter/EventQueue.cpp b/src/uscxml/interpreter/EventQueue.cpp
index 9b9fa88..c460e02 100644
--- a/src/uscxml/interpreter/EventQueue.cpp
+++ b/src/uscxml/interpreter/EventQueue.cpp
@@ -32,8 +32,8 @@
namespace uscxml {
-Event EventQueue::dequeue(bool blocking) {
- return _impl->dequeue(blocking);
+Event EventQueue::dequeue(size_t blockMs) {
+ return _impl->dequeue(blockMs);
}
void EventQueue::enqueue(const Event& event) {
return _impl->enqueue(event);
diff --git a/src/uscxml/interpreter/EventQueue.h b/src/uscxml/interpreter/EventQueue.h
index 4409b72..1e8b018 100644
--- a/src/uscxml/interpreter/EventQueue.h
+++ b/src/uscxml/interpreter/EventQueue.h
@@ -36,7 +36,7 @@ class USCXML_API EventQueue {
public:
PIMPL_OPERATORS(EventQueue);
- virtual Event dequeue(bool blocking);
+ virtual Event dequeue(size_t blockMs);
virtual void enqueue(const Event& event);
protected:
diff --git a/src/uscxml/interpreter/EventQueueImpl.h b/src/uscxml/interpreter/EventQueueImpl.h
index 1cafd4d..1ccd3f1 100644
--- a/src/uscxml/interpreter/EventQueueImpl.h
+++ b/src/uscxml/interpreter/EventQueueImpl.h
@@ -40,7 +40,7 @@ namespace uscxml {
*/
class USCXML_API EventQueueImpl {
public:
- virtual Event dequeue(bool blocking) = 0;
+ virtual Event dequeue(size_t blockMs) = 0;
virtual void enqueue(const Event& event) = 0;
};
diff --git a/src/uscxml/interpreter/FastMicroStep.cpp b/src/uscxml/interpreter/FastMicroStep.cpp
index bf58f7b..3ad5515 100644
--- a/src/uscxml/interpreter/FastMicroStep.cpp
+++ b/src/uscxml/interpreter/FastMicroStep.cpp
@@ -290,23 +290,23 @@ void FastMicroStep::init(XERCESC_NS::DOMElement* scxml) {
if (parent && parent->getNodeType() == DOMNode::ELEMENT_NODE) {
State* uscxmlState = (State*)parent->getUserData(X("uscxmlState"));
// parent maybe a content element
- if (uscxmlState != NULL) {
- _states[i]->parent = uscxmlState->documentOrder;
- }
+ if (uscxmlState != NULL) {
+ _states[i]->parent = uscxmlState->documentOrder;
+ }
}
while(parent && parent->getNodeType() == DOMNode::ELEMENT_NODE) {
State* uscxmlState = (State*)parent->getUserData(X("uscxmlState"));
- if (uscxmlState == NULL)
- break;
+ if (uscxmlState == NULL)
+ break;
- // ancestors
- BIT_SET_AT(uscxmlState->documentOrder, _states[i]->ancestors);
+ // ancestors
+ BIT_SET_AT(uscxmlState->documentOrder, _states[i]->ancestors);
- // children
- BIT_SET_AT(i, uscxmlState->children);
- parent = parent->getParentNode();
+ // children
+ BIT_SET_AT(i, uscxmlState->children);
+ parent = parent->getParentNode();
}
}
@@ -403,7 +403,7 @@ void FastMicroStep::markAsCancelled() {
_isCancelled = true;
}
-InterpreterState FastMicroStep::step(bool blocking) {
+InterpreterState FastMicroStep::step(size_t blockMs) {
if (!_isInitialized) {
init(_scxml);
return USCXML_INITIALIZED;
@@ -517,7 +517,7 @@ InterpreterState FastMicroStep::step(bool blocking) {
_flags |= USCXML_CTX_STABLE;
}
- if ((_event = _callbacks->dequeueExternal(blocking))) {
+ if ((_event = _callbacks->dequeueExternal(blockMs))) {
USCXML_MONITOR_CALLBACK1(_callbacks->getMonitor(), beforeProcessingEvent, _event);
goto SELECT_TRANSITIONS;
}
diff --git a/src/uscxml/interpreter/FastMicroStep.h b/src/uscxml/interpreter/FastMicroStep.h
index 3789af9..023bb8f 100644
--- a/src/uscxml/interpreter/FastMicroStep.h
+++ b/src/uscxml/interpreter/FastMicroStep.h
@@ -42,7 +42,7 @@ public:
FastMicroStep(MicroStepCallbacks* callbacks);
virtual ~FastMicroStep();
- virtual InterpreterState step(bool blocking);
+ virtual InterpreterState step(size_t blockMs);
virtual void reset();
virtual bool isInState(const std::string& stateId);
virtual std::list<XERCESC_NS::DOMElement*> getConfiguration();
diff --git a/src/uscxml/interpreter/InterpreterImpl.cpp b/src/uscxml/interpreter/InterpreterImpl.cpp
index 880afbc..3383411 100644
--- a/src/uscxml/interpreter/InterpreterImpl.cpp
+++ b/src/uscxml/interpreter/InterpreterImpl.cpp
@@ -259,8 +259,8 @@ bool InterpreterImpl::checkValidSendType(const std::string& type, const std::str
return true;
}
-Event InterpreterImpl::dequeueExternal(bool blocking) {
- _currEvent = _externalQueue.dequeue(blocking);
+Event InterpreterImpl::dequeueExternal(size_t blockMs) {
+ _currEvent = _externalQueue.dequeue(blockMs);
if (_currEvent) {
_dataModel.setEvent(_currEvent);
diff --git a/src/uscxml/interpreter/InterpreterImpl.h b/src/uscxml/interpreter/InterpreterImpl.h
index e1abf9b..e693bbf 100644
--- a/src/uscxml/interpreter/InterpreterImpl.h
+++ b/src/uscxml/interpreter/InterpreterImpl.h
@@ -65,12 +65,12 @@ public:
void cloneFrom(InterpreterImpl* other);
void cloneFrom(std::shared_ptr<InterpreterImpl> other);
- virtual InterpreterState step(bool blocking) {
+ virtual InterpreterState step(size_t blockMs) {
if (!_isInitialized) {
init();
_state = USCXML_INITIALIZED;
} else {
- _state = _microStepper.step(blocking);
+ _state = _microStepper.step(blockMs);
}
return _state;
}
@@ -107,7 +107,7 @@ public:
_dataModel.setEvent(_currEvent);
return _currEvent;
}
- virtual Event dequeueExternal(bool blocking);
+ virtual Event dequeueExternal(size_t blockMs);
virtual bool isTrue(const std::string& expr);
virtual void raiseDoneEvent(XERCESC_NS::DOMElement* state, XERCESC_NS::DOMElement* doneData) {
diff --git a/src/uscxml/interpreter/InterpreterMonitor.h b/src/uscxml/interpreter/InterpreterMonitor.h
index 901e1eb..8dac445 100644
--- a/src/uscxml/interpreter/InterpreterMonitor.h
+++ b/src/uscxml/interpreter/InterpreterMonitor.h
@@ -20,6 +20,7 @@
#ifndef INTERPRETERMONITOR_H_D3F21429
#define INTERPRETERMONITOR_H_D3F21429
+#include "uscxml/config.h"
#include "uscxml/Common.h"
#include "uscxml/messages/Event.h"
#include "uscxml/debug/InterpreterIssue.h"
@@ -41,6 +42,11 @@ if (callback) { callback->function(arg1); }
#define USCXML_MONITOR_CALLBACK2(callback, function, arg1, arg2) \
if (callback) { callback->function(arg1, arg2); }
+// forward declare
+namespace XERCESC_NS {
+ class DOMElement;
+}
+
namespace uscxml {
class USCXML_API InterpreterMonitor {
diff --git a/src/uscxml/interpreter/InterpreterState.h b/src/uscxml/interpreter/InterpreterState.h
index a4741ed..5acbd74 100644
--- a/src/uscxml/interpreter/InterpreterState.h
+++ b/src/uscxml/interpreter/InterpreterState.h
@@ -27,8 +27,7 @@
namespace uscxml {
enum InterpreterState {
- USCXML_FINISHED = -2, ///< machine reached a final configuration and is done
- USCXML_INTERRUPTED = -1, ///< machine received the empty event on the external queue
+ USCXML_FINISHED = -1, ///< machine reached a final configuration and is done
USCXML_UNDEF = 0, ///< not an actual state
USCXML_IDLE = 1, ///< stable configuration and queues empty
USCXML_INITIALIZED = 2, ///< DOM is setup and all external components instantiated
diff --git a/src/uscxml/interpreter/MicroStep.cpp b/src/uscxml/interpreter/MicroStep.cpp
index aa75c91..2876be5 100644
--- a/src/uscxml/interpreter/MicroStep.cpp
+++ b/src/uscxml/interpreter/MicroStep.cpp
@@ -22,8 +22,8 @@
namespace uscxml {
-InterpreterState MicroStep::step(bool blocking) {
- return _impl->step(blocking);
+InterpreterState MicroStep::step(size_t blockMs) {
+ return _impl->step(blockMs);
}
void MicroStep::reset() {
return _impl->reset();
diff --git a/src/uscxml/interpreter/MicroStep.h b/src/uscxml/interpreter/MicroStep.h
index c20e994..a8ea4f0 100644
--- a/src/uscxml/interpreter/MicroStep.h
+++ b/src/uscxml/interpreter/MicroStep.h
@@ -33,7 +33,7 @@
// forward declare
namespace XERCESC_NS {
- class DOMElement;
+class DOMElement;
}
namespace uscxml {
@@ -48,7 +48,7 @@ class USCXML_API MicroStep {
public:
PIMPL_OPERATORS(MicroStep);
- virtual InterpreterState step(bool blocking);
+ virtual InterpreterState step(size_t blockMs);
virtual void reset();
virtual bool isInState(const std::string& stateId);
diff --git a/src/uscxml/interpreter/MicroStepImpl.h b/src/uscxml/interpreter/MicroStepImpl.h
index e4cde5d..be9d974 100644
--- a/src/uscxml/interpreter/MicroStepImpl.h
+++ b/src/uscxml/interpreter/MicroStepImpl.h
@@ -41,7 +41,7 @@ class USCXML_API MicroStepCallbacks {
public:
/** Event Queues / Matching */
virtual Event dequeueInternal() = 0;
- virtual Event dequeueExternal(bool blocking) = 0;
+ virtual Event dequeueExternal(size_t blockMs) = 0;
virtual bool isMatched(const Event& event, const std::string& eventDesc) = 0;
virtual void raiseDoneEvent(XERCESC_NS::DOMElement* state, XERCESC_NS::DOMElement* doneData) = 0;
@@ -73,7 +73,7 @@ public:
MicroStepImpl(MicroStepCallbacks* callbacks) : _callbacks(callbacks) {}
- virtual InterpreterState step(bool blocking) = 0;
+ virtual InterpreterState step(size_t blockMs) = 0;
virtual void reset() = 0; ///< Reset state machine
virtual bool isInState(const std::string& stateId) = 0;
virtual std::list<XERCESC_NS::DOMElement*> getConfiguration() = 0;
diff --git a/src/uscxml/messages/Data.h b/src/uscxml/messages/Data.h
index 6ab3bec..73640f0 100644
--- a/src/uscxml/messages/Data.h
+++ b/src/uscxml/messages/Data.h
@@ -33,8 +33,8 @@
// forward declare
namespace XERCESC_NS {
- class DOMDocument;
- class DOMNode;
+class DOMDocument;
+class DOMNode;
}
namespace uscxml {
diff --git a/src/uscxml/plugins/DataModel.h b/src/uscxml/plugins/DataModel.h
index 03e557c..7716ad7 100644
--- a/src/uscxml/plugins/DataModel.h
+++ b/src/uscxml/plugins/DataModel.h
@@ -43,7 +43,7 @@ public:
PIMPL_OPERATORS(DataModel);
/// @copydoc DataModelImpl::getNames()
- virtual std::list<std::string> getNames();
+ virtual std::list<std::string> getNames();
/// @copydoc DataModelImpl::isValidSyntax()
virtual bool isValidSyntax(const std::string& expr);
diff --git a/src/uscxml/plugins/DataModelImpl.h b/src/uscxml/plugins/DataModelImpl.h
index c3f5390..403a213 100644
--- a/src/uscxml/plugins/DataModelImpl.h
+++ b/src/uscxml/plugins/DataModelImpl.h
@@ -69,11 +69,11 @@ public:
class USCXML_API DataModelImpl {
public:
virtual ~DataModelImpl() {}
-
+
/**
* The Factory wants to instantiate a new instance.
- * This function will have to initialize the object. The actual constructor
- * is called from within here. The only one who calls the constructor directly
+ * This function will have to initialize the object. The actual constructor
+ * is called from within here. The only one who calls the constructor directly
* is the Factory for the prototype object.
*
* @param callbacks The callbacks available to the datamodel
@@ -87,7 +87,7 @@ public:
virtual std::list<std::string> getNames() = 0;
/**
- * Determine whether a given string constitutes valid syntax in the
+ * Determine whether a given string constitutes valid syntax in the
* data-model's language.
* @param expr A string, supposedly containing an expression of the data-model.
* @return Whether expr is in L(DM).
@@ -95,7 +95,7 @@ public:
virtual bool isValidSyntax(const std::string& expr) {
return true; // overwrite when datamodel supports it
}
-
+
/**
* Set the given event as `_event` in the data-model's global scope.
* @param event The event as it was dequeued from either the internal or external queue.
@@ -104,7 +104,7 @@ public:
/**
* Experimental extension to have dynamic content in string literals.
- * This function was used to replace ${foo} expressions on the data-model,
+ * This function was used to replace ${foo} expressions on the data-model,
* e.g. in text nodes. It will eventually make a reappearance I guess.
* @param content The string with tokens to replace.
* @return How many occurences where replaced.
@@ -116,8 +116,8 @@ public:
* @param expr Anything that possibly evaluates to an enumerable object.
* @return The number of items in the enumerable object.
*/
- virtual uint32_t getLength(const std::string& expr) = 0;
-
+ virtual uint32_t getLength(const std::string& expr) = 0;
+
/**
* Set a given item to the object at a given index for one iteration.
* @param item A variable or location to assign the current object to.
@@ -143,7 +143,7 @@ public:
* @return An evaluated structure representing the given compound or literal.
*/
virtual Data evalAsData(const std::string& content) = 0;
-
+
/**
* Evaluate a given expression as a boolean.
* This function is a subset of evalAsData() but saves on creating and copying a Data object.
@@ -162,28 +162,28 @@ public:
/**
* Assign a data object to a location in the data-model.
* There are different occurences in the SCXML IRP tests, e.g.
-\verbatim
-test147:
- <data id="Var1" expr="0"/>
-
-test150:
- <data id="Var3">
- [1,2,3]
- </data>
-
-test277:
- <data id="Var1" expr="return"/>
-\endverbatim
+ \verbatim
+ test147:
+ <data id="Var1" expr="0"/>
+
+ test150:
+ <data id="Var3">
+ [1,2,3]
+ </data>
+
+ test277:
+ <data id="Var1" expr="return"/>
+ \endverbatim
* @param location A variable or locatio to assign to.
* @param data The Data object with the respective data.
*/
virtual void assign(const std::string& location, const Data& data) = 0;
-
+
/**
* Initialize a variable / location in the data-model with a given data object.
- * This is, semantically, very close to assign() but does not assume the
+ * This is, semantically, very close to assign() but does not assume the
* location to be declared first.
- *
+ *
* @param location A variable or locatio to assign to.
* @param data The Data object with the respective data.
*/
@@ -194,10 +194,10 @@ test277:
* @todo This is currently unsupported
*/
virtual void addExtension(DataModelExtension* ext);
-
+
/**
* Concat the given terms into a conjunctive form.
- * @todo This is required to automatically transform a state-chart into a
+ * @todo This is required to automatically transform a state-chart into a
* state-machine. Actual transformation is still only available in legacy though.
*/
virtual std::string andExpressions(std::list<std::string>) {
diff --git a/src/uscxml/plugins/EventHandler.h b/src/uscxml/plugins/EventHandler.h
index e08b1ad..436f878 100644
--- a/src/uscxml/plugins/EventHandler.h
+++ b/src/uscxml/plugins/EventHandler.h
@@ -47,7 +47,7 @@ public:
* Return a list of names for types we implement.
*/
virtual std::list<std::string> getNames() = 0;
-
+
/**
* Export a Data object for the `_x['name']` data-model namespace
* @return An object to be represented at `_x['name']`
diff --git a/src/uscxml/plugins/ExecutableContent.h b/src/uscxml/plugins/ExecutableContent.h
index 14c1d5d..5fb2ac6 100644
--- a/src/uscxml/plugins/ExecutableContent.h
+++ b/src/uscxml/plugins/ExecutableContent.h
@@ -29,7 +29,7 @@
// forward declare
namespace XERCESC_NS {
- class DOMElement;
+class DOMElement;
}
namespace uscxml {
@@ -50,7 +50,7 @@ public:
void enterElement(XERCESC_NS::DOMElement* node);
void exitElement(XERCESC_NS::DOMElement* node);
bool processChildren();
-
+
protected:
std::shared_ptr<ExecutableContentImpl> _impl;
diff --git a/src/uscxml/plugins/IOProcessor.h b/src/uscxml/plugins/IOProcessor.h
index 558edfa..c2b6e30 100644
--- a/src/uscxml/plugins/IOProcessor.h
+++ b/src/uscxml/plugins/IOProcessor.h
@@ -41,7 +41,7 @@ public:
/// @copydoc IOProcessorImpl::eventFromSCXML
virtual void eventFromSCXML(const std::string& target, const Event& event);
-
+
/// @copydoc IOProcessorImpl::isValidTarget
virtual bool isValidTarget(const std::string& target);
diff --git a/src/uscxml/plugins/IOProcessorImpl.h b/src/uscxml/plugins/IOProcessorImpl.h
index 0e5b44a..bd28406 100644
--- a/src/uscxml/plugins/IOProcessorImpl.h
+++ b/src/uscxml/plugins/IOProcessorImpl.h
@@ -24,6 +24,7 @@
#include "uscxml/Common.h"
#include "uscxml/plugins/EventHandler.h"
#include "uscxml/messages/Event.h"
+#include "uscxml/interpreter/InterpreterImpl.h"
namespace uscxml {
@@ -48,7 +49,7 @@ public:
* @param event The event to deliver.
*/
virtual void eventFromSCXML(const std::string& target, const Event& event) = 0;
-
+
/**
* Determine whether the given target is a valid destination for events.
* @param target A target where the Interpreter wants to deliver Event%s to.
@@ -63,7 +64,7 @@ protected:
* @param type The type of this I/O Processor for `event.origintype`.
* @param origin The origin of this I/O Processor for `event.origin`.
* @param internal If the event is to be delivered to the Interpreter's internal queue instead.
- */
+ */
void eventToSCXML(Event& event, const std::string& type, const std::string& origin, bool internal = false);
};
diff --git a/src/uscxml/plugins/Invoker.h b/src/uscxml/plugins/Invoker.h
index 33a89d6..f5c55d5 100644
--- a/src/uscxml/plugins/Invoker.h
+++ b/src/uscxml/plugins/Invoker.h
@@ -28,8 +28,8 @@
#include <xercesc/dom/DOM.hpp>
namespace XERCESC_NS {
- class DOMDocument;
- class DOMNode;
+class DOMDocument;
+class DOMNode;
}
namespace uscxml {
diff --git a/src/uscxml/plugins/InvokerImpl.h b/src/uscxml/plugins/InvokerImpl.h
index d8a3410..7f2e578 100644
--- a/src/uscxml/plugins/InvokerImpl.h
+++ b/src/uscxml/plugins/InvokerImpl.h
@@ -25,6 +25,7 @@
#include "uscxml/Common.h"
#include "uscxml/plugins/EventHandler.h"
#include "uscxml/messages/Event.h"
+#include "uscxml/interpreter/InterpreterImpl.h"
namespace uscxml {
@@ -39,7 +40,7 @@ class USCXML_API InvokerImpl : public EventHandlerImpl {
public:
InvokerImpl() : _finalize(NULL) {};
virtual ~InvokerImpl() {}
-
+
virtual std::list<std::string> getNames() = 0;
/**
@@ -72,7 +73,7 @@ public:
virtual XERCESC_NS::DOMElement* getFinalize() {
return _finalize;
}
-
+
/**
* Set the finalize XML element associated with this invoker.
* @param finalize The finalize XMl element.
@@ -80,7 +81,7 @@ public:
virtual void setFinalize(XERCESC_NS::DOMElement* finalize) {
_finalize = finalize;
}
-
+
/**
* Set the invocation identifier as required when returning events.
* @param invokeId The invocation identifier.
@@ -96,7 +97,7 @@ protected:
* @param type The type of this I/O Processor for `event.origintype`.
* @param invokeId The invocation identifier of this invocation for `event.invokeid`.
* @param internal If the event is to be delivered to the Interpreter's internal queue instead.
- */
+ */
void eventToSCXML(Event& event, const std::string& type, const std::string& invokeId, bool internal = false);
XERCESC_NS::DOMElement* _finalize;
diff --git a/src/uscxml/util/DOM.cpp b/src/uscxml/util/DOM.cpp
index 0e1e9fa..ecf0960 100644
--- a/src/uscxml/util/DOM.cpp
+++ b/src/uscxml/util/DOM.cpp
@@ -194,12 +194,12 @@ bool DOMUtils::isMember(const DOMElement* node,
return false;
}
-const DOMNode* DOMUtils::getNearestAncestor(const DOMNode* node, const std::string tagName) {
+const DOMElement* DOMUtils::getNearestAncestor(const DOMNode* node, const std::string tagName) {
const DOMNode* parent = node->getParentNode();
while(parent) {
if (parent->getNodeType() == DOMNode::ELEMENT_NODE &&
iequals(TAGNAME_CAST(parent), tagName)) {
- return parent;
+ return static_cast<const DOMElement*>(parent);
}
parent = parent->getParentNode();
}
diff --git a/src/uscxml/util/DOM.h b/src/uscxml/util/DOM.h
index 0e8621c..f259ea0 100644
--- a/src/uscxml/util/DOM.h
+++ b/src/uscxml/util/DOM.h
@@ -59,7 +59,7 @@ namespace uscxml {
class USCXML_API DOMUtils {
public:
- static const XERCESC_NS::DOMNode* getNearestAncestor(const XERCESC_NS::DOMNode* node, const std::string tagName);
+ static const XERCESC_NS::DOMElement* getNearestAncestor(const XERCESC_NS::DOMNode* node, const std::string tagName);
static bool isDescendant(const XERCESC_NS::DOMNode* s1, const XERCESC_NS::DOMNode* s2);
diff --git a/src/uscxml/util/URL.cpp b/src/uscxml/util/URL.cpp
index 561b9aa..a76c772 100644
--- a/src/uscxml/util/URL.cpp
+++ b/src/uscxml/util/URL.cpp
@@ -144,9 +144,9 @@ URL URLImpl::resolveWithCWD(URLImpl* relative) {
#if WIN32
std::shared_ptr<URLImpl> cwdURL(new URLImpl(std::string(currPath)));
#else
- std::shared_ptr<URLImpl> cwdURL(new URLImpl(std::string("file://") + currPath + PATH_SEPERATOR));
+ std::shared_ptr<URLImpl> cwdURL(new URLImpl(std::string("file://") + currPath + PATH_SEPERATOR));
#endif
-
+
return resolve(relative, cwdURL.get());
}
diff --git a/src/uscxml/util/URL.h b/src/uscxml/util/URL.h
index dba8e3d..8127892 100644
--- a/src/uscxml/util/URL.h
+++ b/src/uscxml/util/URL.h
@@ -191,7 +191,7 @@ protected:
class USCXML_API URL {
public:
PIMPL_OPERATORS(URL);
-
+
URL(const std::string url) : _impl(new URLImpl(url)) {}
bool isAbsolute() {
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index b90ff54..2288e31 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -26,6 +26,14 @@ endfunction()
USCXML_TEST_COMPILE(NAME test-url LABEL general/test-url FILES src/test-url.cpp)
USCXML_TEST_COMPILE(NAME test-lifecycle LABEL general/test-lifecycle FILES src/test-lifecycle.cpp)
USCXML_TEST_COMPILE(NAME test-validating LABEL general/test-validating FILES src/test-validating.cpp)
+USCXML_TEST_COMPILE(NAME test-snippets LABEL general/test-snippets FILES src/test-snippets.cpp)
+
+file(GLOB_RECURSE USCXML_WRAPPERS
+ ${PROJECT_SOURCE_DIR}/src/bindings/swig/wrapped/*.cpp
+ ${PROJECT_SOURCE_DIR}/src/bindings/swig/wrapped/*.h
+)
+
+USCXML_TEST_COMPILE(NAME test-bindings LABEL general/test-bindings FILES ${USCXML_WRAPPERS} src/test-bindings.cpp)
# the one binary to test for pass / fail final states
add_executable(test-state-pass src/test-state-pass.cpp ${GETOPT_FILES})
diff --git a/test/bindings/java/org/uscxml/dm/jexl/JEXLDataModel.java b/test/bindings/java/org/uscxml/dm/jexl/JEXLDataModel.java
new file mode 100644
index 0000000..33da96c
--- /dev/null
+++ b/test/bindings/java/org/uscxml/dm/jexl/JEXLDataModel.java
@@ -0,0 +1,261 @@
+package org.uscxml.dm.jexl;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.jexl3.JexlBuilder;
+import org.apache.commons.jexl3.JexlContext;
+import org.apache.commons.jexl3.JexlEngine;
+import org.apache.commons.jexl3.JexlException;
+import org.apache.commons.jexl3.JexlExpression;
+import org.apache.commons.jexl3.MapContext;
+import org.uscxml.Data;
+import org.uscxml.DataList;
+import org.uscxml.DataMap;
+import org.uscxml.DataModel;
+import org.uscxml.ErrorEvent;
+import org.uscxml.Event;
+import org.uscxml.StringList;
+import org.uscxml.StringVector;
+
+public class JEXLDataModel extends DataModel {
+
+ protected static final JexlEngine jexl = new JexlBuilder().cache(512).strict(true).silent(false).create();
+ protected JexlContext ctx;
+
+
+
+ @Override
+ public StringList getNames() {
+ StringList names = new StringList();
+ names.add("jexl");
+ return names;
+ }
+
+ @Override
+ public DataModel create() {
+ JEXLDataModel dm = new JEXLDataModel();
+ dm.ctx = new MapContext();
+ return dm;
+ }
+
+ @Override
+ public boolean isValidSyntax(String expr) {
+ try {
+ jexl.createExpression(expr);
+ return true;
+ } catch(JexlException e) {
+ return false;
+ }
+ }
+
+ @Override
+ public void setEvent(Event event) {
+ ctx.set("_event", event);
+ }
+
+ @Override
+ public Data getAsData(String content) {
+ try {
+ JexlExpression ex = jexl.createExpression(content);
+ return getJexlObjectAsData(ex.evaluate(ctx));
+ } catch(Exception e) {
+ }
+ return null;
+ }
+
+ @Override
+ public Data evalAsData(String content) {
+ return new Data();
+ }
+
+ @Override
+ public boolean evalAsBool(String expr) {
+ try {
+ JexlExpression ex = jexl.createExpression("!!" + expr);
+ Object result = ex.evaluate(ctx);
+ return (Boolean) result;
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+
+ @Override
+ public long getLength(String expr) {
+ try {
+ JexlExpression ex = jexl.createExpression(expr);
+ Object res = ex.evaluate(ctx);
+
+ return Array.getLength(res);
+
+ } catch(Exception e) {
+ throw new ErrorEvent("Cannot evaluate '" + expr + "' as an array: " + e.getMessage());
+ }
+ }
+
+ @Override
+ public void setForeach(String item, String array, String index, long iteration) {
+ Object res = null;
+ try {
+ JexlExpression ex = jexl.createExpression(array);
+ res = ex.evaluate(ctx);
+ } catch(Exception e) {
+ throw new ErrorEvent("Cannot evaluate '" + array + "' as an array: " + e.getMessage());
+ }
+ try {
+ JexlExpression ex = jexl.createExpression(item + "==" + item + ";");
+ ex.evaluate(ctx);
+
+ ctx.set(item, Array.get(res, (int) iteration));
+ } catch(Exception e) {
+ throw new ErrorEvent("Cannot set item '" + item + "' to current item: " + e.getMessage());
+ }
+ try {
+ if (index.length() > 0) {
+ ctx.set(index, iteration);
+ }
+ } catch(Exception e) {
+ throw new ErrorEvent("Cannot set index '" + index + "' to current index: " + e.getMessage());
+ }
+ }
+
+ @Override
+ public void assign(String location, Data data) {
+ try {
+ ctx.set(location, getDataAsJexlObject(data));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void init(String location, Data data) {
+ ctx.set(location, null);
+ assign(location, data);
+ }
+
+ @Override
+ public boolean isDeclared(String expr) {
+ try {
+ JexlExpression ex = jexl.createExpression(expr);
+ Object result = ex.evaluate(ctx);
+ return (boolean) result;
+ } catch(JexlException e) {
+ }
+ return false;
+ }
+
+ protected Object evalAsObject(String expr) {
+ try {
+ JexlExpression ex = jexl.createExpression(expr);
+ return (ex.evaluate(ctx));
+ } catch(JexlException e) {
+ }
+ return null;
+ }
+
+ protected Data getJexlObjectAsData(Object obj) {
+ Data d = new Data();
+ if (obj.getClass().isArray()) {
+ int length = Array.getLength(obj);
+ for (int i = 0; i < length; i ++) {
+ d.getArray().add(getJexlObjectAsData(Array.get(obj, i)));
+ }
+ } else if (obj.getClass().isPrimitive() || isWrapperType(obj.getClass())) {
+ String val = obj.toString();
+ try {
+ Integer.parseInt(obj.toString());
+ d.setAtom(obj.toString());
+ d.setType(Data.Type.INTERPRETED);
+ return d;
+ } catch(NumberFormatException e) {}
+ try {
+ Double.parseDouble(obj.toString());
+ d.setAtom(obj.toString());
+ d.setType(Data.Type.INTERPRETED);
+ return d;
+ } catch(NumberFormatException e) {}
+ d.setAtom(obj.toString());
+ d.setType(Data.Type.VERBATIM);
+ return d;
+ } else {
+ Field[] fields = obj.getClass().getDeclaredFields();
+ for (Field field: fields) {
+ Object newObj = null;
+ try {
+ field.get(newObj);
+ d.getCompound().set(field.getName(), getJexlObjectAsData(newObj));
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+ return d;
+ }
+
+ return d;
+ }
+
+ protected Object getDataAsJexlObject(Data data) {
+ if (data.getAtom().length() > 0) {
+ if (data.getType() == Data.Type.INTERPRETED) {
+ try {
+ JexlExpression exp = jexl.createExpression(data.getAtom());
+ return exp.evaluate(ctx);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return new String(data.getAtom());
+ }
+ try {
+ JexlExpression exp = jexl.createExpression(data.getAtom());
+ return exp.evaluate(ctx);
+ } catch (Exception e) {
+ }
+ return new String("\"" + data.getAtom() + "\"");
+
+ } else if (data.getCompound().size() > 0) {
+ StringVector keys = data.getCompoundKeys();
+ DataMap dataCompound = data.getCompound();
+ Map<String, Object> objCompound = new HashMap<String, Object>();
+ for (int i = 0; i < keys.size(); i++) {
+ objCompound.put(keys.get(i), getDataAsJexlObject(dataCompound.get(keys.get(i))));
+ }
+ return objCompound;
+ } else if (data.getArray().size() > 0) {
+ DataList dataList = data.getArray();
+ List<Object> objList = new ArrayList<Object>((int) data.getArray().size());
+ for (int i = 0; i < dataList.size(); i++) {
+ objList.add(i, getDataAsJexlObject(dataList.get(i)));
+ }
+ return objList;
+ }
+ return new Object();
+ }
+
+ protected static boolean isWrapperType(Class<?> clazz) {
+ return WRAPPER_TYPES.contains(clazz);
+ }
+
+ private static final Set<Class<?>> WRAPPER_TYPES = getWrapperTypes();
+
+ private static Set<Class<?>> getWrapperTypes() {
+ Set<Class<?>> ret = new HashSet<Class<?>>();
+ ret.add(Boolean.class);
+ ret.add(Character.class);
+ ret.add(Byte.class);
+ ret.add(Short.class);
+ ret.add(Integer.class);
+ ret.add(Long.class);
+ ret.add(Float.class);
+ ret.add(Double.class);
+ ret.add(Void.class);
+ return ret;
+ }
+
+}
diff --git a/test/bindings/java/org/uscxml/tests/BasicExample.java b/test/bindings/java/org/uscxml/tests/BasicExample.java
new file mode 100644
index 0000000..32899e5
--- /dev/null
+++ b/test/bindings/java/org/uscxml/tests/BasicExample.java
@@ -0,0 +1,43 @@
+package org.uscxml.tests;
+
+import org.uscxml.Interpreter;
+import org.uscxml.InterpreterException;
+import org.uscxml.InterpreterState;
+
+public class BasicExample {
+
+ public static void main(String[] args) {
+
+ String uSCXMLLibPath = "/Users/sradomski/Documents/TK/Code/uscxml/build/cli/lib/libuscxmlNativeJava.jnilib";
+ if (System.getenv().containsKey("USCXML_JAVA_LIB")) {
+ uSCXMLLibPath = System.getenv("USCXML_JAVA_LIB");
+ }
+
+ System.load(uSCXMLLibPath);
+
+ try {
+ Interpreter scxml = Interpreter.fromURL("https://raw.githubusercontent.com/tklab-tud/uscxml/master/test/w3c/null/test436.scxml");
+ InterpreterState state = InterpreterState.USCXML_UNDEF;
+ while((state = scxml.step()) != InterpreterState.USCXML_FINISHED) {
+ switch (state) {
+ case USCXML_FINISHED:
+ case USCXML_UNDEF:
+ case USCXML_IDLE:
+ case USCXML_INITIALIZED:
+ case USCXML_INSTANTIATED:
+ case USCXML_MICROSTEPPED:
+ case USCXML_MACROSTEPPED:
+ case USCXML_CANCELLED:
+ break;
+ default:
+ break;
+ }
+ }
+ System.out.println("Machine finished");
+
+ } catch (InterpreterException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/test/bindings/java/org/uscxml/tests/DataModelExample.java b/test/bindings/java/org/uscxml/tests/DataModelExample.java
new file mode 100644
index 0000000..db46a18
--- /dev/null
+++ b/test/bindings/java/org/uscxml/tests/DataModelExample.java
@@ -0,0 +1,58 @@
+package org.uscxml.tests;
+
+import java.io.File;
+import java.net.MalformedURLException;
+
+import org.uscxml.Factory;
+import org.uscxml.Interpreter;
+import org.uscxml.InterpreterException;
+import org.uscxml.InterpreterState;
+import org.uscxml.dm.jexl.JEXLDataModel;
+import org.uscxml.tests.helper.TestMonitor;
+
+public class DataModelExample {
+
+ public static void main(String[] args) {
+ String uSCXMLLibPath = "/Users/sradomski/Documents/TK/Code/uscxml/build/cli/lib/libuscxmlNativeJava.jnilib";
+ if (System.getenv().containsKey("USCXML_JAVA_LIB")) {
+ uSCXMLLibPath = System.getenv("USCXML_JAVA_LIB");
+ }
+
+ System.load(uSCXMLLibPath);
+
+ JEXLDataModel jdm = new JEXLDataModel();
+ Factory.getInstance().registerDataModel(jdm);;
+
+ TestMonitor tm = new TestMonitor();
+
+ File folder = new File("/Users/sradomski/Documents/TK/Code/uscxml/test/w3c/jexl");
+ File[] listOfFiles = folder.listFiles();
+
+ try {
+ for (File file : listOfFiles) {
+ if (!file.getName().endsWith(".scxml"))
+ continue;
+ String testName = file.toURI().toURL().toString();
+ System.out.println(testName);
+
+ Interpreter scxml = Interpreter.fromURL(testName);
+// scxml.setMonitor(tm);
+
+ while(scxml.step() != InterpreterState.USCXML_FINISHED) {}
+
+ if (!scxml.isInState("pass")) {
+ System.out.println("FAIL: " + testName);
+
+ throw new RuntimeException();
+ }
+ System.out.println("SUCCESS");
+
+ }
+
+ } catch (InterpreterException | MalformedURLException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/test/bindings/java/org/uscxml/tests/MonitorExample.java b/test/bindings/java/org/uscxml/tests/MonitorExample.java
new file mode 100644
index 0000000..2f0689a
--- /dev/null
+++ b/test/bindings/java/org/uscxml/tests/MonitorExample.java
@@ -0,0 +1,46 @@
+package org.uscxml.tests;
+
+import org.uscxml.Interpreter;
+import org.uscxml.InterpreterException;
+import org.uscxml.InterpreterState;
+import org.uscxml.tests.helper.TestMonitor;
+
+
+public class MonitorExample {
+
+ public static void main(String[] args) {
+
+ String uSCXMLLibPath = "/Users/sradomski/Documents/TK/Code/uscxml/build/cli/lib/libuscxmlNativeJava.jnilib";
+ if (System.getenv().containsKey("USCXML_JAVA_LIB")) {
+ uSCXMLLibPath = System.getenv("USCXML_JAVA_LIB");
+ }
+
+ System.load(uSCXMLLibPath);
+
+ try {
+ TestMonitor tm = new TestMonitor();
+ Interpreter scxml = Interpreter.fromURL("https://raw.githubusercontent.com/tklab-tud/uscxml/master/test/w3c/null/test436.scxml");
+ scxml.setMonitor(tm);
+ InterpreterState state = InterpreterState.USCXML_UNDEF;
+ while((state = scxml.step()) != InterpreterState.USCXML_FINISHED) {
+ switch (state) {
+ case USCXML_FINISHED:
+ case USCXML_UNDEF:
+ case USCXML_IDLE:
+ case USCXML_INITIALIZED:
+ case USCXML_INSTANTIATED:
+ case USCXML_MICROSTEPPED:
+ case USCXML_MACROSTEPPED:
+ case USCXML_CANCELLED:
+ break;
+ default:
+ break;
+ }
+ }
+
+ } catch (InterpreterException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/test/bindings/java/org/uscxml/tests/helper/TestMonitor.java b/test/bindings/java/org/uscxml/tests/helper/TestMonitor.java
new file mode 100644
index 0000000..9266847
--- /dev/null
+++ b/test/bindings/java/org/uscxml/tests/helper/TestMonitor.java
@@ -0,0 +1,76 @@
+package org.uscxml.tests.helper;
+
+import org.uscxml.InterpreterIssue;
+import org.uscxml.InterpreterMonitor;
+import org.uscxml.StringList;
+
+public class TestMonitor extends InterpreterMonitor {
+
+ public TestMonitor() {}
+
+ @Override
+ public void beforeExitingState(String stateId, String xpath, String stateXML) {
+ System.out.println("beforeExitingState: " + stateId + " " + xpath + " " + stateXML);
+ }
+
+ @Override
+ public void afterExitingState(String stateId, String xpath, String stateXML) {
+ System.out.println("afterExitingState: " + stateId + " " + xpath + " " + stateXML);
+ }
+
+ @Override
+ public void beforeExecutingContent(String tagName, String xpath, String contentXML) {
+ System.out.println("afterExecutingContent: " + tagName + " " + xpath + " " + contentXML);
+ }
+
+ @Override
+ public void afterExecutingContent(String tagName, String xpath, String contentXML) {
+ System.out.println("afterExecutingContent: " + tagName + " " + xpath + " " + contentXML);
+ }
+
+ @Override
+ public void beforeUninvoking(String xpath, String invokeid, String invokerXML) {
+ System.out.println("beforeUninvoking: " + xpath + " " + invokeid + " " + invokerXML);
+ }
+
+ @Override
+ public void afterUninvoking(String xpath, String invokeid, String invokerXML) {
+ System.out.println("beforeUninvoking: " + xpath + " " + invokeid + " " + invokerXML);
+ }
+
+ @Override
+ public void beforeTakingTransition(String xpath, String source, StringList targets, String transitionXML) {
+ System.out.println("beforeTakingTransition: " + xpath + " " + source + " " + targets + " " + transitionXML);
+ }
+
+ @Override
+ public void afterTakingTransition(String xpath, String source, StringList targets, String transitionXML) {
+ System.out.println("afterTakingTransition: " + xpath + " " + source + " " + targets + " " + transitionXML);
+ }
+
+ @Override
+ public void beforeEnteringState(String stateId, String xpath, String stateXML) {
+ System.out.println("beforeEnteringState: " + stateId + " " + xpath + " " + stateXML);
+ }
+
+ @Override
+ public void afterEnteringState(String stateId, String xpath, String stateXML) {
+ System.out.println("afterEnteringState: " + stateId + " " + xpath + " " + stateXML);
+ }
+
+ @Override
+ public void beforeInvoking(String xpath, String invokeid, String invokerXML) {
+ System.out.println("beforeInvoking: " + xpath + " " + invokeid + " " + invokerXML);
+ }
+
+ @Override
+ public void afterInvoking(String xpath, String invokeid, String invokerXML) {
+ System.out.println("afterInvoking: " + xpath + " " + invokeid + " " + invokerXML);
+ }
+
+ @Override
+ public void reportIssue(InterpreterIssue issue) {
+ System.out.println(issue);
+ }
+
+}
diff --git a/test/src/test-bindings.cpp b/test/src/test-bindings.cpp
new file mode 100644
index 0000000..6932f67
--- /dev/null
+++ b/test/src/test-bindings.cpp
@@ -0,0 +1,11 @@
+/* make sure they compile! */
+#include "bindings/swig/wrapped/WrappedDataModel.h"
+#include "bindings/swig/wrapped/WrappedExecutableContent.h"
+#include "bindings/swig/wrapped/WrappedInterpreterMonitor.h"
+#include "bindings/swig/wrapped/WrappedInvoker.h"
+#include "bindings/swig/wrapped/WrappedIOProcessor.h"
+
+
+int main() {
+ return 0;
+} \ No newline at end of file
diff --git a/test/src/test-snippets.cpp b/test/src/test-snippets.cpp
new file mode 100644
index 0000000..a9625b1
--- /dev/null
+++ b/test/src/test-snippets.cpp
@@ -0,0 +1,35 @@
+/**
+ * This file contains all the snippets in the doxygen documentation.
+ *
+ * It is not actually a test as such, but makes sure that the snippets will
+ * actually compile and do what we claim they do.
+ */
+
+#include "uscxml/config.h"
+#include "uscxml/Interpreter.h"
+
+using namespace uscxml;
+
+void microstep_snippet() {
+
+ Interpreter scxml = Interpreter::fromURL("https://raw.githubusercontent.com/tklab-tud/uscxml/master/test/w3c/null/test436.scxml");
+
+//! [Performing a microstep]
+ InterpreterState state = uscxml::USCXML_UNDEF;
+ while((state = scxml.step()) != uscxml::USCXML_FINISHED) {
+ switch (state) {
+ case USCXML_MICROSTEPPED:
+ case USCXML_MACROSTEPPED:
+ /* Interpreter performed a microstep */
+ break;
+ default:
+ break;
+ }
+ }
+//! [Performing a microstep]
+
+}
+
+int main(int argc, char** argv) {
+ microstep_snippet();
+} \ No newline at end of file
diff --git a/test/src/test-validating.cpp b/test/src/test-validating.cpp
index 3f7d0f9..840a105 100644
--- a/test/src/test-validating.cpp
+++ b/test/src/test-validating.cpp
@@ -46,7 +46,7 @@ int main(int argc, char** argv) {
if (Factory::getInstance()->hasDataModel("ecmascript")) {
// Potential endless loop
-
+
const char* xml =
"<scxml datamodel=\"ecmascript\">"
" <datamodel><data id=\"counter\" expr=\"5\" /></datamodel>"
@@ -677,7 +677,7 @@ int main(int argc, char** argv) {
assert(issueLocations.size() == 1);
}
- if (Factory::getInstance()->hasDataModel("ecmascript")) {
+ if (Factory::getInstance()->hasDataModel("ecmascript")) {
// Syntax error in script
const char* xml =
@@ -692,7 +692,7 @@ int main(int argc, char** argv) {
assert(issueLocations.size() == 1);
}
- if (Factory::getInstance()->hasDataModel("ecmascript")) {
+ if (Factory::getInstance()->hasDataModel("ecmascript")) {
// Syntax error in cond attribute
const char* xml =
@@ -714,7 +714,7 @@ int main(int argc, char** argv) {
assert(issueLocations.size() == 3);
}
- if (Factory::getInstance()->hasDataModel("ecmascript")) {
+ if (Factory::getInstance()->hasDataModel("ecmascript")) {
// Syntax error in expr attribute
const char* xml =
@@ -745,7 +745,7 @@ int main(int argc, char** argv) {
assert(issueLocations.size() == 5);
}
- if (Factory::getInstance()->hasDataModel("ecmascript")) {
+ if (Factory::getInstance()->hasDataModel("ecmascript")) {
// Syntax error with foreach
const char* xml =
@@ -763,7 +763,7 @@ int main(int argc, char** argv) {
assert(issueLocations.size() == 1);
}
- if (Factory::getInstance()->hasDataModel("ecmascript")) {
+ if (Factory::getInstance()->hasDataModel("ecmascript")) {
// Syntax error with send
const char* xml =
@@ -780,7 +780,7 @@ int main(int argc, char** argv) {
assert(issueLocations.size() == 1);
}
- if (Factory::getInstance()->hasDataModel("ecmascript")) {
+ if (Factory::getInstance()->hasDataModel("ecmascript")) {
// Syntax error with invoke
const char* xml =
@@ -795,7 +795,7 @@ int main(int argc, char** argv) {
assert(issueLocations.size() == 1);
}
- if (Factory::getInstance()->hasDataModel("ecmascript")) {
+ if (Factory::getInstance()->hasDataModel("ecmascript")) {
// Syntax error with cancel
const char* xml =
diff --git a/test/w3c/confJEXL.xsl b/test/w3c/confJEXL.xsl
new file mode 100644
index 0000000..df4fcc7
--- /dev/null
+++ b/test/w3c/confJEXL.xsl
@@ -0,0 +1,748 @@
+<?xml version="1.0"?>
+<!-- Copyright 1998-2003 W3C (MIT, ERCIM, Keio), All Rights Reserved. See http://www.w3.org/Consortium/Legal/. -->
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:conf="http://www.w3.org/2005/scxml-conformance"
+ version="2.0">
+
+
+
+
+<!-- Copy everything that doesn't match other rules -->
+<xsl:template match="/ | @* | node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@* | node()"/>
+ </xsl:copy>
+</xsl:template>
+
+<!-- Success criteria -->
+
+<xsl:template match="//@conf:targetpass">
+ <xsl:attribute name="target">pass</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="conf:pass">
+ <final xmlns="http://www.w3.org/2005/07/scxml" id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+</xsl:template>
+
+<!-- Failure criteria -->
+
+<xsl:template match="//@conf:targetfail">
+ <xsl:attribute name="target">fail</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="conf:fail">
+ <final xmlns="http://www.w3.org/2005/07/scxml" id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+</final>
+</xsl:template>
+
+<!-- datamodel -->
+<xsl:template match="//@conf:datamodel">
+ <xsl:attribute name="datamodel">jexl</xsl:attribute>
+</xsl:template>
+
+
+<!-- creates id for <data> element, etc. -->
+<xsl:template match="//@conf:id">
+ <xsl:attribute name="id">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+
+<!-- creates name for <param>, etc. -->
+<xsl:template match="//@conf:name">
+ <xsl:attribute name="name">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+
+<!-- creates location for <assign>, etc. -->
+<xsl:template match="//@conf:location">
+ <xsl:attribute name="location">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- names an invalid location for <assign>, etc. -->
+<xsl:template match="//@conf:invalidLocation">
+ <xsl:attribute name="location">foo.bar.baz </xsl:attribute>
+</xsl:template>
+
+<!-- uses system var as location for <assign>, etc. -->
+<xsl:template match="//@conf:systemVarLocation">
+ <xsl:attribute name="location"><xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+
+
+
+<!-- expr is evaluated -->
+<xsl:template match="//@conf:expr">
+ <xsl:attribute name="expr"><xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- targetexpr is the corresponding ID -->
+<xsl:template match="//@conf:targetVar">
+ <xsl:attribute name="targetexpr">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- expr is quoted -->
+<xsl:template match="//@conf:quoteExpr">
+ <xsl:attribute name="expr">'<xsl:value-of select="." />'</xsl:attribute>
+</xsl:template>
+
+<!-- an expr that is the value of a variable -->
+<xsl:template match="//@conf:varExpr">
+ <xsl:attribute name="expr">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- in EcmaScript, this is the same as varExpr -->
+<xsl:template match="//@conf:varChildExpr">
+ <xsl:attribute name="expr">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- an expr that is the value of a system variable -->
+<xsl:template match="//@conf:systemVarExpr">
+ <xsl:attribute name="expr"><xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+
+<!-- an expr that is the value of a non-existent substructure of a variable -->
+<xsl:template match="//@conf:varNonexistentStruct">
+ <xsl:attribute name="expr">Var<xsl:value-of select="." />.bar</xsl:attribute>
+</xsl:template>
+
+
+<!-- this should return a value that cannot be assigned to a var. -->
+<xsl:template match="//@conf:illegalExpr">
+ <xsl:attribute name="expr">return</xsl:attribute>
+</xsl:template>
+
+<!-- this should add 1 to the value of the specified variable -->
+<xsl:template match="conf:incrementID">
+ <assign xmlns="http://www.w3.org/2005/07/scxml">
+ <xsl:attribute name="location">Var<xsl:value-of select="@id"/></xsl:attribute>
+ <xsl:attribute name="expr">Var<xsl:value-of select="@id"/> + 1</xsl:attribute>
+ </assign>
+ </xsl:template>
+
+<!-- this should concatenate the value of the id2 to id1 and assign the result to id1 -->
+<xsl:template match="conf:concatVars">
+ <assign xmlns="http://www.w3.org/2005/07/scxml">
+ <xsl:attribute name="location">Var<xsl:value-of select="@id1"/></xsl:attribute>
+ <xsl:attribute name="expr">Var<xsl:value-of select="@id1"/> + Var<xsl:value-of select="@id2"/></xsl:attribute>
+ </assign>
+ </xsl:template>
+
+<!-- assigns the sum of the values of two vars to thefirst var-->
+<xsl:template match="//conf:sumVars">
+ <assign xmlns="http://www.w3.org/2005/07/scxml">
+<xsl:attribute name="location">Var<xsl:value-of select="@id1"/></xsl:attribute>
+<xsl:attribute name="expr">Var<xsl:value-of select="@id1"/> + Var<xsl:value-of select="@id2"/></xsl:attribute>
+ </assign>
+ </xsl:template>
+
+<!-- this should return an illegal target for <send> causing a send error to be raised -->
+<xsl:template match="//@conf:illegalTarget">
+ <xsl:attribute name="target">baz</xsl:attribute>
+</xsl:template>
+
+<!-- this returns an legal, but unreachable, target for <send> causing a send error to be raised -->
+<xsl:template match="//@conf:unreachableTarget">
+ <xsl:attribute name="target">#_scxml_foo</xsl:attribute>
+</xsl:template>
+
+<!-- this produces illegal content for <send> causing the message to be rejected -->
+<xsl:template match="//conf:illegalContent">
+ <content xmlns="http://www.w3.org/2005/07/scxml"> xyz </content>
+</xsl:template>
+
+<!-- a content element whose value is the string 'foo' -->
+<xsl:template match="//conf:contentFoo">
+ <content xmlns="http://www.w3.org/2005/07/scxml">foo</content>
+</xsl:template>
+
+<xsl:template match="//conf:someInlineVal">123</xsl:template>
+
+<!-- this returns something that is guaranteed not to be the ID of the current session -->
+<xsl:template match="//@conf:invalidSessionID">
+ <xsl:attribute name="expr">27</xsl:attribute>
+</xsl:template>
+
+<!-- this returns something that is guaranteed not to be a valid event I/O processor -->
+<xsl:template match="//@conf:invalidSendType">
+ <xsl:attribute name="type">27</xsl:attribute>
+</xsl:template>
+
+<!-- same value in an expr -->
+<xsl:template match="//@conf:invalidSendTypeExpr">
+ <xsl:attribute name="expr">27</xsl:attribute>
+</xsl:template>
+
+<!-- exprs that return the value of the event fields -->
+
+<xsl:template match="//@conf:eventName">
+ <xsl:attribute name="expr">_event.name</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:eventType">
+ <xsl:attribute name="expr">_event.type</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:eventSendid">
+ <xsl:attribute name="expr">_event.sendid</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:eventField">
+ <xsl:attribute name="expr">_event.<xsl:value-of select="."/></xsl:attribute>
+</xsl:template>
+
+<!-- returns the raw message structure as a string -->
+<xsl:template match="//@conf:eventRaw">
+ <xsl:attribute name="expr">_event.raw</xsl:attribute>
+</xsl:template>
+
+
+<!-- returns the value of the specified item in _event.data -->
+<xsl:template match="//@conf:eventDataFieldValue">
+ <xsl:attribute name="expr">_event.data.<xsl:value-of select="."/></xsl:attribute>
+</xsl:template>
+
+<!-- returns the value of a KVP specified by <param> from _event.data -->
+<xsl:template match="//@conf:eventDataParamValue">
+ <xsl:attribute name="expr">_event.data.<xsl:value-of select="."/></xsl:attribute>
+</xsl:template>
+<!-- returns the value of a KVP specified by <param> from _event.data -->
+<xsl:template match="//@conf:eventDataNamelistValue">
+ <xsl:attribute name="expr">_event.data.Var<xsl:value-of select="."/></xsl:attribute>
+</xsl:template>
+
+<!-- returns the location of the scxml event i/o processor -->
+<xsl:template match="//@conf:scxmlEventIOLocation">
+ <xsl:attribute name="expr">_ioprocessors['http://www.w3.org/TR/scxml/#SCXMLEventProcessor'].location</xsl:attribute>
+</xsl:template>
+
+<!-- templates for the expr versions of the send attributes -->
+
+<!-- eventexpr takes the value of the specified variable -->
+<xsl:template match="//@conf:eventExpr">
+ <xsl:attribute name="eventexpr">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- targetexpr takes the value of the specified variable -->
+<xsl:template match="//@conf:targetExpr">
+ <xsl:attribute name="targetexpr">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- typeexpr takes the value of the specified variable -->
+<xsl:template match="//@conf:typeExpr">
+ <xsl:attribute name="typeexpr">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- delayexpr takes the value of the specified variable -->
+<xsl:template match="//@conf:delayFromVar">
+ <xsl:attribute name="delayexpr">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- computes a delayexpr based on the value passed in. this lets platforms determine how long to delay timeout
+events which cause the test to fail. The default value provided here is pretty long -->
+<xsl:template match="//@conf:delay">
+ <xsl:attribute name="delayexpr">'<xsl:value-of select="."/>s'</xsl:attribute>
+</xsl:template>
+
+<!-- the specified variable is used as idlocation -->
+<xsl:template match="//@conf:idlocation">
+ <xsl:attribute name="idlocation">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- the specified variable is used as sendidexpr -->
+<xsl:template match="//@conf:sendIDExpr">
+ <xsl:attribute name="sendidexpr">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- the specified variable is used as srcexpr -->
+<xsl:template match="//@conf:srcExpr">
+ <xsl:attribute name="srcexpr">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- the specified variable is used as namelist -->
+<xsl:template match="//@conf:namelist">
+ <xsl:attribute name="namelist">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- this produces a reference to an invalid namelist, i.e. on that should cause an error -->
+<xsl:template match="//@conf:invalidNamelist">
+ <xsl:attribute name="namelist">&#34;foo</xsl:attribute>
+</xsl:template>
+
+
+
+
+<!-- transition conditions -->
+<!-- the value is evaluated -->
+<xsl:template match="//@conf:idVal">
+ <xsl:attribute name="cond">
+ <xsl:analyze-string select="."
+ regex="([0-9]+)([=&lt;&gt;]=?)(.*)">
+ <xsl:matching-substring>Var<xsl:value-of select="regex-group(1)"/>
+ <xsl:variable name="op"><xsl:value-of select="regex-group(2)"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$op='='">==</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$op"/></xsl:otherwise>
+ </xsl:choose>
+ <xsl:value-of select="regex-group(3)"/>
+ </xsl:matching-substring>
+
+ </xsl:analyze-string>
+ </xsl:attribute>
+</xsl:template>
+<!-- compare two variables -->
+<xsl:template match="//@conf:varIdVal">
+ <xsl:attribute name="cond">
+ <xsl:analyze-string select="."
+ regex="([0-9]+)([=&lt;&gt;]=?)(.*)">
+ <xsl:matching-substring>Var<xsl:value-of select="regex-group(1)"/>
+ <xsl:variable name="op"><xsl:value-of select="regex-group(2)"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$op='='">==</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$op"/></xsl:otherwise>
+ </xsl:choose>Var<xsl:value-of select="regex-group(3)"/>
+ </xsl:matching-substring>
+
+ </xsl:analyze-string>
+ </xsl:attribute>
+</xsl:template>
+
+
+<!-- test that given var whose value was passed in via namelist has specific value. The value expr is evaluated -->
+<xsl:template match="//@conf:namelistIdVal">
+ <xsl:attribute name="cond">
+ <xsl:analyze-string select="."
+ regex="([0-9]+)([=&lt;&gt;]=?)(.*)">
+ <xsl:matching-substring>Var<xsl:value-of select="regex-group(1)"/>
+ <xsl:variable name="op"><xsl:value-of select="regex-group(2)"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$op='='">===</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$op"/></xsl:otherwise>
+ </xsl:choose>
+ <xsl:value-of select="regex-group(3)"/>
+ </xsl:matching-substring>
+
+ </xsl:analyze-string>
+ </xsl:attribute>
+</xsl:template>
+
+<!-- true if the two vars/ids have the same value -->
+<xsl:template match="//@conf:VarEqVar">
+ <xsl:attribute name="cond">
+ <xsl:analyze-string select="."
+ regex="([0-9]+)(\W+)([0-9]+)">
+ <xsl:matching-substring>Var<xsl:value-of select="regex-group(1)"/>===Var<xsl:value-of select="regex-group(3)"/>
+ </xsl:matching-substring>
+ </xsl:analyze-string>
+ </xsl:attribute>
+</xsl:template>
+
+<!-- true if the two vars/ids have the same value, which is a structure, not atomic -->
+<xsl:template match="//@conf:VarEqVarStruct">
+ <xsl:attribute name="cond">
+ <xsl:analyze-string select="."
+ regex="([0-9]+)(\W+)([0-9]+)">
+ <xsl:matching-substring>Var<xsl:value-of select="regex-group(1)"/>==Var<xsl:value-of select="regex-group(3)"/>
+ </xsl:matching-substring>
+ </xsl:analyze-string>
+ </xsl:attribute>
+</xsl:template>
+
+<!-- the value is quoted -->
+<xsl:template match="//@conf:idQuoteVal">
+ <xsl:attribute name="cond">
+ <xsl:analyze-string select="."
+ regex="([0-9]+)([=&lt;&gt;]=?)(.*)">
+<xsl:matching-substring>Var<xsl:value-of select="regex-group(1)"/><xsl:variable name="op"><xsl:value-of select="regex-group(2)"/></xsl:variable>
+<xsl:choose>
+<xsl:when test="$op='='">==</xsl:when>
+<xsl:otherwise><xsl:value-of select="$op"/></xsl:otherwise></xsl:choose>'<xsl:value-of select="regex-group(3)"/>'</xsl:matching-substring>
+</xsl:analyze-string>
+</xsl:attribute>
+</xsl:template>
+
+<!-- test on the value of two vars -->
+<xsl:template match="//@conf:compareIDVal">
+ <xsl:attribute name="cond">
+ <xsl:analyze-string select="."
+ regex="([0-9]+)([=&lt;&gt;]=?)([0-9+])">
+ <xsl:matching-substring>Var<xsl:value-of select="regex-group(1)"/>
+ <xsl:variable name="op"><xsl:value-of select="regex-group(2)"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$op='='">=</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$op"/></xsl:otherwise>
+ </xsl:choose>Var<xsl:value-of select="regex-group(3)"/>
+ </xsl:matching-substring>
+ </xsl:analyze-string>
+ </xsl:attribute>
+</xsl:template>
+
+<!-- test that the specified var has the value specified by <conf:someInlineVal> -->
+<xsl:template match="//@conf:idSomeVal">
+ <xsl:attribute name="cond">Var<xsl:value-of select="." /> == 123</xsl:attribute>
+</xsl:template>
+
+<!-- test that the event's name fieldhas the value specified -->
+<xsl:template match="//@conf:eventNameVal">
+ <xsl:attribute name="cond">_event.name == <xsl:text>'</xsl:text><xsl:value-of select="."/><xsl:text>'</xsl:text>
+ </xsl:attribute>
+
+</xsl:template>
+
+<xsl:template match="//@conf:eventvarVal">
+ <xsl:attribute name="cond">
+ <xsl:analyze-string select="."
+ regex="([0-9]+)([=&lt;&gt;]=?)(.*)">
+ <xsl:matching-substring>_event.data['Var<xsl:value-of select="regex-group(1)"/><xsl:text>']</xsl:text>
+ <xsl:variable name="op"><xsl:value-of select="regex-group(2)"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$op='='">==</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$op"/></xsl:otherwise>
+ </xsl:choose>
+ <xsl:value-of select="regex-group(3)"/>
+ </xsl:matching-substring>
+
+ </xsl:analyze-string>
+ </xsl:attribute>
+
+</xsl:template>
+
+
+
+<!-- return true if variable matches value of system var (var number is first arg, system var name
+is the second argument -->
+<xsl:template match="//@conf:idSystemVarVal">
+ <xsl:attribute name="cond">
+ <xsl:analyze-string select="."
+ regex="([0-9]+)([=&lt;&gt;]=?)(.*)">
+<xsl:matching-substring>Var<xsl:value-of select="regex-group(1)"/><xsl:variable name="op"><xsl:value-of select="regex-group(2)"/></xsl:variable>
+<xsl:choose>
+<xsl:when test="$op='='">==</xsl:when>
+<xsl:otherwise><xsl:value-of select="$op"/></xsl:otherwise></xsl:choose><xsl:value-of select="regex-group(3)"/></xsl:matching-substring>
+</xsl:analyze-string>
+</xsl:attribute>
+</xsl:template>
+
+<!-- return true if event.data field matches the specified value -->
+
+<xsl:template match="//@conf:eventdataVal">
+ <xsl:attribute name="cond">_event.data == <xsl:value-of select="."/></xsl:attribute>
+</xsl:template>
+
+<!-- test that _event.data is set to the value specified by <conf:someInlineVal> -->
+<xsl:template match="//@conf:eventdataSomeVal">
+ <xsl:attribute name="cond">_event.data == 123</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:emptyEventData">
+ <xsl:attribute name="cond">typeof _event.data === 'undefined'</xsl:attribute>
+</xsl:template>
+
+<!-- return true if the _name system var has the specified quoted value -->
+<xsl:template match="//@conf:nameVarVal">
+ <xsl:attribute name="cond">_name === '<xsl:value-of select="."/>'</xsl:attribute>
+</xsl:template>
+
+<!-- return true if first var's value is a prefix of the second var's value. Input has form "n m" where n and m are ints.-->
+<xsl:template match="//@conf:varPrefix">
+ <xsl:attribute name="cond">
+ <xsl:analyze-string select="."
+ regex="(\w+)(\W)(\w+)">
+ <xsl:matching-substring>
+ <!-- the underscore.string.startswith function compressed into one line below:
+ <xsl:text>(function(str, starts){
+ if (starts === '') return true;
+ if (str == null || starts == null) return false;
+ str = String(str); starts = String(starts);
+ return str.length >= starts.length &amp;&amp; str.slice(0, starts.length) === starts;
+ })(</xsl:text>Var<xsl:value-of select="regex-group(3)"/>, Var<xsl:value-of select="regex-group(1)"/><xsl:text>)</xsl:text> -->
+<xsl:text>(function(str, starts){if (starts === '') return true;if (str == null || starts == null) return false;str = String(str); starts = String(starts);return str.length >= starts.length &amp;&amp; str.slice(0, starts.length) === starts;})(</xsl:text>Var<xsl:value-of select="regex-group(3)"/>, Var<xsl:value-of select="regex-group(1)"/><xsl:text>)</xsl:text>
+ </xsl:matching-substring>
+ </xsl:analyze-string>
+ </xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:inState">
+ <xsl:attribute name="cond">In('<xsl:value-of select="."/>')</xsl:attribute>
+</xsl:template>
+
+<!-- returns a value that cannot be converted into a Boolean -->
+<xsl:template match="//@conf:nonBoolean">
+ <xsl:attribute name="cond">return</xsl:attribute>
+</xsl:template>
+
+<!-- true if id has a value -->
+<xsl:template match="//@conf:isBound">
+ <xsl:attribute name="cond">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- return true if specified var has been created but is not bound -->
+<xsl:template match="//@conf:unboundVar">
+ <xsl:attribute name="cond">typeof Var<xsl:value-of select="." /> === 'undefined' </xsl:attribute>
+</xsl:template>
+
+<!-- true if system var has a value -->
+<xsl:template match="//@conf:systemVarIsBound">
+ <xsl:attribute name="cond"><xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- true if id does not have a value -->
+<xsl:template match="//@conf:noValue">
+ <xsl:attribute name="cond">!Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- always returns true -->
+<xsl:template match="//@conf:true">
+ <xsl:attribute name="cond">true</xsl:attribute>
+</xsl:template>
+
+<!-- always returns false -->
+<xsl:template match="//@conf:false">
+ <xsl:attribute name="cond">false</xsl:attribute>
+</xsl:template>
+
+<!-- returns true if all the required fields of _event are bound -->
+ <xsl:template match="//@conf:eventFieldsAreBound">
+ <xsl:attribute name="cond">'name' in _event &amp;&amp; 'type' in _event &amp;&amp; 'sendid' in _event &amp;&amp; 'origin' in _event &amp;&amp; 'origintype' in _event &amp;&amp; 'invokeid' in _event &amp;&amp; 'data' in _event</xsl:attribute>
+ </xsl:template>
+
+<!-- returns true if _event.data contains the specified item -->
+<xsl:template match="//@conf:eventDataHasField">
+ <xsl:attribute name="cond"><xsl:value-of select="."/> in _event.data</xsl:attribute>
+</xsl:template>
+
+<!-- returns true if specified field of _event has no value -->
+<xsl:template match="//@conf:eventFieldHasNoValue">
+ <xsl:attribute name="cond">typeof _event.<xsl:value-of select="." /> === 'undefined' </xsl:attribute>
+</xsl:template>
+
+<!-- true if the language of _event matches the processor's datamodel -->
+<xsl:template match="//@conf:eventLanguageMatchesDatamodel">
+ <xsl:attribute name="cond"> _event.language == 'jexl'</xsl:attribute>
+</xsl:template>
+
+<!-- true if _event was delivered on the specified i/o processor -->
+<xsl:template match="//@conf:originTypeEq">
+ <xsl:attribute name="cond"> _event.origintype == '<xsl:value-of select="."/>'</xsl:attribute>
+</xsl:template>
+
+
+
+
+<!-- scripting -->
+
+<xsl:template match="conf:script">
+ <script xmlns="http://www.w3.org/2005/07/scxml">var Var1 = 1</script>
+</xsl:template>
+
+
+<xsl:template match="//@conf:scriptGoodSrc">
+ <xsl:attribute name="src">D:\W3C\SCXMLTests\test300.js</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:scriptBadSrc">
+ <xsl:attribute name="src">D:\foo</xsl:attribute>
+</xsl:template>
+
+<!-- sends an event back to the sender of the current event -->
+<xsl:template match="conf:sendToSender">
+ <send xmlns="http://www.w3.org/2005/07/scxml">
+ <xsl:attribute name="event"><xsl:value-of select="@name" /></xsl:attribute>
+ <xsl:attribute name="targetexpr">_event.origin</xsl:attribute>
+ <xsl:attribute name="typeexpr">_event.origintype</xsl:attribute>
+ </send>
+</xsl:template>
+
+<!-- foreach -->
+<!-- this should produce an array containing 1 2 3 in that order -->
+<xsl:template match="//conf:array123">[1,2,3]</xsl:template>
+
+<!-- this uses the value of the indicated variable as the 'array' attribute -->
+<xsl:template match="//@conf:arrayVar">
+ <xsl:attribute name="array">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- in Python, this is the same as arrayVar -->
+<xsl:template match="//@conf:arrayTextVar">
+ <xsl:attribute name="array">Var<xsl:value-of select="."/></xsl:attribute>
+</xsl:template>
+
+
+<!-- this should produce expr that yields an array containing 1 2 3 in that order -->
+<xsl:template match="//@conf:arrayExpr123">
+ <xsl:attribute name="expr">1, 2, 3]</xsl:attribute>
+</xsl:template>
+
+<!-- this should yield an expr that evaluates to something that is not a valid array -->
+<xsl:template match="//@conf:illegalArray">
+ <xsl:attribute name="expr">7</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:item">
+ <xsl:attribute name="item">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- this should return something that cannot be an variable name -->
+<xsl:template match="//@conf:illegalItem">
+ <xsl:attribute name="item">'continue'</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:index">
+ <xsl:attribute name="index">Var<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- this should add an extra item onto the end of the specified array, which
+is of the same type as array123 -->
+<xsl:template match="conf:extendArray">
+ <assign xmlns="http://www.w3.org/2005/07/scxml">
+ <xsl:attribute name="location">Var<xsl:value-of select="@id"/></xsl:attribute>
+ <xsl:attribute name="expr">[].concat(Var<xsl:value-of select="@id"/>, [4])</xsl:attribute>
+ </assign>
+ </xsl:template>
+
+<!-- this should create a multidimensional array all of whose cells are set to the specified value. Not
+currently used for any tests -->
+<xsl:template match="//@conf:multiDimensionalArrayExpr">
+ <xsl:attribute name="expr">[[<xsl:value-of select="."/>,<xsl:value-of select="."/>],[<xsl:value-of select="."/>,<xsl:value-of select="."/>]]</xsl:attribute>
+</xsl:template>
+
+
+<!-- this should create a <foreach> statement that increments the values of the specified array. Not
+currently used for any tests -->
+<xsl:template match="conf:incrementArray">
+ <xsl:variable name="targetArray">Var<xsl:value-of select="@id"/></xsl:variable>
+<foreach xmlns="http://www.w3.org/2005/07/scxml">
+ <xsl:attribute name="item">item</xsl:attribute>
+ <xsl:attribute name="index">index</xsl:attribute>
+ <xsl:attribute name="array"><xsl:value-of select="$targetArray"/></xsl:attribute>
+<script>
+<xsl:value-of select="$targetArray"/>[index][0] = <xsl:value-of select="$targetArray"/>[index][0] + 1
+<xsl:value-of select="$targetArray"/>[index][1] = <xsl:value-of select="$targetArray"/>[index][1] + 1
+</script>
+</foreach>
+</xsl:template>
+<!-- this should return true iff each cell in the specified multidimensional array has the specified value. Not
+currently used for any tests -->
+<xsl:template match="//@conf:arrayVal">
+ <xsl:attribute name="cond">
+ <xsl:analyze-string select="."
+ regex="([0-9]+)(\W+)(.*)">
+ <xsl:matching-substring>
+ <xsl:variable name="targetArray">Var<xsl:value-of select="regex-group(1)"/></xsl:variable>
+ <xsl:variable name="value"><xsl:value-of select="regex-group(3)"/></xsl:variable>
+<xsl:value-of select="$targetArray"/>[0][0]== <xsl:value-of select="$value"/> &amp;&amp; <xsl:value-of select="$targetArray"/>[0][1] == <xsl:value-of select="$value"/> &amp;&amp; <xsl:value-of select="$targetArray"/>[1][0] == <xsl:value-of select="$value"/> &amp;&amp; <xsl:value-of select="$targetArray"/>[1][1] == <xsl:value-of select="$value"/>
+</xsl:matching-substring>
+
+ </xsl:analyze-string>
+ </xsl:attribute>
+</xsl:template>
+
+<!-- SITE SPECIFIC INFORMATION FOR BASIC HTTP EVENT I/O PROCESSOR
+This template must be edited by each site that expects to test the Basic HTTP Event I/O
+processor. Other templates for the Basic HTTP Event I/O tests are below it -->
+
+<xsl:template match="//@conf:testOnServer">
+ <xsl:attribute name="target">SITE_SPECIFIC_ADDRESS<xsl:value-of select="." /></xsl:attribute>
+</xsl:template>
+
+<!-- use this template to import or set up anything you need for the code in
+the basic http tests. In the case of python, we have to import the regexp module.-->
+<xsl:template match="conf:setUpHTTPTest">
+<!-- <script xmlns="http://www.w3.org/2005/07/scxml">import re</script> -->
+</xsl:template>
+
+<!-- return an expression evaluating to the basic http access URI -->
+<xsl:template match="//@conf:basicHTTPAccessURI">
+ <xsl:attribute name="expr">_ioprocessors['basichttp']['location']</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:basicHTTPAccessURITarget">
+ <xsl:attribute name="targetexpr">_ioprocessors['basichttp']['location']</xsl:attribute>
+</xsl:template>
+
+<!-- generate an cond that evaluates to true if POST was used to send the message -->
+<xsl:template match="//@conf:methodIsPost">
+ <xsl:attribute name="cond">_event.raw.search('POST') !== -1</xsl:attribute>
+</xsl:template>
+
+<!-- generate a namelist attribute containing all the ids listed in the attribute's value -->
+<xsl:template match="//@conf:multipleNamelist">
+ <xsl:attribute name="namelist">
+ <xsl:analyze-string select="." regex="([0-9]+)">
+<xsl:matching-substring>Var<xsl:value-of select="regex-group(1)"/><xsl:text>&#xa;</xsl:text></xsl:matching-substring>
+</xsl:analyze-string>
+</xsl:attribute>
+</xsl:template>
+
+<!-- generate a cond that evaluates to true if the event is external -->
+<xsl:template match="//@conf:eventIsExternal">
+ <xsl:attribute name="cond">_event.type === 'external'</xsl:attribute>
+</xsl:template>
+
+<!-- returns true if _event/raw contains the var with the specified value -->
+<xsl:template match="//@conf:eventIdParamHasValue">
+ <xsl:attribute name="cond"><xsl:analyze-string select="." regex="(\S+)(\s+)(\S+)">
+<xsl:matching-substring>_event.raw.search(/Var<xsl:value-of select="regex-group(1)"/>=<xsl:value-of select="regex-group(3)"/>/) !== -1</xsl:matching-substring></xsl:analyze-string></xsl:attribute>
+</xsl:template>
+
+<!-- returns true if _event/raw contains the param with the specified value -->
+<xsl:template match="//@conf:eventNamedParamHasValue">
+ <xsl:attribute name="cond"><xsl:analyze-string select="." regex="(\S+)(\s+)(\S+)">
+ <xsl:matching-substring>_event.raw.search('<xsl:value-of select="regex-group(1)"/>=<xsl:value-of select="regex-group(3)"/>') !== -1</xsl:matching-substring></xsl:analyze-string></xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:messageBodyEquals">
+ <xsl:attribute name="cond">_event.raw.search(/<xsl:value-of select="."/>/) !== -1</xsl:attribute>
+</xsl:template>
+
+
+<!-- the following templates produce an expr that extracts the relevant item from _event.raw -->
+<xsl:template match="//@conf:getNamedParamVal">
+ <xsl:attribute name="expr">_event.raw.match(/<xsl:value-of select="."/>=(\S+)$/)[1]</xsl:attribute>
+</xsl:template>
+
+<!-- if input is 1, find param Var1, etc. -->
+<xsl:template match="//@conf:getIDParamVal">
+ <xsl:attribute name="expr">_event.raw.match(/Var<xsl:value-of select="."/>=(\S+)$/)[1]</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:getNthParamName">
+ <xsl:attribute name="expr">txt.match(/\n\n(.*)/)[2].split('&amp;')[<xsl:value-of select="."/>].split('=')[0]</xsl:attribute>
+</xsl:template>
+
+<xsl:template match="//@conf:getNthParamVal">
+ <xsl:attribute name="expr">txt.match(/\n\n(.*)/)[2].split('&amp;')[<xsl:value-of select="."/>].split('=')[1]</xsl:attribute>
+</xsl:template>
+
+<!-- this should produce an 'expr' that evaluates to a valid SCXML Message structure -->
+<xsl:template match="//@conf:scxmlEventExpr">
+ <xsl:attribute name="expr">'&lt;message source="' + _ioprocessors['basichttp'] + '"'
++ 'xmlns:scxml="http://www.w3.org/2005/07/scxml" version="1.0" xmlns:xsi=:http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://www.w3.org/2005/07/scxml scxml-message.xsd" sourcetype=:scxml"'
++' 'name="name"' + '"' + <xsl:value-of select="."/> + '"' + /&gt;'</xsl:attribute>
+ </xsl:template>
+
+<!-- this should produce a <content> tag containing material to use as the message body. This
+content must include the address, so the far side can send a response back to us -->
+<xsl:template match="conf:msgContent">
+<content xmlns="http://www.w3.org/2005/07/scxml">
+ <xsl:attribute name="expr">'address=' + _ioprocessors['basichttp'] + "'"</xsl:attribute>
+ </content>
+</xsl:template>
+
+<!-- this should produce a test on _event.raw that checks whether the body matches the
+expression defined in the previous template. This may need to be tightened up because
+it allows anything after the = -->
+<xsl:template match="//@conf:msgIsBody">
+ <xsl:attribute name="cond">_event.raw.match(/\n\naddress=(.*)$/)</xsl:attribute>
+</xsl:template>
+</xsl:stylesheet> \ No newline at end of file
diff --git a/test/w3c/convert-tests.sh b/test/w3c/convert-tests.sh
index f30f8cf..b8deeac 100755
--- a/test/w3c/convert-tests.sh
+++ b/test/w3c/convert-tests.sh
@@ -8,6 +8,35 @@ ME=`basename $0`
DIR="$( cd "$( dirname "$0" )" && pwd )"
cd $DIR
+while [ "$1" != "" ]; do
+ case $1 in
+ ecma )
+ ECMA=$1
+ shift ;;
+ lua )
+ LUA=$1
+ shift ;;
+ jexl )
+ JEXL=$1
+ shift ;;
+ namespace )
+ NAMESPACE=$1
+ shift ;;
+ xpath )
+ XPATH=$1
+ shift ;;
+ promela )
+ PROMELA=$1
+ shift ;;
+ prolog )
+ PROLOG=$1
+ shift ;;
+ * )
+ echo "unknown datamodel $1"
+ exit 1
+ esac
+done
+
TXMLS=`ls txml/*.txml`
TRANSFORM="java -jar /Users/sradomski/Developer/Applications/SaxonHE9-4-0-7J/saxon9he.jar"
@@ -16,26 +45,45 @@ for TXML in $TXMLS
do
echo -n "Processing $TXML for "
TARGETFILE=`basename $TXML .txml`.scxml
- # echo -n "ecma " && $TRANSFORM $TXML confEcma.xsl -o:ecma/$TARGETFILE
- echo -n "namespace " && $TRANSFORM ecma/$TARGETFILE confNamespace.xsl -o:namespace/$TARGETFILE
- # echo -n "xpath " && $TRANSFORM $TXML confXPath.xsl -o:xpath/$TARGETFILE
- # echo -n "promela " && $TRANSFORM $TXML confPromela.xsl -o:promela/$TARGETFILE
- # echo -n "prolog " && $TRANSFORM $TXML confProlog.xsl -o:prolog/$TARGETFILE
- # echo -n "lua " && $TRANSFORM $TXML confLua.xsl -o:lua/$TARGETFILE
+ if [ "$ECMA" != "" ]; then
+ echo -n "ecma " && $TRANSFORM $TXML confEcma.xsl -o:ecma/$TARGETFILE
+ fi
+ if [ "$JEXL" != "" ]; then
+ echo -n "jexl " && $TRANSFORM $TXML confJEXL.xsl -o:jexl/$TARGETFILE
+ fi
+ if [ "$NAMESPACE" != "" ]; then
+ echo -n "namespace " && $TRANSFORM ecma/$TARGETFILE confNamespace.xsl -o:namespace/$TARGETFILE
+ fi
+ if [ "$XPATH" != "" ]; then
+ echo -n "xpath " && $TRANSFORM $TXML confXPath.xsl -o:xpath/$TARGETFILE
+ fi
+ if [ "$PROMELA" != "" ]; then
+ echo -n "promela " && $TRANSFORM $TXML confPromela.xsl -o:promela/$TARGETFILE
+ fi
+ if [ "$PROLOG" != "" ]; then
+ echo -n "prolog " && $TRANSFORM $TXML confProlog.xsl -o:prolog/$TARGETFILE
+ fi
+ if [ "$LUA" != "" ]; then
+ echo -n "lua " && $TRANSFORM $TXML confLua.xsl -o:lua/$TARGETFILE
+ fi
echo
done
# make sure substitutions are idempotent!
-# percent needs to be escaped in lua patterns
-sed -i.orig 's/this%20is%20some%20content/this%%20is%%20some%%20content/g' ./lua/test520.scxml
+if [ "$LUA" != "" ]; then
+ # percent needs to be escaped in lua patterns
+ sed -i.orig 's/this%20is%20some%20content/this%%20is%%20some%%20content/g' ./lua/test520.scxml
-# x-www-form-urlencode will not preserve the type and we default to string
-sed -i.orig 's/Var1==2/tonumber(Var1)==2/g' ./lua/test567.scxml
+ # x-www-form-urlencode will not preserve the type and we default to string
+ sed -i.orig 's/Var1==2/tonumber(Var1)==2/g' ./lua/test567.scxml
+fi
-# unnamespace embedded xml in namespace tests
-sed -i.orig 's/scxml:book/book/g' ./namespace/test557.scxml
-sed -i.orig 's/scxml:book/book/g' ./namespace/test561.scxml
+if [ "$NAMESPACE" != "" ]; then
+ # unnamespace embedded xml in namespace tests
+ sed -i.orig 's/scxml:book/book/g' ./namespace/test557.scxml
+ sed -i.orig 's/scxml:book/book/g' ./namespace/test561.scxml
+fi
cp txml/*.txt ecma/
cp txml/*.txt namespace/
@@ -43,6 +91,7 @@ cp txml/*.txt xpath/
cp txml/*.txt promela/
cp txml/*.txt prolog/
cp txml/*.txt lua/
+cp txml/*.txt jexl/
find ./ecma -type f -exec grep -Ili 'datamodel="xpath"' {} \; |xargs rm -fv
find ./namespace -type f -exec grep -Ili 'datamodel="xpath"' {} \; |xargs rm -fv
@@ -60,6 +109,10 @@ find ./lua -type f -exec grep -Ili 'datamodel="xpath"' {} \; |xargs rm -fv
find ./lua -type f -exec grep -Ili 'datamodel="ecmascript"' {} \; |xargs rm -fv
find ./lua -type f -exec grep -Ili 'datamodel="null"' {} \; |xargs rm -fv
+find ./jexl -type f -exec grep -Ili 'datamodel="xpath"' {} \; |xargs rm -fv
+find ./jexl -type f -exec grep -Ili 'datamodel="ecmascript"' {} \; |xargs rm -fv
+find ./jexl -type f -exec grep -Ili 'datamodel="null"' {} \; |xargs rm -fv
+
# test436 is the null datamodel
mv ./ecma/test436.scxml ./null
rm ./namespace/test436.scxml
@@ -67,6 +120,7 @@ rm ./xpath/test436.scxml
rm ./promela/test436.scxml
rm ./prolog/test436.scxml
rm ./lua/test436.scxml
+rm ./jexl/test436.scxml
# format all SCXML files
SCXMLS=`find . -type f -name '*.scxml'`
diff --git a/test/w3c/jexl/robots.txt b/test/w3c/jexl/robots.txt
new file mode 100644
index 0000000..fdd7340
--- /dev/null
+++ b/test/w3c/jexl/robots.txt
@@ -0,0 +1,103 @@
+#
+# robots.txt for http://www.w3.org/
+#
+# $Id: robots.txt,v 1.74 2016/02/11 20:30:26 gerald Exp $
+#
+
+# For use by search.w3.org
+User-agent: W3C-gsa
+Disallow: /Out-Of-Date
+
+User-agent: W3T_SE
+Disallow: /Out-Of-Date
+
+User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT; MS Search 4.0 Robot)
+Disallow: /
+
+# W3C Link checker
+User-agent: W3C-checklink
+Disallow:
+
+# the following settings apply to all bots
+User-agent: *
+# Blogs - WordPress
+# https://codex.wordpress.org/Search_Engine_Optimization_for_WordPress#Robots.txt_Optimization
+Disallow: /*/wp-admin/
+Disallow: /*/wp-includes/
+Disallow: /*/wp-content/plugins/
+Disallow: /*/wp-content/cache/
+Disallow: /*/wp-content/themes/
+Disallow: /blog/*/trackback/
+Disallow: /blog/*/feed/
+Disallow: /blog/*/comments/
+Disallow: /blog/*/category/*/*
+Disallow: /blog/*/*/trackback/
+Disallow: /blog/*/*/feed/
+Disallow: /blog/*/*/comments/
+Disallow: /blog/*/*?
+Disallow: /community/trackback/
+Disallow: /community/feed/
+Disallow: /community/comments/
+Disallow: /community/category/*/*
+Disallow: /community/*/trackback/
+Disallow: /community/*/feed/
+Disallow: /community/*/comments/
+Disallow: /community/*/category/*/*
+Disallow: /community/*?
+Disallow: /Consortium/Offices/trackback/
+Disallow: /Consortium/Offices/feed/
+Disallow: /Consortium/Offices/comments/
+Disallow: /Consortium/Offices/category/*/*
+Disallow: /Consortium/Offices/*/trackback/
+Disallow: /Consortium/Offices/*/feed/
+Disallow: /Consortium/Offices/*/comments/
+Disallow: /Consortium/Offices/*?
+# Wikis - Mediawiki
+# https://www.mediawiki.org/wiki/Manual:Robots.txt
+Disallow: /wiki/index.php?
+Disallow: /wiki/index.php/Help
+Disallow: /wiki/index.php/MediaWiki
+Disallow: /wiki/index.php/Special:
+Disallow: /wiki/index.php/Template
+Disallow: /wiki/skins/
+Disallow: /*/wiki/index.php?
+Disallow: /*/wiki/index.php/Help
+Disallow: /*/wiki/index.php/MediaWiki
+Disallow: /*/wiki/index.php/Special:
+Disallow: /*/wiki/index.php/Template
+# various other access-controlled or expensive areas
+Disallow: /2004/ontaria/basic
+Disallow: /Team/
+Disallow: /Project
+Disallow: /Web
+Disallow: /Systems
+Disallow: /History
+Disallow: /Out-Of-Date
+Disallow: /2002/02/mid
+Disallow: /mid/
+Disallow: /2005/06/blog/
+Disallow: /2004/08/W3CTalks
+Disallow: /2007/11/Talks/search
+Disallow: /People/all/
+Disallow: /RDF/Validator/ARPServlet
+Disallow: /RDF/Validator/rdfval
+Disallow: /2003/03/Translations/byLanguage
+Disallow: /2003/03/Translations/byTechnology
+Disallow: /2005/11/Translations/Query
+Disallow: /2000/06/webdata/xslt
+Disallow: /2000/09/webdata/xslt
+Disallow: /2005/08/online_xslt/xslt
+Disallow: /Bugs/
+Disallow: /Search/Mail/Public/
+Disallow: /2006/02/chartergen
+Disallow: /2004/01/pp-impl
+Disallow: /Consortium/supporters
+Disallow: /2007/08/pyRdfa/
+Disallow: /2012/pyRdfa/extract
+Disallow: /WAI/PF/comments/
+Disallow: /participate/conferences.xml
+Disallow: /scripts/
+Disallow: /2005/01/yacker/
+Disallow: /2005/01/yacker?
+Disallow: /2003/09/nschecker?
+
diff --git a/test/w3c/jexl/test144.scxml b/test/w3c/jexl/test144.scxml
new file mode 100644
index 0000000..9423bdd
--- /dev/null
+++ b/test/w3c/jexl/test144.scxml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that events are inserted into the queue in the order in which they are raised. If
+foo occurs before bar, success, otherwise failure -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <raise event="foo"/>
+ <raise event="bar"/>
+ </onentry>
+ <transition event="foo" target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition event="bar" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test147.scxml b/test/w3c/jexl/test147.scxml
new file mode 100644
index 0000000..f30777a
--- /dev/null
+++ b/test/w3c/jexl/test147.scxml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the first clause that evaluates to true - and only that clause - is executed.
+Only one event should be raised, and it should be bar -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <if cond="false">
+ <raise event="foo"/>
+ <assign location="Var1" expr="Var1 + 1"/>
+ <elseif cond="true"/>
+ <raise event="bar"/>
+ <assign location="Var1" expr="Var1 + 1"/>
+ <else/>
+ <raise event="baz"/>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </if>
+ <raise event="bat"/>
+ </onentry>
+ <transition event="bar" cond="Var1==1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test148.scxml b/test/w3c/jexl/test148.scxml
new file mode 100644
index 0000000..53f2970
--- /dev/null
+++ b/test/w3c/jexl/test148.scxml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the else clause executes if <if> and <elseif> evaluate to false.
+Baz should be the only event generated by the <if>. bat is raised to catch the case where the <else> clause
+fails and baz is not generated, i.e. it makes sure that the test doesn't hang. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <if cond="false">
+ <raise event="foo"/>
+ <assign location="Var1" expr="Var1 + 1"/>
+ <elseif cond="false"/>
+ <raise event="bar"/>
+ <assign location="Var1" expr="Var1 + 1"/>
+ <else/>
+ <raise event="baz"/>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </if>
+ <raise event="bat"/>
+ </onentry>
+ <transition event="baz" cond="Var1==1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test149.scxml b/test/w3c/jexl/test149.scxml
new file mode 100644
index 0000000..3ea30c8
--- /dev/null
+++ b/test/w3c/jexl/test149.scxml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that neither if clause executes, so that bat is the only event raised. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <if cond="false">
+ <raise event="foo"/>
+ <assign location="Var1" expr="Var1 + 1"/>
+ <elseif cond="false"/>
+ <raise event="bar"/>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </if>
+ <raise event="bat"/>
+ </onentry>
+ <transition event="bat" cond="Var1==0" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test150.scxml b/test/w3c/jexl/test150.scxml
new file mode 100644
index 0000000..db4b217
--- /dev/null
+++ b/test/w3c/jexl/test150.scxml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that foreach causes a new variable to be declared if 'item' doesn't already exist. Also
+test that it will use an existing var if it does exist. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1"/>
+ <data id="Var2"/>
+ <data id="Var3">
+ [1,2,3]
+ </data>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <!-- first use declared variables -->
+ <foreach item="Var1" index="Var2" array="Var3"/>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error" target="fail"/>
+ <transition event="*" target="s1"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <!-- now use undeclared variables -->
+ <foreach item="Var4" index="Var5" array="Var3"/>
+ <raise event="bar"/>
+ </onentry>
+ <transition event="error" target="fail"/>
+ <transition event="*" target="s2"/>
+ </state>
+ <state id="s2">
+ <!-- check that var4 is bound -->
+ <transition cond="Var4" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test151.scxml b/test/w3c/jexl/test151.scxml
new file mode 100644
index 0000000..2de02bc
--- /dev/null
+++ b/test/w3c/jexl/test151.scxml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that foreach causes a new variable to be declared if 'item' doesn't already exist. Also
+test that it will use an existing var if it does exist. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1"/>
+ <data id="Var2"/>
+ <data id="Var3">
+ [1,2,3]
+ </data>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <!-- first use declared variables -->
+ <foreach item="Var1" index="Var2" array="Var3"/>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error" target="fail"/>
+ <transition event="*" target="s1"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <!-- now use undeclared variables -->
+ <foreach item="Var4" index="Var5" array="Var3"/>
+ <raise event="bar"/>
+ </onentry>
+ <transition event="error" target="fail"/>
+ <transition event="*" target="s2"/>
+ </state>
+ <state id="s2">
+ <!-- check that var5 is bound -->
+ <transition cond="Var5" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test152.scxml b/test/w3c/jexl/test152.scxml
new file mode 100644
index 0000000..368915a
--- /dev/null
+++ b/test/w3c/jexl/test152.scxml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that an illegal array or item value causes error.execution and results in executable content
+not being executed. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ <data id="Var2"/>
+ <data id="Var3"/>
+ <data id="Var4" expr="7"/>
+ <data id="Var5">
+ [1,2,3]
+ </data>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <!-- invalid array, legal item -->
+ <foreach item="Var2" index="Var3" array="Var4">
+ <assign location="Var1" expr="Var1 + 1"/>
+ </foreach>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error.execution" target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <!-- illegal item, legal array -->
+ <foreach item="'continue'" index="Var3" array="Var5">
+ <assign location="Var1" expr="Var1 + 1"/>
+ </foreach>
+ <raise event="bar"/>
+ </onentry>
+ <transition event="error.execution" target="s2"/>
+ <transition event="bar" target="fail"/>
+ </state>
+ <state id="s2">
+ <!-- check that var1 has its original value (so executable content never got executed -->
+ <transition cond="Var1==0" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test153.scxml b/test/w3c/jexl/test153.scxml
new file mode 100644
index 0000000..2df7e87
--- /dev/null
+++ b/test/w3c/jexl/test153.scxml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that foreach goes over the array in the right order. since the array contains 1 2 3, we compare the current
+value with the previous value, which is stored in var1. The current value should always be larger. If
+it ever isn't, set Var4 to 0, indicating failure -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ <!-- contains the previous value -->
+ <data id="Var2"/>
+ <!-- the item which will contain the current value -->
+ <data id="Var3">
+ [1,2,3]
+ </data>
+ <data id="Var4" expr="1"/>
+ <!-- 1 if success, 0 if failure -->
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <foreach item="Var2" array="Var3">
+ <if cond="Var1&lt;Var2">
+ <assign location="Var1" expr="Var2"/>
+ <else/>
+ <!-- values are out of order, record failure -->
+ <assign location="Var4" expr="0"/>
+ </if>
+ </foreach>
+ </onentry>
+ <!-- check that var1 has its original value -->
+ <transition cond="Var4==0" target="fail"/>
+ <transition target="pass"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test155.scxml b/test/w3c/jexl/test155.scxml
new file mode 100644
index 0000000..8c3b58b
--- /dev/null
+++ b/test/w3c/jexl/test155.scxml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that foreach executes the executable content once for each item in the list '(1,2,3)'. The executable
+content sums the items into var1 so it should be 6 at the end -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ <data id="Var2"/>
+ <data id="Var3">
+ [1,2,3]
+ </data>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <foreach item="Var2" array="Var3">
+ <assign location="Var1" expr="Var1 + Var2"/>
+ </foreach>
+ </onentry>
+ <transition cond="Var1==6" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test156.scxml b/test/w3c/jexl/test156.scxml
new file mode 100644
index 0000000..a0c615c
--- /dev/null
+++ b/test/w3c/jexl/test156.scxml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that an error causes the foreach to stop execution. The second piece of executable content
+should cause an error, so var1 should be incremented only once -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ <data id="Var2"/>
+ <data id="Var3">
+ [1,2,3]
+ </data>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <foreach item="Var2" array="Var3">
+ <assign location="Var1" expr="Var1 + 1"/>
+ <!-- assign an illegal value to a non-existent var -->
+ <assign location="Var5" expr="return"/>
+ </foreach>
+ </onentry>
+ <transition cond="Var1==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test158.scxml b/test/w3c/jexl/test158.scxml
new file mode 100644
index 0000000..fe16bd2
--- /dev/null
+++ b/test/w3c/jexl/test158.scxml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that executable content executes in document order. if event1 occurs then event2, succeed, otherwise fail -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <raise event="event1"/>
+ <raise event="event2"/>
+ </onentry>
+ <transition event="event1" target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition event="event2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test159.scxml b/test/w3c/jexl/test159.scxml
new file mode 100644
index 0000000..16080ea
--- /dev/null
+++ b/test/w3c/jexl/test159.scxml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that any error raised by an element of executable content causes all subsequent elements to be skipped.
+The send tag will raise an error so var1 should not be incremented. If it is fail, otherwise succeed -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="thisWillFail" target="baz"/>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onentry>
+ <transition cond="Var1==1" target="fail"/>
+ <transition target="pass"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test172.scxml b/test/w3c/jexl/test172.scxml
new file mode 100644
index 0000000..6b0dee0
--- /dev/null
+++ b/test/w3c/jexl/test172.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that eventexpr uses the current value of var1, not its initial value -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="'event1'"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="'event2'"/>
+ <send eventexpr="Var1"/>
+ </onentry>
+ <transition event="event2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test173.scxml b/test/w3c/jexl/test173.scxml
new file mode 100644
index 0000000..eb4e439
--- /dev/null
+++ b/test/w3c/jexl/test173.scxml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that targetexpr uses the current value of var1, not its initial value
+(If it uses the initial value, it will generate an error. If it uses the current value, event1 will be raised -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="27"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="'#_internal'"/>
+ <send targetexpr="Var1" event="event1"/>
+ </onentry>
+ <transition event="event1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test174.scxml b/test/w3c/jexl/test174.scxml
new file mode 100644
index 0000000..e9c5ee7
--- /dev/null
+++ b/test/w3c/jexl/test174.scxml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that typeexpr uses the current value of var1, not its initial value
+(If it uses the initial value, it will generate an error. If it uses the current value, event1 will be raised -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="27"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="'http://www.w3.org/TR/scxml/#SCXMLEventProcessor'"/>
+ <send typeexpr="Var1" event="event1"/>
+ </onentry>
+ <transition event="event1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test175.scxml b/test/w3c/jexl/test175.scxml
new file mode 100644
index 0000000..c6520aa
--- /dev/null
+++ b/test/w3c/jexl/test175.scxml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that delayexpr uses the current value of var1, not its initial value
+(If it uses the initial value, event2 will be generated first, before event1. If it uses the current value,
+event1 will be raised first. Succeed if event1 occurs before event2, otherwise fail -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="'0s'"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="'1s'"/>
+ <send delayexpr="Var1" event="event2"/>
+ <send delayexpr="'.5s'" event="event1"/>
+ </onentry>
+ <transition event="event1" target="s1"/>
+ <transition event="event2" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition event="event2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test176.scxml b/test/w3c/jexl/test176.scxml
new file mode 100644
index 0000000..1c3cc60
--- /dev/null
+++ b/test/w3c/jexl/test176.scxml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that <param> uses the current value of var1, not its initial value. If the value of
+aParam in event1 is 2 so that var2 gets set to 2, success, otherwise failure -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ <data id="Var2"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="2"/>
+ <send event="event1">
+ <param name="aParam" expr="Var1"/>
+ </send>
+ </onentry>
+ <transition event="event1" target="s1">
+ <assign location="Var2" expr="_event.data.aParam"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var2==2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test178.scxml b/test/w3c/jexl/test178.scxml
new file mode 100644
index 0000000..a3a39b0
--- /dev/null
+++ b/test/w3c/jexl/test178.scxml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that multiple key/value pairs are included, even when the keys are the same.
+This is a manual test. The tester must look at the log output and verify that both
+keys are there. (This test uses the SCXML Event I/O processor, which is the only
+one that all platforms must support. It does not specify the message format, so
+we cannot test _event.raw directly. Therefore we print it out for visual
+inspection.) -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="event1">
+ <param name="Var1" expr="2"/>
+ <param name="Var1" expr="3"/>
+ </send>
+ </onentry>
+ <transition event="event1" target="final">
+ <log label="_event " expr="_event.raw"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="final"/>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test179.scxml b/test/w3c/jexl/test179.scxml
new file mode 100644
index 0000000..d4d960f07
--- /dev/null
+++ b/test/w3c/jexl/test179.scxml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that <content> can be used to populate body of a message -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="event1">
+ <content>123</content>
+ </send>
+ </onentry>
+ <transition event="event1" cond="_event.data == 123" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test183.scxml b/test/w3c/jexl/test183.scxml
new file mode 100644
index 0000000..0ef3c72
--- /dev/null
+++ b/test/w3c/jexl/test183.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that <send> stores the value of the sendid in idlocation. If it does,
+var1 has a value and we pass. Otherwise we fail -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="event1" idlocation="Var1"/>
+ </onentry>
+ <transition cond="Var1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test185.scxml b/test/w3c/jexl/test185.scxml
new file mode 100644
index 0000000..bbb5451
--- /dev/null
+++ b/test/w3c/jexl/test185.scxml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that <send> respects the delay specification. If it does, event1 arrives before event2
+ and we pass. Otherwise we fail -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="event2" delayexpr="'1s'"/>
+ <send event="event1"/>
+ </onentry>
+ <transition event="event1" target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition event="event2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test186.scxml b/test/w3c/jexl/test186.scxml
new file mode 100644
index 0000000..a285fcd
--- /dev/null
+++ b/test/w3c/jexl/test186.scxml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that <send> evals its args when it is evaluated, not when the delay interval expires and the
+message is actually sent. If it does, aParam will have the value of 1 (even though var1 has been incremented
+in the interval.) If var2 ends up == 1, we pass. Otherwise we fail -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ <data id="Var2"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="event1" delayexpr="'1s'">
+ <param name="aParam" expr="Var1"/>
+ </send>
+ <assign location="Var1" expr="2"/>
+ </onentry>
+ <transition event="event1" target="s1">
+ <assign location="Var2" expr="_event.data.aParam"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var2==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test187.scxml b/test/w3c/jexl/test187.scxml
new file mode 100644
index 0000000..4fadc8c
--- /dev/null
+++ b/test/w3c/jexl/test187.scxml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that delayed <send> is not sent if the sending session terminates. In this case,
+a subscript is invoked which sends the event childToParent delayed by 1 second, and then terminates. The
+parent session, should not receive childToParent. If it does, we fail. Otherwise the
+10 sec timer expires and we pass -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delayexpr="'1s'"/>
+ </onentry>
+ <invoke type="scxml">
+ <content>
+ <!-- exit before the delayed send can execute -->
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <state id="sub0">
+ <onentry>
+ <send event="childToParent" target="#_parent" delayexpr="'.5s'"/>
+ </onentry>
+ <transition target="subFinal"/>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="childToParent" target="fail"/>
+ <transition event="timeout" target="pass"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test189.scxml b/test/w3c/jexl/test189.scxml
new file mode 100644
index 0000000..026ba80
--- /dev/null
+++ b/test/w3c/jexl/test189.scxml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that #_internal as a target of <send> puts the event on the internal queue. If it does,
+event1 will be processed before event2, because event1 is added to the internal queue while event2 is
+added to the external queue (event though event2 is generated first) -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <!-- goes to the external queue -->
+ <send event="event2"/>
+ <!-- to the internal queue -->
+ <send event="event1" target="#_internal"/>
+ </onentry>
+ <!-- once we've entered the state, we should check for internal events first -->
+ <transition event="event1" target="pass"/>
+ <transition event="event2" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test190.scxml b/test/w3c/jexl/test190.scxml
new file mode 100644
index 0000000..02c0c72
--- /dev/null
+++ b/test/w3c/jexl/test190.scxml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that #_scxml_sessionid as a target of <send> puts the event on the external queue. If it does,
+event1 will be processed before event2, because event1 is added to the internal queue while event2 is
+added to the external queue (event though event2 is generated first). we have to make sure that event2
+is actually delivered. The delayed <send> makes sure another event is generated (so the test doesn't hang) -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="'#_scxml_'"/>
+ <data id="Var2" expr="_sessionid"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="Var1 + Var2"/>
+ <!-- goes to the external queue -->
+ <send event="event2" targetexpr="Var1"/>
+ <!-- to the internal queue -->
+ <raise event="event1"/>
+ <!-- this should get added to the external queue after event2 -->
+ <send event="timeout"/>
+ </onentry>
+ <!-- once we've entered the state, we should check for internal events first -->
+ <transition event="event1" target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <!-- now check that we get event2 and not a timeout -->
+ <state id="s1">
+ <transition event="event2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test191.scxml b/test/w3c/jexl/test191.scxml
new file mode 100644
index 0000000..fbc117d
--- /dev/null
+++ b/test/w3c/jexl/test191.scxml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that #_parent works as a target of <send> . a subscript is invoked and sends the event
+childToParent to its parent session (ths session) using #_parent as the target. If we get this event, we
+pass, otherwise we fail. The timer insures that some event is generated and that the test does not hang. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="5s"/>
+ </onentry>
+ <invoke type="scxml">
+ <content>
+ <!-- send an event to the parent session using #_parent as the target -->
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <state id="sub0">
+ <onentry>
+ <send event="childToParent" target="#_parent"/>
+ </onentry>
+ <transition target="subFinal"/>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="childToParent" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test192.scxml b/test/w3c/jexl/test192.scxml
new file mode 100644
index 0000000..5a49e4d
--- /dev/null
+++ b/test/w3c/jexl/test192.scxml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that #_invokeid works as a target of <send> . A child script is invoked and sends us
+childToParent once its running. Then we send it the event parentToChild using its invokeid as the target.
+If it receives this event, it sends sends the event eventReceived to its parent session (ths session).
+If we get this event, we pass, otherwise the child script eventually times out sends invoke.done and we fail.
+We also set a timeout in this process to make sure the test doesn't hang -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="5s"/>
+ </onentry>
+ <invoke type="scxml" id="invokedChild">
+ <content>
+ <!-- let the parent session know we're running by sending childToParent, then wait for parentToChild.
+ If we get it, send eventReceived. If we don't we eventually time out -->
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <state id="sub0">
+ <onentry>
+ <send event="childToParent" target="#_parent"/>
+ <send event="timeout" delay="3s"/>
+ </onentry>
+ <transition event="parentToChild" target="subFinal">
+ <send target="#_parent" event="eventReceived"/>
+ </transition>
+ <transition event="timeout" target="subFinal"/>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="timeout" target="fail"/>
+ <transition event="done.invoke" target="fail"/>
+ <state id="s01">
+ <transition event="childToParent" target="s02">
+ <send target="#_invokedChild" event="parentToChild"/>
+ </transition>
+ </state>
+ <state id="s02">
+ <transition event="eventReceived" target="pass"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test193.scxml b/test/w3c/jexl/test193.scxml
new file mode 100644
index 0000000..32654f7
--- /dev/null
+++ b/test/w3c/jexl/test193.scxml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that omitting target and targetexpr of <send> when using the
+SCXML event i/o processor puts the event on the external queue. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="internal"/>
+ <!-- this should put event1 in the external queue -->
+ <send event="event1" type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor"/>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="event1" target="fail"/>
+ <transition event="internal" target="s1"/>
+ </state>
+ <state id="s1">
+ <transition event="event1" target="pass"/>
+ <transition event="timeout" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test194.scxml b/test/w3c/jexl/test194.scxml
new file mode 100644
index 0000000..7172316
--- /dev/null
+++ b/test/w3c/jexl/test194.scxml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that specifying an illegal target for <send> causes the event error.execution to be raised. If it does,
+we succeed. Otherwise we eventually timeout and fail. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <!-- should cause an error -->
+ <send target="baz" event="event2"/>
+ <!-- this will get added to the external event queue after the error has been raised -->
+ <send event="timeout"/>
+ </onentry>
+ <!-- once we've entered the state, we should check for internal events first -->
+ <transition event="error.execution" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test198.scxml b/test/w3c/jexl/test198.scxml
new file mode 100644
index 0000000..d894aa8
--- /dev/null
+++ b/test/w3c/jexl/test198.scxml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that if type is not provided <send> uses the scxml event i/o processor. The only way to tell
+what processor was used is to look at the origintype of the resulting event -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="event1"/>
+ <send event="timeout"/>
+ </onentry>
+ <transition event="event1" cond=" _event.origintype == 'http://www.w3.org/TR/scxml/#SCXMLEventProcessor'" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test199.scxml b/test/w3c/jexl/test199.scxml
new file mode 100644
index 0000000..41a46ea
--- /dev/null
+++ b/test/w3c/jexl/test199.scxml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that using an invalid send type results in error.execution -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send type="27" event="event1"/>
+ <send event="timeout"/>
+ </onentry>
+ <transition event="error.execution" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test200.scxml b/test/w3c/jexl/test200.scxml
new file mode 100644
index 0000000..39a05de
--- /dev/null
+++ b/test/w3c/jexl/test200.scxml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that the processor supports the scxml event i/o processor -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <send type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" event="event1"/>
+ <send event="timeout"/>
+ </onentry>
+ <transition event="event1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test201.scxml b/test/w3c/jexl/test201.scxml
new file mode 100644
index 0000000..bef8ffe
--- /dev/null
+++ b/test/w3c/jexl/test201.scxml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that the processor supports the basic http event i/o processor. This is an optional
+test since platforms are not required to support basic http event i/o -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor" targetexpr="_ioprocessors['basichttp']['location']" event="event1"/>
+ <send event="timeout"/>
+ </onentry>
+ <transition event="event1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test205.scxml b/test/w3c/jexl/test205.scxml
new file mode 100644
index 0000000..cd58463
--- /dev/null
+++ b/test/w3c/jexl/test205.scxml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that the processor doesn't change the message. We can't test that it never does this, but
+at least we can check that the event name and included data are the same as we sent. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="event1">
+ <param name="aParam" expr="1"/>
+ </send>
+ <send event="timeout"/>
+ </onentry>
+ <transition event="event1" target="s1">
+ <assign location="Var1" expr="_event.data.aParam"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var1==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test207.scxml b/test/w3c/jexl/test207.scxml
new file mode 100644
index 0000000..7c02044
--- /dev/null
+++ b/test/w3c/jexl/test207.scxml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that that we can't cancel an event in another session. We invoke a child process. It notifies
+us when it has generated a delayed event with sendid foo. We try to cancel foo. The child process sends us event
+ event success if the event is not cancelled, event fail otherwise. This doesn't test that there is absolutely no way to cancel an event
+raised in another session, but the spec doesn't define any way to refer to an event in another process -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delayexpr="'2s'"/>
+ </onentry>
+ <invoke type="scxml">
+ <content>
+ <!-- when invoked, we raise a delayed event1 with sendid 'foo' and notify our parent. Then we wait.
+ If event1 occurs, the parent hasn't succeeded in canceling it and we return pass. If event2 occurs
+ it means event1 was canceled (because event2 is delayed longer than event1) and we return 'fail'. -->
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <state id="sub0">
+ <onentry>
+ <send event="event1" id="foo" delayexpr="'1s'"/>
+ <send event="event2" delayexpr="'1.5s'"/>
+ <send target="#_parent" event="childToParent"/>
+ </onentry>
+ <transition event="event1" target="subFinal">
+ <send target="#_parent" event="pass"/>
+ </transition>
+ <transition event="*" target="subFinal">
+ <send target="#_parent" event="fail"/>
+ </transition>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <state id="s01">
+ <transition event="childToParent" target="s02">
+ <cancel sendid="foo"/>
+ </transition>
+ </state>
+ <state id="s02">
+ <transition event="pass" target="pass"/>
+ <transition event="fail" target="fail"/>
+ <transition event="timeout" target="fail"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test208.scxml b/test/w3c/jexl/test208.scxml
new file mode 100644
index 0000000..128e98e
--- /dev/null
+++ b/test/w3c/jexl/test208.scxml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that cancel works. We cancel delayed event1. If cancel works, we get event2 first and pass. If
+we get event1 or an error first, cancel didn't work and we fail. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send id="foo" event="event1" delayexpr="'1s'"/>
+ <send event="event2" delayexpr="'1.5s'"/>
+ <cancel sendid="foo"/>
+ </onentry>
+ <transition event="event2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test210.scxml b/test/w3c/jexl/test210.scxml
new file mode 100644
index 0000000..b330a32
--- /dev/null
+++ b/test/w3c/jexl/test210.scxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that sendidexpr works with cancel. If it takes the most recent value of var1, it should cancel
+delayed event1. Thus we get event2 first and pass. If we get event1 or an error first, cancel didn't work and we fail. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="'bar'"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send id="foo" event="event1" delayexpr="'1s'"/>
+ <send event="event2" delayexpr="'1.5s'"/>
+ <assign location="Var1" expr="'foo'"/>
+ <cancel sendidexpr="Var1"/>
+ </onentry>
+ <transition event="event2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test215.scxml b/test/w3c/jexl/test215.scxml
new file mode 100644
index 0000000..3038c58
--- /dev/null
+++ b/test/w3c/jexl/test215.scxml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that typexpr is evaluated at runtime. If the original value of var1 is used, the invocation
+will fail (test215sub1.scxml is not of type 'foo', even if the platform supports foo as a type). If
+the runtime value is used, the invocation will succeed -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="'foo'"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="5s"/>
+ <assign location="Var1" expr="'http://www.w3.org/TR/scxml/'"/>
+ </onentry>
+ <invoke typeexpr="Var1">
+ <content>
+ <!-- when invoked, terminate returning done.invoke. This proves that the invocation succeeded. -->
+ <scxml initial="subFinal" datamodel="jexl" version="1.0">
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="done.invoke" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test216.scxml b/test/w3c/jexl/test216.scxml
new file mode 100644
index 0000000..88c98a0
--- /dev/null
+++ b/test/w3c/jexl/test216.scxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that srcexpr is evaluated at runtime. If the original value of var1 is used, the invocation
+will fail (assuming that there is no script named 'foo'). If
+the runtime value is used, the invocation will succeed -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="'foo'"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="5s"/>
+ <assign location="Var1" expr="'file:test216sub1.scxml'"/>
+ </onentry>
+ <invoke srcexpr="Var1" type="http://www.w3.org/TR/scxml"/>
+ <transition event="done.invoke" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test216sub1.scxml b/test/w3c/jexl/test216sub1.scxml
new file mode 100644
index 0000000..d6d865b
--- /dev/null
+++ b/test/w3c/jexl/test216sub1.scxml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- when invoked, terminate returning done.invoke. This proves that the invocation succeeded. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="final" version="1.0" datamodel="jexl">
+ <final id="final"/>
+</scxml>
diff --git a/test/w3c/jexl/test220.scxml b/test/w3c/jexl/test220.scxml
new file mode 100644
index 0000000..f6ef03d
--- /dev/null
+++ b/test/w3c/jexl/test220.scxml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that the scxml type is supported. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="5s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <content>
+ <!-- when invoked, terminate returning done.invoke. This proves that the invocation succeeded. -->
+ <scxml initial="subFinal" version="1.0" datamodel="jexl">
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="done.invoke" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test223.scxml b/test/w3c/jexl/test223.scxml
new file mode 100644
index 0000000..45b885a
--- /dev/null
+++ b/test/w3c/jexl/test223.scxml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that idlocation is supported. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/" idlocation="Var1">
+ <content>
+ <!-- when invoked, terminate returning done.invoke. This proves that the invocation succeeded. -->
+ <scxml initial="subFinal" version="1.0" datamodel="jexl">
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="*" target="s1"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test224.scxml b/test/w3c/jexl/test224.scxml
new file mode 100644
index 0000000..7281617
--- /dev/null
+++ b/test/w3c/jexl/test224.scxml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that the automatically generated id has the form stateid.platformid. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1"/>
+ <data id="Var2" expr="'s0.'"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/" idlocation="Var1">
+ <content>
+ <!-- when invoked, terminate returning done.invoke. This proves that the invocation succeeded. -->
+ <scxml version="1.0" initial="subFinal" datamodel="jexl">
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="*" target="s1"/>
+ </state>
+ <state id="s1">
+ <transition cond="(function(str, starts){if (starts === '') return true;if (str == null || starts == null) return false;str = String(str); starts = String(starts);return str.length &gt;= starts.length &amp;&amp; str.slice(0, starts.length) === starts;})(Var1, Var2)" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test225.scxml b/test/w3c/jexl/test225.scxml
new file mode 100644
index 0000000..23acedf
--- /dev/null
+++ b/test/w3c/jexl/test225.scxml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that the automatically generated id is unique, we call invoke twice and compare the ids. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1"/>
+ <data id="Var2"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/" idlocation="Var1">
+ <content>
+ <scxml initial="subFinal1" version="1.0" datamodel="jexl">
+ <final id="subFinal1"/>
+ </scxml>
+ </content>
+ </invoke>
+ <invoke type="http://www.w3.org/TR/scxml/" idlocation="Var2">
+ <content>
+ <scxml initial="subFinal2" version="1.0" datamodel="jexl">
+ <final id="subFinal2"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="*" target="s1"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var1===Var2" target="fail"/>
+ <transition target="pass"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test226.scxml b/test/w3c/jexl/test226.scxml
new file mode 100644
index 0000000..44c5fdc
--- /dev/null
+++ b/test/w3c/jexl/test226.scxml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- this is basically just a test that invoke works correctly and that you can pass data
+to the invoked process. If the invoked session finds aParam==1, it exits, signalling
+success. otherwise it will hang and the timeout in this doc signifies failure. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="3s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/" src="file:test226sub1.scxml">
+ <param name="Var1" expr="1"/>
+ </invoke>
+ <transition event="varBound" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test226sub1.scxml b/test/w3c/jexl/test226sub1.scxml
new file mode 100644
index 0000000..3d8d2b6
--- /dev/null
+++ b/test/w3c/jexl/test226sub1.scxml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- when invoked, if var1 has a value notify parent. Then terminate. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0">
+ <transition cond="Var1" target="final">
+ <send target="#_parent" event="varBound"/>
+ </transition>
+ <transition target="final"/>
+ </state>
+ <final id="final"/>
+</scxml>
diff --git a/test/w3c/jexl/test228.scxml b/test/w3c/jexl/test228.scxml
new file mode 100644
index 0000000..497174b
--- /dev/null
+++ b/test/w3c/jexl/test228.scxml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the invokeid is included in events returned from the invoked process. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="3s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/" id="foo">
+ <content>
+ <scxml initial="subFinal" version="1.0" datamodel="jexl">
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="done.invoke" target="s1">
+ <assign location="Var1" expr="_event.invokeid"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var1=='foo'" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test229.scxml b/test/w3c/jexl/test229.scxml
new file mode 100644
index 0000000..c15b508
--- /dev/null
+++ b/test/w3c/jexl/test229.scxml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that autofoward works. If the child process receives back a copy of the
+childToParent event that it sends to this doc, it sends eventReceived, signalling success. (Note
+that this doc is not required to process that event explicitly. It should be forwarded in any case.) Otherwise
+it eventually times out and the done.invoke signals failure -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="3s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/" autoforward="true">
+ <content>
+ <!-- when invoked, send childToParent to parent.
+ If it is forwarded back to us, send
+ eventReceived to signal success and terminate.
+ Otherwise wait for timer to expire and terminate. -->
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <state id="sub0">
+ <onentry>
+ <send target="#_parent" event="childToParent"/>
+ <send event="timeout" delay="3s"/>
+ </onentry>
+ <transition event="childToParent" target="subFinal">
+ <send target="#_parent" event="eventReceived"/>
+ </transition>
+ <transition event="*" target="subFinal"/>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="childToParent"/>
+ <transition event="eventReceived" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test230.scxml b/test/w3c/jexl/test230.scxml
new file mode 100644
index 0000000..dab6632
--- /dev/null
+++ b/test/w3c/jexl/test230.scxml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- a manual test that an autofowarded event has the same fields and values as the original event.
+the child process sends the parent process an event which is forwarded back to it.
+Both the parent and child process print out the contents of the event. The tester
+must check if they are the same and report his result. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="3s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/" autoforward="true">
+ <content>
+ <!-- when invoked, send childToParent to parent. If it is forwarded back to us, print out its
+ fields and terminate. -->
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <state id="sub0">
+ <onentry>
+ <send target="#_parent" event="childToParent"/>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <transition event="childToParent" target="subFinal">
+ <log label="name is " expr="_event.name"/>
+ <log label="type is " expr="_event.type"/>
+ <log label="sendid is " expr="_event.sendid"/>
+ <log label="origin is " expr="_event.origin"/>
+ <log label="origintype is " expr="_event.origintype"/>
+ <log label="invokeid is " expr="_event.invokeid"/>
+ <log label="data is " expr="_event.data"/>
+ </transition>
+ <transition event="*" target="subFinal"/>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="timeout" target="final"/>
+ <state id="s01">
+ <transition event="childToParent" target="s02">
+ <log label="name is " expr="_event.name"/>
+ <log label="type is " expr="_event.type"/>
+ <log label="sendid is " expr="_event.sendid"/>
+ <log label="origin is " expr="_event.origin"/>
+ <log label="origintype is " expr="_event.origintype"/>
+ <log label="invokeid is " expr="_event.invokeid"/>
+ <log label="data is " expr="_event.data"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s02">
+ <!-- wait till we get the done event to ensure that the child process has time to print out its results -->
+ <transition event="done.invoke" target="final"/>
+ </state>
+ </state>
+ <final id="final"/>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test232.scxml b/test/w3c/jexl/test232.scxml
new file mode 100644
index 0000000..f60db6e
--- /dev/null
+++ b/test/w3c/jexl/test232.scxml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that a parent process can receive multiple events from a child process -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="3s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <content>
+ <scxml initial="subFinal" version="1.0" datamodel="jexl">
+ <final id="subFinal">
+ <onentry>
+ <send target="#_parent" event="childToParent1"/>
+ <send target="#_parent" event="childToParent2"/>
+ </onentry>
+ </final>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="timeout" target="fail"/>
+ <state id="s01">
+ <transition event="childToParent1" target="s02"/>
+ </state>
+ <state id="s02">
+ <transition event="childToParent2" target="s03"/>
+ </state>
+ <state id="s03">
+ <transition event="done.invoke" target="pass"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test233.scxml b/test/w3c/jexl/test233.scxml
new file mode 100644
index 0000000..7f37982
--- /dev/null
+++ b/test/w3c/jexl/test233.scxml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that finalize markup runs before the event is processed. The invoked process will
+return 2 in _event.data.aParam, so that new value should be in force when we select
+the transtitions. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="3s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <content>
+ <scxml initial="subFinal" version="1.0" datamodel="jexl">
+ <final id="subFinal">
+ <onentry>
+ <send target="#_parent" event="childToParent">
+ <param name="aParam" expr="2"/>
+ </send>
+ </onentry>
+ </final>
+ </scxml>
+ </content>
+ <finalize>
+ <assign location="Var1" expr="_event.data.aParam"/>
+ </finalize>
+ </invoke>
+ <transition event="childToParent" cond="Var1==2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test234.scxml b/test/w3c/jexl/test234.scxml
new file mode 100644
index 0000000..6793f99
--- /dev/null
+++ b/test/w3c/jexl/test234.scxml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that only finalize markup in the invoking state runs. the first invoked process will
+return 2 in _event.data.aParam, while second invoked process sleeps without returning any events.
+Only the first finalize should execute. So when we get to s1 var1 should have value 2 but
+var2 should still be set to 1 -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="p0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ <data id="Var2" expr="1"/>
+ </datamodel>
+ <parallel id="p0">
+ <onentry>
+ <send event="timeout" delay="3s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <state id="p01">
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <content>
+ <scxml version="1.0" initial="subFinal1" datamodel="jexl">
+ <final id="subFinal1">
+ <onentry>
+ <send target="#_parent" event="childToParent">
+ <param name="aParam" expr="2"/>
+ </send>
+ </onentry>
+ </final>
+ </scxml>
+ </content>
+ <finalize>
+ <assign location="Var1" expr="_event.data.aParam"/>
+ </finalize>
+ </invoke>
+ <transition event="childToParent" cond="Var1==2" target="s1"/>
+ <transition event="childToParent" target="fail"/>
+ </state>
+ <state id="p02">
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <content>
+ <scxml version="1.0" initial="sub0" datamodel="jexl">
+ <state id="sub0">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <transition event="timeout" target="subFinal2"/>
+ </state>
+ <final id="subFinal2"/>
+ </scxml>
+ </content>
+ <finalize>
+ <assign location="Var2" expr="_event.data.aParam"/>
+ </finalize>
+ </invoke>
+ </state>
+ </parallel>
+ <state id="s1">
+ <transition cond="Var2==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test235.scxml b/test/w3c/jexl/test235.scxml
new file mode 100644
index 0000000..0b8b377
--- /dev/null
+++ b/test/w3c/jexl/test235.scxml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that done.invoke.id event has the right id. the invoked child terminates immediately
+and should generate done.invoke.foo -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/" id="foo">
+ <content>
+ <scxml initial="subFinal" version="1.0" datamodel="jexl">
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="done.invoke.foo" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test236.scxml b/test/w3c/jexl/test236.scxml
new file mode 100644
index 0000000..976f7ef
--- /dev/null
+++ b/test/w3c/jexl/test236.scxml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that done.invoke.id event is the last event we receive. the invoked process sends childToParent
+in the exit handler of its final state. We should get it before the done.invoke, and we should get no
+events after the done.invoke. Hence timeout indicates success -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delayexpr="'2s'"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <content>
+ <scxml initial="subFinal" version="1.0" datamodel="jexl">
+ <final id="subFinal">
+ <onexit>
+ <send target="#_parent" event="childToParent"/>
+ </onexit>
+ </final>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="childToParent" target="s1"/>
+ <transition event="done.invoke" target="fail"/>
+ </state>
+ <state id="s1">
+ <!-- here we should get done.invoke -->
+ <transition event="done.invoke" target="s2"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s2">
+ <transition event="timeout" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test237.scxml b/test/w3c/jexl/test237.scxml
new file mode 100644
index 0000000..187cc30
--- /dev/null
+++ b/test/w3c/jexl/test237.scxml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that cancelling works. invoked child sleeps for two seconds, then terminates. We
+sleep for 1 sec in s0, then move to s1. This should cause the invocation to get cancelled.
+If we receive done.invoke, the invocation wasn't cancelled, and we fail. If we receive no events by
+the time timeout2 fires, success -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timeout1" delayexpr="'1s'"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <content>
+ <!-- when invoked, sleep for 2 secs then terminate. Parent will try to cancel this session -->
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <state id="sub0">
+ <onentry>
+ <send event="timeout" delayexpr="'2s'"/>
+ </onentry>
+ <transition event="timeout" target="subFinal"/>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="timeout1" target="s1"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <send event="timeout2" delayexpr="'1.5s'"/>
+ </onentry>
+ <!-- here we should NOT get done.invoke -->
+ <transition event="done.invoke" target="fail"/>
+ <transition event="*" target="pass"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test239.scxml b/test/w3c/jexl/test239.scxml
new file mode 100644
index 0000000..8962bf4
--- /dev/null
+++ b/test/w3c/jexl/test239.scxml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that markup can be specified both by 'src' and by <content> -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <state id="s01">
+ <invoke type="http://www.w3.org/TR/scxml/" src="file:test239sub1.scxml"/>
+ <transition event="done.invoke" target="s02"/>
+ </state>
+ <state id="s02">
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <!-- identical to test239sub1.scxml. -->
+ <content>
+ <scxml version="1.0" initial="final" datamodel="jexl">
+ <final id="final"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="done.invoke" target="pass"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test239sub1.scxml b/test/w3c/jexl/test239sub1.scxml
new file mode 100644
index 0000000..18c8e81
--- /dev/null
+++ b/test/w3c/jexl/test239sub1.scxml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- when invoked, just terminate. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="final" version="1.0" datamodel="jexl">
+ <final id="final"/>
+</scxml>
diff --git a/test/w3c/jexl/test240.scxml b/test/w3c/jexl/test240.scxml
new file mode 100644
index 0000000..4eacdf9
--- /dev/null
+++ b/test/w3c/jexl/test240.scxml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that datamodel values can be specified both by 'namelist' and by <param>.
+invoked child will return success if its Var1 is set to 1, failure otherwise. This
+test will fail schema validation because of the multiple occurences of Var1, but
+should run correctly. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <state id="s01">
+ <invoke type="http://www.w3.org/TR/scxml/" namelist="Var1">
+ <content>
+ <scxml initial="sub01" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="sub01">
+ <transition cond="Var1===1" target="subFinal1">
+ <send target="#_parent" event="success"/>
+ </transition>
+ <transition target="subFinal1">
+ <send target="#_parent" event="failure"/>
+ </transition>
+ </state>
+ <final id="subFinal1"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="success" target="s02"/>
+ <transition event="failure" target="fail"/>
+ </state>
+ <state id="s02">
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <param name="Var1" expr="1"/>
+ <content>
+ <scxml initial="sub02" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="sub02">
+ <transition cond="Var1==1" target="subFinal2">
+ <send target="#_parent" event="success"/>
+ </transition>
+ <transition target="subFinal2">
+ <send target="#_parent" event="failure"/>
+ </transition>
+ </state>
+ <final id="subFinal2"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="success" target="pass"/>
+ <transition event="failure" target="fail"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test241.scxml b/test/w3c/jexl/test241.scxml
new file mode 100644
index 0000000..eec2029
--- /dev/null
+++ b/test/w3c/jexl/test241.scxml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- The child process will return success ifits Var1 is set to 1, failure otherwise. For this test
+we try passing in Var1 by param and by namelist and check that we either get two successes
+or two failures. This test will fail schema validation due to multiple declarations of
+Var1, but should run correctly. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <state id="s01">
+ <invoke type="http://www.w3.org/TR/scxml/" namelist="Var1">
+ <content>
+ <scxml initial="sub01" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="sub01">
+ <transition cond="Var1==1" target="subFinal1">
+ <send target="#_parent" event="success"/>
+ </transition>
+ <transition target="subFinal1">
+ <send target="#_parent" event="failure"/>
+ </transition>
+ </state>
+ <final id="subFinal1"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="success" target="s02"/>
+ <transition event="failure" target="s03"/>
+ </state>
+ <state id="s02">
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <param name="Var1" expr="1"/>
+ <content>
+ <scxml initial="sub02" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="sub02">
+ <transition cond="Var1==1" target="subFinal2">
+ <send target="#_parent" event="success"/>
+ </transition>
+ <transition target="subFinal2">
+ <send target="#_parent" event="failure"/>
+ </transition>
+ </state>
+ <final id="subFinal2"/>
+ </scxml>
+ </content>
+ </invoke>
+ <!-- we got success in s01, so we need to do so here -->
+ <transition event="success" target="pass"/>
+ <transition event="failure" target="fail"/>
+ </state>
+ <state id="s03">
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <param name="Var1" expr="1"/>
+ <content>
+ <scxml initial="sub03" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="sub03">
+ <transition cond="Var1==1" target="subFinal3">
+ <send target="#_parent" event="success"/>
+ </transition>
+ <transition target="subFinal3">
+ <send target="#_parent" event="failure"/>
+ </transition>
+ </state>
+ <final id="subFinal3"/>
+ </scxml>
+ </content>
+ </invoke>
+ <!-- we got failure in s01, so we need to do so here -->
+ <transition event="failure" target="pass"/>
+ <transition event="success" target="fail"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test242.scxml b/test/w3c/jexl/test242.scxml
new file mode 100644
index 0000000..0bb8286
--- /dev/null
+++ b/test/w3c/jexl/test242.scxml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that markup specified by 'src' and by <content> is treated the same way. That means that
+either we get done.invoke in both cases or in neither case (in which case we timeout) -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timeout1" delay="1s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <invoke type="http://www.w3.org/TR/scxml/" src="file:test242sub1.scxml"/>
+ <transition event="done.invoke" target="s02"/>
+ <transition event="timeout1" target="s03"/>
+ </state>
+ <state id="s02">
+ <onentry>
+ <send event="timeout2" delay="1s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <!-- identical to test242sub1.scxml. -->
+ <content>
+ <scxml version="1.0" initial="subFinal1" datamodel="jexl">
+ <final id="subFinal1"/>
+ </scxml>
+ </content>
+ </invoke>
+ <!-- we got done.invoke last time, so we need it this time too -->
+ <transition event="done.invoke" target="pass"/>
+ <transition event="timeout2" target="fail"/>
+ </state>
+ <state id="s03">
+ <onentry>
+ <send event="timeout3" delay="1s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <!-- identical to test242sub1.scxml. -->
+ <content>
+ <scxml version="1.0" initial="subFinal2" datamodel="jexl">
+ <final id="subFinal2"/>
+ </scxml>
+ </content>
+ </invoke>
+ <!-- we got timeout last time, so we need it this time too -->
+ <transition event="timeout3" target="pass"/>
+ <transition event="done.invoke" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test242sub1.scxml b/test/w3c/jexl/test242sub1.scxml
new file mode 100644
index 0000000..18c8e81
--- /dev/null
+++ b/test/w3c/jexl/test242sub1.scxml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- when invoked, just terminate. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="final" version="1.0" datamodel="jexl">
+ <final id="final"/>
+</scxml>
diff --git a/test/w3c/jexl/test243.scxml b/test/w3c/jexl/test243.scxml
new file mode 100644
index 0000000..ed9ff46
--- /dev/null
+++ b/test/w3c/jexl/test243.scxml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that datamodel values can be specified by param.
+test240sub1 will return success ifits Var1 is set to 1, failure otherwise. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <param name="Var1" expr="1"/>
+ <content>
+ <scxml version="1.0" initial="sub0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="sub0">
+ <transition cond="Var1==1" target="subFinal">
+ <send target="#_parent" event="success"/>
+ </transition>
+ <transition target="subFinal">
+ <send target="#_parent" event="failure"/>
+ </transition>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="success" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test244.scxml b/test/w3c/jexl/test244.scxml
new file mode 100644
index 0000000..c3cbdb5
--- /dev/null
+++ b/test/w3c/jexl/test244.scxml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that datamodel values can be specified by namelist.
+invoked child will return success ifits Var1 is set to 1, failure otherwise.
+This test will fail schema validation due to multiple occurrences of Var1,
+but should run correctly. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/" namelist="Var1">
+ <content>
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="sub0">
+ <transition cond="Var1==1" target="subFinal">
+ <send target="#_parent" event="success"/>
+ </transition>
+ <transition target="subFinal">
+ <send target="#_parent" event="failure"/>
+ </transition>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="success" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test245.scxml b/test/w3c/jexl/test245.scxml
new file mode 100644
index 0000000..955bf9f
--- /dev/null
+++ b/test/w3c/jexl/test245.scxml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that non-existent datamodel values are not set. Var2 is not defined in
+invoked child's datamodel. It will will return success if its Var2 remains unbound, failure otherwise. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var2" expr="3"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/" namelist="Var2">
+ <content>
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <state id="sub0">
+ <transition cond="Var2" target="subFinal">
+ <send target="#_parent" event="failure"/>
+ </transition>
+ <transition target="subFinal">
+ <send target="#_parent" event="success"/>
+ </transition>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="success" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test247.scxml b/test/w3c/jexl/test247.scxml
new file mode 100644
index 0000000..f262626
--- /dev/null
+++ b/test/w3c/jexl/test247.scxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that we get done.invoke. timeout indicates failure -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <content>
+ <scxml version="1.0" initial="subFinal" datamodel="jexl">
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="done.invoke" target="pass"/>
+ <transition event="timeout" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test250.scxml b/test/w3c/jexl/test250.scxml
new file mode 100644
index 0000000..c7c12e3
--- /dev/null
+++ b/test/w3c/jexl/test250.scxml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the onexit handlers run in the invoked process if it is cancelled. This has to be a
+manual test, since this process won't accept any events from the child process once it has been cancelled.
+Tester must examine log output from child process to determine success -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="foo"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <content>
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <state id="sub0" initial="sub01">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <transition event="timeout" target="subFinal"/>
+ <onexit>
+ <log expr="'Exiting sub0'"/>
+ </onexit>
+ <state id="sub01">
+ <onexit>
+ <log expr="'Exiting sub01'"/>
+ </onexit>
+ </state>
+ </state>
+ <final id="subFinal">
+ <onentry>
+ <log expr="'entering final state, invocation was not cancelled'"/>
+ </onentry>
+ </final>
+ </scxml>
+ </content>
+ </invoke>
+ <!-- this transition will cause the invocation to be cancelled -->
+ <transition event="foo" target="final"/>
+ </state>
+ <final id="final"/>
+</scxml>
diff --git a/test/w3c/jexl/test252.scxml b/test/w3c/jexl/test252.scxml
new file mode 100644
index 0000000..0ef3890
--- /dev/null
+++ b/test/w3c/jexl/test252.scxml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that we don't process any events received from the invoked process once it is cancelled. child
+process tries to send us childToParent in an onexit handler. If we get it, we fail.
+timeout indicates success. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delayexpr="'1s'"/>
+ </onentry>
+ <transition event="timeout" target="pass"/>
+ <transition event="childToParent" target="fail"/>
+ <transition event="done.invoke" target="fail"/>
+ <state id="s01">
+ <onentry>
+ <send event="foo"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <content>
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <state id="sub0">
+ <onentry>
+ <send event="timeout" delayexpr="'.5s'"/>
+ </onentry>
+ <transition event="timeout" target="subFinal"/>
+ <onexit>
+ <send target="#_parent" event="childToParent"/>
+ </onexit>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <!-- this transition will cause the invocation to be cancelled -->
+ <transition event="foo" target="s02"/>
+ </state>
+ <state id="s02"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test253.scxml b/test/w3c/jexl/test253.scxml
new file mode 100644
index 0000000..7d71a22
--- /dev/null
+++ b/test/w3c/jexl/test253.scxml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the scxml event processor is used in both directions. If child process uses the
+scxml event i/o processor to communicate with us, send it an event. It will send back success if
+this process uses the scxml processor to send the message to it, otherwise failure. For this test we allow
+'scxml' as an alternative to the full url. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <invoke type="scxml" id="foo">
+ <content>
+ <!-- inform parent we're running then wait for it to send us an event. If it uses the scxml event i/o
+ processor to do so, return success, otherwise return failure. -->
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var2"/>
+ </datamodel>
+ <state id="sub0">
+ <onentry>
+ <send target="#_parent" event="childRunning"/>
+ </onentry>
+ <transition event="parentToChild" target="sub1">
+ <assign location="Var2" expr="_event.origintype"/>
+ </transition>
+ </state>
+ <state id="sub1">
+ <transition cond="Var2=='http://www.w3.org/TR/scxml/#SCXMLEventProcessor'" target="subFinal">
+ <send target="#_parent" event="success"/>
+ </transition>
+ <transition cond="Var2=='scxml'" target="subFinal">
+ <send target="#_parent" event="success"/>
+ </transition>
+ <transition target="subFinal">
+ <send target="#_parent" event="failure"/>
+ </transition>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <state id="s01">
+ <transition event="childRunning" target="s02">
+ <assign location="Var1" expr="_event.origintype"/>
+ </transition>
+ </state>
+ <state id="s02">
+ <transition cond="Var1=='http://www.w3.org/TR/scxml/#SCXMLEventProcessor'" target="s03">
+ <send target="#_foo" event="parentToChild"/>
+ </transition>
+ <transition cond="Var1=='scxml'" target="s03">
+ <send target="#_foo" event="parentToChild"/>
+ </transition>
+ <transition target="fail"/>
+ </state>
+ <state id="s03">
+ <transition event="success" target="pass"/>
+ <transition event="fail" target="fail"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test276.scxml b/test/w3c/jexl/test276.scxml
new file mode 100644
index 0000000..d5c2095
--- /dev/null
+++ b/test/w3c/jexl/test276.scxml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that values passed in from parent process override default values specified in the child, test276sub1.scxml.
+The child returns event1 if var1 has value 1, event0 if it has default value 0. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <invoke type="scxml" src="file:test276sub1.scxml">
+ <param name="Var1" expr="1"/>
+ </invoke>
+ <transition event="event1" target="pass"/>
+ <transition event="event0" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test276sub1.scxml b/test/w3c/jexl/test276sub1.scxml
new file mode 100644
index 0000000..cd85fd3
--- /dev/null
+++ b/test/w3c/jexl/test276sub1.scxml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- define var1 with default value 0. Parent will invoke this process setting var1 = 1. Return event1 if var1 == 1, event0 otherwise -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0">
+ <transition cond="Var1==1" target="final">
+ <send target="#_parent" event="event1"/>
+ </transition>
+ <transition target="final">
+ <send target="#_parent" event="event0"/>
+ </transition>
+ </state>
+ <final id="final"/>
+</scxml>
diff --git a/test/w3c/jexl/test277.scxml b/test/w3c/jexl/test277.scxml
new file mode 100644
index 0000000..e43f9b5
--- /dev/null
+++ b/test/w3c/jexl/test277.scxml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that platform creates undound variable if we assign an illegal value to it. Thus
+ we can assign to it later in state s1. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="return"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error.execution" cond="typeof Var1 === 'undefined' " target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <assign location="Var1" expr="1"/>
+ </onentry>
+ <transition cond="Var1==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test278.scxml b/test/w3c/jexl/test278.scxml
new file mode 100644
index 0000000..79b6fbe
--- /dev/null
+++ b/test/w3c/jexl/test278.scxml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <!-- test that a variable can be accessed from a state that is outside its lexical scope -->
+ <state id="s0">
+ <transition cond="Var1==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s1">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test279.scxml b/test/w3c/jexl/test279.scxml
new file mode 100644
index 0000000..7a7142a
--- /dev/null
+++ b/test/w3c/jexl/test279.scxml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- testing that in case of early binding variables are assigned values at init time, before
+ the state containing them is visited -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <transition cond="Var1==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s1">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test280.scxml b/test/w3c/jexl/test280.scxml
new file mode 100644
index 0000000..0aef6dd
--- /dev/null
+++ b/test/w3c/jexl/test280.scxml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test late binding. var2 won't get bound until s1 is entered, so it shouldn't have a value in s0 and
+accessing it should cause an error. It should get bound before the onentry code in s1 so it should be
+possible access it there and assign its value to var1 -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl" binding="late">
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0">
+ <transition cond="typeof Var2 === 'undefined' " target="s1"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s1">
+ <datamodel>
+ <data id="Var2" expr="1"/>
+ </datamodel>
+ <onentry>
+ <assign location="Var1" expr="Var2"/>
+ </onentry>
+ <transition cond="Var1===Var2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test286.scxml b/test/w3c/jexl/test286.scxml
new file mode 100644
index 0000000..7a10d79
--- /dev/null
+++ b/test/w3c/jexl/test286.scxml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that assigment to a non-declared var causes an error. the transition on foo catches the case
+where no error is raised -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <state id="s0">
+ <onentry>
+ <assign location="foo.bar.baz " expr="1"/>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error.execution" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test287.scxml b/test/w3c/jexl/test287.scxml
new file mode 100644
index 0000000..f2bcb5a
--- /dev/null
+++ b/test/w3c/jexl/test287.scxml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- a simple test that a legal value may be assigned to a valid data model location -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" version="1.0" initial="s0">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="1"/>
+ </onentry>
+ <transition cond="Var1==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test288.scxml b/test/w3c/jexl/test288.scxml
new file mode 100644
index 0000000..818ee11
--- /dev/null
+++ b/test/w3c/jexl/test288.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- a simple test that a legal value may be assigned to a valid data model location
+using child content -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" version="1.0" initial="s0">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1">123</assign>
+ </onentry>
+ <transition cond="Var1 == 123" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test294.scxml b/test/w3c/jexl/test294.scxml
new file mode 100644
index 0000000..deedf09
--- /dev/null
+++ b/test/w3c/jexl/test294.scxml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that a param inside donedata ends up in the data field of the done event and
+that content inside donedata sets the full value of the event.data field -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0" initial="s01">
+ <transition event="done.state.s0" cond="_event.data['Var1']==1" target="s1">
+ </transition>
+ <transition event="done.state.s0" target="fail">
+ </transition>
+ <state id="s01">
+ <transition target="s02"/>
+ </state>
+ <final id="s02">
+ <donedata>
+ <param name="Var1" expr="1"/>
+ </donedata>
+ </final>
+ </state>
+ <state id="s1" initial="s11">
+ <transition event="done.state.s1" cond="_event.data == 'foo'" target="pass">
+ </transition>
+ <transition event="done.state.s1" target="fail">
+ </transition>
+ <state id="s11">
+ <transition target="s12"/>
+ </state>
+ <final id="s12">
+ <donedata>
+ <content>foo</content>
+ </donedata>
+ </final>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test298.scxml b/test/w3c/jexl/test298.scxml
new file mode 100644
index 0000000..de095b2
--- /dev/null
+++ b/test/w3c/jexl/test298.scxml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- reference a non-existent data model location in param in donedata and see that the right error is raised -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="error.execution" target="pass"/>
+ <transition event="*" target="fail"/>
+ <state id="s01">
+ <transition target="s02"/>
+ </state>
+ <final id="s02">
+ <donedata>
+ <param name="Var3" location="foo.bar.baz "/>
+ </donedata>
+ </final>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test301.scxml b/test/w3c/jexl/test301.scxml
new file mode 100644
index 0000000..0b2bd50
--- /dev/null
+++ b/test/w3c/jexl/test301.scxml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- the processor should reject this document because it can't download the script.
+Therefore we fail if it runs at all. This test is valid only for datamodels that support scripting -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0">
+ <script src="D:\foo"/>
+ <state id="s0">
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test302.scxml b/test/w3c/jexl/test302.scxml
new file mode 100644
index 0000000..63cedfe
--- /dev/null
+++ b/test/w3c/jexl/test302.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that a script is evaluated at load time. <conf:script> shoudl assign the value 1 to
+Var1. Hence, if script is evaluated at download time, Var1 has a value in the initial state s0.
+This test is valid only for datamodels that support scripting -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <script>var Var1 = 1</script>
+ <state id="s0">
+ <transition cond="Var1==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test303.scxml b/test/w3c/jexl/test303.scxml
new file mode 100644
index 0000000..9c329fa
--- /dev/null
+++ b/test/w3c/jexl/test303.scxml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- to test that scripts are run as part of executable content, we check that it changes the value of a var at the
+right point. This test is valid only for datamodels that support scripting -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="2"/>
+ <script>var Var1 = 1</script>
+ </onentry>
+ <transition cond="Var1==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test304.scxml b/test/w3c/jexl/test304.scxml
new file mode 100644
index 0000000..36e6e09
--- /dev/null
+++ b/test/w3c/jexl/test304.scxml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that a variable declared by a script can be accessed like any other part of the data model -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" version="1.0" initial="s0">
+ <script>var Var1 = 1</script>
+ <state id="s0">
+ <transition cond="Var1==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test307.scxml b/test/w3c/jexl/test307.scxml
new file mode 100644
index 0000000..12935f0
--- /dev/null
+++ b/test/w3c/jexl/test307.scxml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" version="1.0" initial="s0" binding="late">
+ <!-- with binding=late, in s0 we access a variable that isn't created until we get to s1. Then in s1
+we access a non-existent substructure of a variable. We use log tags to report the values that both operations
+yield, and whether there are errors. This is a manual test, since the tester must report whether the output
+is the same in the two cases -->
+ <state id="s0">
+ <onentry>
+ <log label="entering s0 value of Var 1 is: " expr="Var1"/>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error" target="s1">
+ <log label="error in state s0" expr="_event"/>
+ </transition>
+ <transition event="foo" target="s1">
+ <log label="no error in s0" expr=""/>
+ </transition>
+ </state>
+ <state id="s1">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <onentry>
+ <log label="entering s1, value of non-existent substructure of Var 1 is: " expr="Var1.bar"/>
+ <raise event="bar"/>
+ </onentry>
+ <transition event="error" target="final">
+ <log label="error in state s1" expr="_event"/>
+ </transition>
+ <transition event="bar" target="final">
+ <log label="No error in s1" expr=""/>
+ </transition>
+ </state>
+ <final id="final"/>
+</scxml>
diff --git a/test/w3c/jexl/test309.scxml b/test/w3c/jexl/test309.scxml
new file mode 100644
index 0000000..c7a2e2c
--- /dev/null
+++ b/test/w3c/jexl/test309.scxml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that an expression that cannot be interpreted as a boolean is treated as false -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <state id="s0">
+ <transition cond="return" target="fail"/>
+ <transition target="pass"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test310.scxml b/test/w3c/jexl/test310.scxml
new file mode 100644
index 0000000..73b758e
--- /dev/null
+++ b/test/w3c/jexl/test310.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- simple test of the in() predicate -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="p">
+ <parallel id="p">
+ <state id="s0">
+ <transition cond="In('s1')" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s1"/>
+ </parallel>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test311.scxml b/test/w3c/jexl/test311.scxml
new file mode 100644
index 0000000..b70fe77
--- /dev/null
+++ b/test/w3c/jexl/test311.scxml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that assignment to a non-existent location yields an error -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ <assign location="foo.bar.baz " expr="1"/>
+ </onentry>
+ <transition event="error.execution" target="pass"/>
+ <transition event=".*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test312.scxml b/test/w3c/jexl/test312.scxml
new file mode 100644
index 0000000..98593f6
--- /dev/null
+++ b/test/w3c/jexl/test312.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that assignment with an illegal expr raises an error -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="return"/>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error.execution" target="pass"/>
+ <transition event=".*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test313.scxml b/test/w3c/jexl/test313.scxml
new file mode 100644
index 0000000..9722f77
--- /dev/null
+++ b/test/w3c/jexl/test313.scxml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- this is a manual test. The processor is allowed to reject this doc, but if it executes it with its illegal
+expression, it must raise an error -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="return"/>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error.execution" target="pass"/>
+ <transition event=".*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test314.scxml b/test/w3c/jexl/test314.scxml
new file mode 100644
index 0000000..8265681
--- /dev/null
+++ b/test/w3c/jexl/test314.scxml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- this is a manual test because the processor is allowed to reject this document. But if it executes it,
+it should not raise an error until it gets to s03 and evaluates the illegal expr -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <state id="s0" initial="s01">
+ <transition event="error.execution" target="fail"/>
+ <state id="s01">
+ <transition target="s02"/>
+ </state>
+ <state id="s02">
+ <transition target="s03"/>
+ </state>
+ <state id="s03">
+ <onentry>
+ <assign location="Var1" expr="return"/>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error.execution" target="pass"/>
+ <transition event=".*" target="fail"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test318.scxml b/test/w3c/jexl/test318.scxml
new file mode 100644
index 0000000..58c5df1
--- /dev/null
+++ b/test/w3c/jexl/test318.scxml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that _event stays bound during the onexit and entry into the next state -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl" name="machineName">
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="foo" target="s1"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <raise event="bar"/>
+ <!-- _event should still be bound to 'foo' at this point -->
+ <assign location="Var1" expr="_event.name"/>
+ </onentry>
+ <transition cond="Var1=='foo'" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test319.scxml b/test/w3c/jexl/test319.scxml
new file mode 100644
index 0000000..ecdc7e6
--- /dev/null
+++ b/test/w3c/jexl/test319.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that _event is not bound before any event has been raised -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0" name="machineName">
+ <state id="s0">
+ <onentry>
+ <if cond="_event">
+ <raise event="bound"/>
+ <else/>
+ <raise event="unbound"/>
+ </if>
+ </onentry>
+ <transition event="unbound" target="pass"/>
+ <transition event="bound" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test321.scxml b/test/w3c/jexl/test321.scxml
new file mode 100644
index 0000000..a0e17d0
--- /dev/null
+++ b/test/w3c/jexl/test321.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that _sessionid is bound on startup -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0" name="machineName">
+ <datamodel>
+ <data id="Var1" expr="_sessionid"/>
+ </datamodel>
+ <state id="s0">
+ <transition cond="Var1" target="pass"/>
+ <transition cond="true" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test322.scxml b/test/w3c/jexl/test322.scxml
new file mode 100644
index 0000000..430f67d
--- /dev/null
+++ b/test/w3c/jexl/test322.scxml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that _sessionid remains bound to the same value throught the session. this means that it can't
+be assigned to -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0" name="machineName">
+ <datamodel>
+ <data id="Var1" expr="_sessionid"/>
+ <data id="Var2"/>
+ </datamodel>
+ <state id="s0">
+ <transition target="s1"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <assign location="_sessionid" expr="'otherName'"/>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error.execution" target="s2"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s2">
+ <transition cond="Var1==_sessionid" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test323.scxml b/test/w3c/jexl/test323.scxml
new file mode 100644
index 0000000..c4f7e24
--- /dev/null
+++ b/test/w3c/jexl/test323.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that _name is bound on startup -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl" name="machineName">
+ <datamodel>
+ <data id="Var1" expr="_name"/>
+ </datamodel>
+ <state id="s0">
+ <transition cond="Var1" target="pass"/>
+ <transition cond="true" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test324.scxml b/test/w3c/jexl/test324.scxml
new file mode 100644
index 0000000..d4364fd
--- /dev/null
+++ b/test/w3c/jexl/test324.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that _name stays bound till the session ends. This means that it cannot be assigned to -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl" name="machineName">
+ <state id="s0">
+ <transition cond="_name === 'machineName'" target="s1"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <assign location="_name" expr="'otherName'"/>
+ </onentry>
+ <transition cond="_name === 'machineName'" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test325.scxml b/test/w3c/jexl/test325.scxml
new file mode 100644
index 0000000..206a47d
--- /dev/null
+++ b/test/w3c/jexl/test325.scxml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that _ioprocessors is bound at startup. I'm not sure how to test for a set value or
+how to test that the entries in it do represent I/O processors, since the set that each implementation
+supports may be different. Suggestions welcome -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0" name="machineName">
+ <datamodel>
+ <data id="Var1" expr="_ioprocessors"/>
+ </datamodel>
+ <state id="s0">
+ <transition cond="Var1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test326.scxml b/test/w3c/jexl/test326.scxml
new file mode 100644
index 0000000..945c54b
--- /dev/null
+++ b/test/w3c/jexl/test326.scxml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that _ioprocessors stays bound till the session ends. This means that it cannot be assigned to -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0" name="machineName">
+ <datamodel>
+ <data id="Var1" expr="_ioprocessors"/>
+ <data id="Var2"/>
+ </datamodel>
+ <state id="s0">
+ <transition cond="Var1" target="s1"/>
+ <transition cond="true" target="fail"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <assign location="_ioprocessors" expr="'otherName'"/>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error.execution" target="s2"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s2">
+ <onentry>
+ <assign location="Var2" expr="_ioprocessors"/>
+ </onentry>
+ <transition cond="Var1==Var2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test329.scxml b/test/w3c/jexl/test329.scxml
new file mode 100644
index 0000000..0800e9b
--- /dev/null
+++ b/test/w3c/jexl/test329.scxml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that none of the system variables can be modified -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl" name="machineName">
+ <datamodel>
+ <data id="Var1"/>
+ <data id="Var2"/>
+ <data id="Var3"/>
+ <data id="Var4"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <!-- get _event bound so we can use it in s1-->
+ <raise event="foo"/>
+ <assign location="Var1" expr="_sessionid"/>
+ <assign location="_sessionid" expr="27"/>
+ </onentry>
+ <transition event="foo" cond="Var1==_sessionid" target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <assign location="Var2" expr="_event"/>
+ <assign location="_event" expr="27"/>
+ </onentry>
+ <transition cond="Var2==_event" target="s2"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s2">
+ <onentry>
+ <assign location="Var3" expr="_name"/>
+ <assign location="_name" expr="27"/>
+ </onentry>
+ <transition cond="Var3==_name" target="s3"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s3">
+ <onentry>
+ <assign location="Var4" expr="_ioprocessors"/>
+ <assign location="_ioprocessors" expr="27"/>
+ </onentry>
+ <transition cond="Var4==_ioprocessors" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test330.scxml b/test/w3c/jexl/test330.scxml
new file mode 100644
index 0000000..51236a6
--- /dev/null
+++ b/test/w3c/jexl/test330.scxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- check that the required fields are present in both internal and external events -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0" datamodel="jexl" name="machineName">
+ <state id="s0">
+ <onentry>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="foo" cond="'name' in _event &amp;&amp; 'type' in _event &amp;&amp; 'sendid' in _event &amp;&amp; 'origin' in _event &amp;&amp; 'origintype' in _event &amp;&amp; 'invokeid' in _event &amp;&amp; 'data' in _event" target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <send event="foo"/>
+ </onentry>
+ <transition event="foo" cond="'name' in _event &amp;&amp; 'type' in _event &amp;&amp; 'sendid' in _event &amp;&amp; 'origin' in _event &amp;&amp; 'origintype' in _event &amp;&amp; 'invokeid' in _event &amp;&amp; 'data' in _event" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test331.scxml b/test/w3c/jexl/test331.scxml
new file mode 100644
index 0000000..df41758
--- /dev/null
+++ b/test/w3c/jexl/test331.scxml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0" name="machineName">
+ <!-- test that _event.type is set correctly for internal, platform, and external events -->
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <!-- internal event -->
+ <raise event="foo"/>
+ </onentry>
+ <transition event="foo" target="s1">
+ <assign location="Var1" expr="_event.type"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var1=='internal'" target="s2"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s2">
+ <onentry>
+ <!-- this will generate an error, which is a platform event -->
+ <assign location="foo.bar.baz " expr="1"/>
+ </onentry>
+ <transition event="error" target="s3">
+ <assign location="Var1" expr="_event.type"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s3">
+ <transition cond="Var1=='platform'" target="s4"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s4">
+ <onentry>
+ <!-- external event -->
+ <send event="foo"/>
+ </onentry>
+ <transition event="foo" target="s5">
+ <assign location="Var1" expr="_event.type"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s5">
+ <transition cond="Var1=='external'" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test332.scxml b/test/w3c/jexl/test332.scxml
new file mode 100644
index 0000000..f1bd23b
--- /dev/null
+++ b/test/w3c/jexl/test332.scxml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that sendid is present in error events triggered by send errors -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0" datamodel="jexl" name="machineName">
+ <datamodel>
+ <data id="Var1"/>
+ <data id="Var2"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <!-- this will raise an error and also store the sendid in var1 -->
+ <send target="baz" event="foo" idlocation="Var1"/>
+ </onentry>
+ <transition event="error" target="s1">
+ <!-- get the sendid out of the error event -->
+ <assign location="Var2" expr="_event.sendid"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <!-- make sure that the sendid in the error event matches the one generated when send executed -->
+ <transition cond="Var1===Var2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test333.scxml b/test/w3c/jexl/test333.scxml
new file mode 100644
index 0000000..b516571
--- /dev/null
+++ b/test/w3c/jexl/test333.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- make sure sendid is blank in a non-error event -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0" datamodel="jexl" name="machineName">
+ <state id="s0">
+ <onentry>
+ <send event="foo"/>
+ </onentry>
+ <transition event="foo" cond="typeof _event.sendid === 'undefined' " target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test335.scxml b/test/w3c/jexl/test335.scxml
new file mode 100644
index 0000000..04b4804
--- /dev/null
+++ b/test/w3c/jexl/test335.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that origin field is blank for internal events -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0" datamodel="jexl" name="machineName">
+ <state id="s0">
+ <onentry>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="foo" cond="typeof _event.origin === 'undefined' " target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test336.scxml b/test/w3c/jexl/test336.scxml
new file mode 100644
index 0000000..35aa550
--- /dev/null
+++ b/test/w3c/jexl/test336.scxml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the origin field of an external event contains a URL that lets you send back to the originator. In
+this case it's the same session, so if we get bar we succeed -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0" name="machineName">
+ <state id="s0">
+ <onentry>
+ <send event="foo"/>
+ </onentry>
+ <transition event="foo" target="s1">
+ <send event="bar" targetexpr="_event.origin" typeexpr="_event.origintype"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <send event="baz"/>
+ </onentry>
+ <transition event="bar" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test337.scxml b/test/w3c/jexl/test337.scxml
new file mode 100644
index 0000000..43f65a8
--- /dev/null
+++ b/test/w3c/jexl/test337.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that origintype is blank on internal events -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0" name="machineName">
+ <state id="s0">
+ <onentry>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="foo" cond="typeof _event.origintype === 'undefined' " target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test338.scxml b/test/w3c/jexl/test338.scxml
new file mode 100644
index 0000000..572e0a9
--- /dev/null
+++ b/test/w3c/jexl/test338.scxml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that invokeid is set correctly in events received from an invoked process. timeout event catches the
+case where the invoke doesn't work correctly -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1"/>
+ <data id="Var2"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <invoke idlocation="Var1" type="http://www.w3.org/TR/scxml/">
+ <content>
+ <scxml initial="sub0" version="1.0" datamodel="jexl" name="machineName">
+ <final id="sub0">
+ <onentry>
+ <send target="#_parent" event="event1"/>
+ </onentry>
+ </final>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="event1" target="s1">
+ <assign location="Var2" expr="_event.invokeid"/>
+ </transition>
+ <transition event="event0" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var1===Var2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test339.scxml b/test/w3c/jexl/test339.scxml
new file mode 100644
index 0000000..3f25385
--- /dev/null
+++ b/test/w3c/jexl/test339.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that invokeid is blank in an event that wasn't returned from an invoked process -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl" name="machineName">
+ <state id="s0">
+ <onentry>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="foo" cond="typeof _event.invokeid === 'undefined' " target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test342.scxml b/test/w3c/jexl/test342.scxml
new file mode 100644
index 0000000..b6f48ee
--- /dev/null
+++ b/test/w3c/jexl/test342.scxml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that eventexpr works and sets the name field of the resulting event -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl" name="machineName">
+ <datamodel>
+ <data id="Var1" expr="'foo'"/>
+ <data id="Var2"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send eventexpr="Var1"/>
+ </onentry>
+ <transition event="foo" target="s1">
+ <assign location="Var2" expr="_event.name"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var1===Var2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test343.scxml b/test/w3c/jexl/test343.scxml
new file mode 100644
index 0000000..a944e15
--- /dev/null
+++ b/test/w3c/jexl/test343.scxml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that illegal <param> produces error.execution and empty event.data -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <state id="s0" initial="s01">
+ <!-- we should get the error before the done event -->
+ <transition event="error.execution" target="s1"/>
+ <transition event="done.state.s0" target="fail"/>
+ <transition event="done.state.s0" target="fail">
+ </transition>
+ <state id="s01">
+ <transition target="s02"/>
+ </state>
+ <final id="s02">
+ <donedata>
+ <param location="foo.bar.baz " name="someParam"/>
+ </donedata>
+ </final>
+ </state>
+ <!-- if we get here, we received the error event. Now check that the done
+ event has empty event.data -->
+ <state id="s1">
+ <transition event="done.state.s0" cond="typeof _event.data === 'undefined'" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test344.scxml b/test/w3c/jexl/test344.scxml
new file mode 100644
index 0000000..b5461a6
--- /dev/null
+++ b/test/w3c/jexl/test344.scxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that a cond expression that cannot be evaluated as a
+boolean cond expression evaluates to false and causes error.execution to be raised.
+In some languages, any valid expression/object can be converted to a boolean, so conf:nonBoolean will
+have to be mapped onto something that produces a syntax error or something similarly invalid -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <state id="s0">
+ <transition cond="return" target="fail"/>
+ <transition target="s1"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error.execution" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test346.scxml b/test/w3c/jexl/test346.scxml
new file mode 100644
index 0000000..18950cd
--- /dev/null
+++ b/test/w3c/jexl/test346.scxml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that any attempt to change the value of a system variable causes error.execution to be raised.
+Event1..4 are there to catch the case where the error event is not raised. In cases where it is, we have
+to dispose of eventn in the next state, hence the targetless transitions (which simply throw away the event.) -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl" name="machineName">
+ <state id="s0">
+ <onentry>
+ <assign location="_sessionid" expr="'otherName'"/>
+ <raise event="event1"/>
+ </onentry>
+ <transition event="error.execution" target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <assign location="_event" expr="'otherName'"/>
+ <raise event="event2"/>
+ </onentry>
+ <!-- throw out event1 if it's still around -->
+ <transition event="event1"/>
+ <transition event="error.execution" target="s2"/>
+ <!-- event1 would trigger this transition if we didn't drop it. We want this transition to have
+ a very general trigger to catch cases where the wrong error event was raised -->
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s2">
+ <onentry>
+ <assign location="_ioprocessors" expr="'otherName'"/>
+ <raise event="event3"/>
+ </onentry>
+ <transition event="event2"/>
+ <transition event="error.execution" target="s3"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s3">
+ <onentry>
+ <assign location="_name" expr="'otherName'"/>
+ <raise event="event4"/>
+ </onentry>
+ <transition event="event3"/>
+ <transition event="error.execution" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test347.scxml b/test/w3c/jexl/test347.scxml
new file mode 100644
index 0000000..3330094
--- /dev/null
+++ b/test/w3c/jexl/test347.scxml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the scxml event I/O processor works by sending events back and forth between an invoked child
+and its parent process -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0" initial="s01">
+ <invoke id="child" type="scxml">
+ <content>
+ <scxml initial="sub0" version="1.0" datamodel="jexl" name="machineName">
+ <state id="sub0">
+ <onentry>
+ <send type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" target="#_parent" event="childToParent"/>
+ </onentry>
+ <transition event="parentToChild" target="subFinal"/>
+ </state>
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <onentry>
+ <send delay="20s" event="timeout"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <state id="s01">
+ <transition event="childToParent" target="s02"/>
+ </state>
+ <state id="s02">
+ <onentry>
+ <send type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" target="#_child" event="parentToChild"/>
+ </onentry>
+ <transition event="done.invoke" target="pass"/>
+ <transition event="error" target="fail"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test348.scxml b/test/w3c/jexl/test348.scxml
new file mode 100644
index 0000000..c29c609
--- /dev/null
+++ b/test/w3c/jexl/test348.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <!-- test that event param of send sets the name of the event -->
+ <state id="s0">
+ <onentry>
+ <send type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" event="s0Event"/>
+ </onentry>
+ <transition event="s0Event" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test349.scxml b/test/w3c/jexl/test349.scxml
new file mode 100644
index 0000000..0fe79e8
--- /dev/null
+++ b/test/w3c/jexl/test349.scxml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that value in origin field can be used to send an event back to the sender -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" event="s0Event"/>
+ </onentry>
+ <transition event="s0Event" target="s2">
+ <assign location="Var1" expr="_event.origin"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s2">
+ <onentry>
+ <send type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" targetexpr="Var1" event="s0Event2"/>
+ </onentry>
+ <transition event="s0Event2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test350.scxml b/test/w3c/jexl/test350.scxml
new file mode 100644
index 0000000..6a32e27
--- /dev/null
+++ b/test/w3c/jexl/test350.scxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that target value is used to decide what session to deliver the event to. A session should be
+able to send an event to itself using its own session ID as the target -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="'#_scxml_'"/>
+ <data id="Var2" expr="_sessionid"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="Var1 + Var2"/>
+ <send delay="5s" event="timeout"/>
+ <send type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" targetexpr="Var1" event="s0Event"/>
+ </onentry>
+ <transition event="s0Event" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test351.scxml b/test/w3c/jexl/test351.scxml
new file mode 100644
index 0000000..42303b7
--- /dev/null
+++ b/test/w3c/jexl/test351.scxml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that sendid is set in event if present in send, blank otherwise -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1"/>
+ <data id="Var2"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send delay="5s" event="timeout"/>
+ <send type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" id="send1" event="s0Event"/>
+ </onentry>
+ <transition event="s0Event" target="s1">
+ <assign location="Var1" expr="_event.sendid"/>
+ </transition>
+ <transition event="*" target="fail">
+ </transition>
+ </state>
+ <state id="s1">
+ <transition cond="Var1=='send1'" target="s2"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s2">
+ <onentry>
+ <send delay="5s" event="timeout"/>
+ <send event="s0Event2"/>
+ </onentry>
+ <transition event="s0Event2" target="s3">
+ <assign location="Var2" expr="_event.sendid"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s3">
+ <transition cond="!Var2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test352.scxml b/test/w3c/jexl/test352.scxml
new file mode 100644
index 0000000..87172f1
--- /dev/null
+++ b/test/w3c/jexl/test352.scxml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test the origintype is 'http://www.w3.org/TR/scxml/#SCXMLEventProcessor' -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send delay="5s" event="timeout"/>
+ <send type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" event="s0Event"/>
+ </onentry>
+ <transition event="s0Event" target="s1">
+ <assign location="Var1" expr="_event.origintype"/>
+ </transition>
+ <transition event="*" target="fail">
+ </transition>
+ </state>
+ <state id="s1">
+ <transition cond="Var1=='http://www.w3.org/TR/scxml/#SCXMLEventProcessor'" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test354.scxml b/test/w3c/jexl/test354.scxml
new file mode 100644
index 0000000..08c3e95
--- /dev/null
+++ b/test/w3c/jexl/test354.scxml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that event.data can be populated using both namelist, param and <content>
+and that correct values are used -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ <data id="Var2"/>
+ <data id="Var3"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send delay="5s" event="timeout"/>
+ <send event="event1" type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" namelist="Var1">
+ <param name="param1" expr="2"/>
+ </send>
+ </onentry>
+ <transition event="event1" target="s1">
+ <assign location="Var2" expr="_event.data.Var1"/>
+ <assign location="Var3" expr="_event.data.param1"/>
+ </transition>
+ <transition event="*" target="fail">
+ </transition>
+ </state>
+ <state id="s1">
+ <transition cond="Var2==1" target="s2"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s2">
+ <transition cond="Var3==2" target="s3"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s3">
+ <onentry>
+ <send delay="5s" event="timeout"/>
+ <send event="event2">
+ <content>123</content>
+ </send>
+ </onentry>
+ <transition event="event2" cond="_event.data == 123" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test355.scxml b/test/w3c/jexl/test355.scxml
new file mode 100644
index 0000000..86903e6
--- /dev/null
+++ b/test/w3c/jexl/test355.scxml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that default initial state is first in document order. If we enter s0 first we succeed, if s1, failure. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <transition target="pass"/>
+ </state>
+ <state id="s1">
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test364.scxml b/test/w3c/jexl/test364.scxml
new file mode 100644
index 0000000..5696a34
--- /dev/null
+++ b/test/w3c/jexl/test364.scxml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that default initial states are entered when a compound state is entered. First we test
+the 'initial' attribute, then the initial element, then default to the first child in document order.
+If we get to s01111 we succeed, if any other state, failure. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" initial="s1" version="1.0">
+ <state id="s1" initial="s11p112 s11p122">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <state id="s11" initial="s111">
+ <state id="s111"/>
+ <parallel id="s11p1">
+ <state id="s11p11" initial="s11p111">
+ <state id="s11p111"/>
+ <state id="s11p112">
+ <onentry>
+ <raise event="In-s11p112"/>
+ </onentry>
+ </state>
+ </state>
+ <state id="s11p12" initial="s11p121">
+ <state id="s11p121"/>
+ <state id="s11p122">
+ <transition event="In-s11p112" target="s2"/>
+ </state>
+ </state>
+ </parallel>
+ </state>
+ </state>
+ <state id="s2">
+ <initial>
+ <transition target="s21p112 s21p122"/>
+ </initial>
+ <transition event="timeout" target="fail"/>
+ <state id="s21" initial="s211">
+ <state id="s211"/>
+ <parallel id="s21p1">
+ <state id="s21p11" initial="s21p111">
+ <state id="s21p111"/>
+ <state id="s21p112">
+ <onentry>
+ <raise event="In-s21p112"/>
+ </onentry>
+ </state>
+ </state>
+ <state id="s21p12" initial="s21p121">
+ <state id="s21p121"/>
+ <state id="s21p122">
+ <transition event="In-s21p112" target="s3"/>
+ </state>
+ </state>
+ </parallel>
+ </state>
+ </state>
+ <state id="s3">
+ <transition target="fail"/>
+ <state id="s31">
+ <state id="s311">
+ <state id="s3111">
+ <transition target="pass"/>
+ </state>
+ <state id="s3112"/>
+ <state id="s312"/>
+ <state id="s32"/>
+ </state>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test372.scxml b/test/w3c/jexl/test372.scxml
new file mode 100644
index 0000000..bab2403
--- /dev/null
+++ b/test/w3c/jexl/test372.scxml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that entering a final state generates done.state.parentid after executing the onentry elements.
+Var1 should be set to 2 (but not 3) by the time the event is raised -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <state id="s0" initial="s0final">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="done.state.s0" cond="Var1==2" target="pass"/>
+ <transition event="*" target="fail"/>
+ <final id="s0final">
+ <onentry>
+ <assign location="Var1" expr="2"/>
+ </onentry>
+ <onexit>
+ <assign location="Var1" expr="3"/>
+ </onexit>
+ </final>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test375.scxml b/test/w3c/jexl/test375.scxml
new file mode 100644
index 0000000..5973775
--- /dev/null
+++ b/test/w3c/jexl/test375.scxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that onentry handlers are executed in document order. event1 should be raised before event2 -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <raise event="event1"/>
+ </onentry>
+ <onentry>
+ <raise event="event2"/>
+ </onentry>
+ <transition event="event1" target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition event="event2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test376.scxml b/test/w3c/jexl/test376.scxml
new file mode 100644
index 0000000..49e0eef
--- /dev/null
+++ b/test/w3c/jexl/test376.scxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that each onentry handler is a separate block. The <send> of event1 will cause an error but
+ the increment to var1 should happen anyways -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send target="baz" event="event1"/>
+ </onentry>
+ <onentry>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onentry>
+ <transition cond="Var1==2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test377.scxml b/test/w3c/jexl/test377.scxml
new file mode 100644
index 0000000..d3ce112
--- /dev/null
+++ b/test/w3c/jexl/test377.scxml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that onexit handlers are executed in document order. event1 should be raised before event2 -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onexit>
+ <raise event="event1"/>
+ </onexit>
+ <onexit>
+ <raise event="event2"/>
+ </onexit>
+ <transition target="s1"/>
+ </state>
+ <state id="s1">
+ <transition event="event1" target="s2"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s2">
+ <transition event="event2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test378.scxml b/test/w3c/jexl/test378.scxml
new file mode 100644
index 0000000..f7453f0
--- /dev/null
+++ b/test/w3c/jexl/test378.scxml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that each onexithandler is a separate block. The <send> of event1 will cause an error but
+ the increment to var1 should happen anyways -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <state id="s0">
+ <onexit>
+ <send target="baz" event="event1"/>
+ </onexit>
+ <onexit>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onexit>
+ <transition target="s1"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var1==2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test387.scxml b/test/w3c/jexl/test387.scxml
new file mode 100644
index 0000000..a064f12
--- /dev/null
+++ b/test/w3c/jexl/test387.scxml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the default history state works correctly. From initial state s3 we take a transition to s0's default
+shallow history state. That should generate "enteringS011", which takes us to s4. In s4, we
+transition to s1's default deep history state. We should end up in s122, generating "enteringS122". Otherwise failure.-->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s3" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <transition event="enteringS011" target="s4"/>
+ <transition event="*" target="fail"/>
+ <history type="shallow" id="s0HistShallow">
+ <transition target="s01"/>
+ </history>
+ <history type="deep" id="s0HistDeep">
+ <transition target="s022"/>
+ </history>
+ <state id="s01" initial="s011">
+ <state id="s011">
+ <onentry>
+ <raise event="enteringS011"/>
+ </onentry>
+ </state>
+ <state id="s012">
+ <onentry>
+ <raise event="enteringS012"/>
+ </onentry>
+ </state>
+ </state>
+ <state id="s02" initial="s021">
+ <state id="s021">
+ <onentry>
+ <raise event="enteringS021"/>
+ </onentry>
+ </state>
+ <state id="s022">
+ <onentry>
+ <raise event="enteringS022"/>
+ </onentry>
+ </state>
+ </state>
+ </state>
+ <state id="s1" initial="s11">
+ <transition event="enteringS122" target="pass"/>
+ <transition event="*" target="fail"/>
+ <history type="shallow" id="s1HistShallow">
+ <transition target="s11"/>
+ </history>
+ <history type="deep" id="s1HistDeep">
+ <transition target="s122"/>
+ </history>
+ <state id="s11" initial="s111">
+ <state id="s111">
+ <onentry>
+ <raise event="enteringS111"/>
+ </onentry>
+ </state>
+ <state id="s112">
+ <onentry>
+ <raise event="enteringS112"/>
+ </onentry>
+ </state>
+ </state>
+ <state id="s12" initial="s121">
+ <state id="s121">
+ <onentry>
+ <raise event="enteringS121"/>
+ </onentry>
+ </state>
+ <state id="s122">
+ <onentry>
+ <raise event="enteringS122"/>
+ </onentry>
+ </state>
+ </state>
+ </state>
+ <state id="s3">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition target="s0HistShallow"/>
+ </state>
+ <state id="s4">
+ <transition target="s1HistDeep"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test388.scxml b/test/w3c/jexl/test388.scxml
new file mode 100644
index 0000000..e22798e
--- /dev/null
+++ b/test/w3c/jexl/test388.scxml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that history states works correctly. The counter Var1 counts how many times
+we have entered s0. The initial state is s012. We then transition to s1, which transitions
+to s0's deep history state. entering.s012 should be raised, otherwise failure. Then we transition
+to s02, which transitions to s0's shallow history state. That should have value s01, and its initial
+state is s011, so we should get entering.s011, otherwise failure.-->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s012" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0" initial="s01">
+ <onentry>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onentry>
+ <!-- the first time through, go to s1, setting a timer just in case something hangs -->
+ <transition event="entering.s012" cond="Var1==1" target="s1">
+ <send event="timeout" delay="2s"/>
+ </transition>
+ <!-- the second time, we should get entering.s012. If so, go to s2, otherwise fail -->
+ <transition event="entering.s012" cond="Var1==2" target="s2"/>
+ <transition event="entering" cond="Var1==2" target="fail"/>
+ <!-- the third time we should get entering-s011. If so, pass, otherwise fail -->
+ <transition event="entering.s011" cond="Var1==3" target="pass"/>
+ <transition event="entering" cond="Var1==3" target="fail"/>
+ <!-- if we timeout, the state machine is hung somewhere, so fail -->
+ <transition event="timeout" target="fail"/>
+ <history type="shallow" id="s0HistShallow">
+ <transition target="s02"/>
+ </history>
+ <history type="deep" id="s0HistDeep">
+ <transition target="s022"/>
+ </history>
+ <state id="s01" initial="s011">
+ <state id="s011">
+ <onentry>
+ <raise event="entering.s011"/>
+ </onentry>
+ </state>
+ <state id="s012">
+ <onentry>
+ <raise event="entering.s012"/>
+ </onentry>
+ </state>
+ </state>
+ <state id="s02" initial="s021">
+ <state id="s021">
+ <onentry>
+ <raise event="entering.s021"/>
+ </onentry>
+ </state>
+ <state id="s022">
+ <onentry>
+ <raise event="entering.s022"/>
+ </onentry>
+ </state>
+ </state>
+ </state>
+ <state id="s1">
+ <transition target="s0HistDeep"/>
+ </state>
+ <state id="s2">
+ <transition target="s0HistShallow"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test396.scxml b/test/w3c/jexl/test396.scxml
new file mode 100644
index 0000000..ae5fc21
--- /dev/null
+++ b/test/w3c/jexl/test396.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the value in _event.name matches the event name used to match against transitions -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="foo" cond="_event.name == 'foo'" target="pass"/>
+ <transition event="foo" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test399.scxml b/test/w3c/jexl/test399.scxml
new file mode 100644
index 0000000..1e68d10
--- /dev/null
+++ b/test/w3c/jexl/test399.scxml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the event name matching works correctly, including prefix matching and the fact
+that the event attribute of transition may contain multiple event designators. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <!-- this will catch the failure case -->
+ <transition event="timeout" target="fail"/>
+ <state id="s01">
+ <onentry>
+ <raise event="foo"/>
+ </onentry>
+ <!-- test that an event can match against a transition with multiple descriptors -->
+ <transition event="foo bar" target="s02"/>
+ </state>
+ <state id="s02">
+ <onentry>
+ <raise event="bar"/>
+ </onentry>
+ <!-- test that an event can match the second descriptor as well -->
+ <transition event="foo bar" target="s03"/>
+ </state>
+ <state id="s03">
+ <onentry>
+ <raise event="foo.zoo"/>
+ </onentry>
+ <!-- test that a prefix descriptor matches -->
+ <transition event="foo bar" target="s04"/>
+ </state>
+ <state id="s04">
+ <onentry>
+ <raise event="foos"/>
+ </onentry>
+ <!-- test that only token prefixes match -->
+ <transition event="foo" target="fail"/>
+ <transition event="foos" target="s05"/>
+ </state>
+ <state id="s05">
+ <onentry>
+ <raise event="foo.zoo"/>
+ </onentry>
+ <!-- test that .* works at the end of a descriptor -->
+ <transition event="foo.*" target="s06"/>
+ </state>
+ <state id="s06">
+ <onentry>
+ <raise event="foo"/>
+ </onentry>
+ <!-- test that "*" works by itself -->
+ <transition event="*" target="pass"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test401.scxml b/test/w3c/jexl/test401.scxml
new file mode 100644
index 0000000..8af8a1c
--- /dev/null
+++ b/test/w3c/jexl/test401.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that errors go in the internal event queue. We send ourselves an external event foo, then perform
+and operation that raises an error. Then check that the error event is processed first, even though
+it was raised second -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="foo"/>
+ <!-- assigning to a non-existent location should raise an error -->
+ <assign location="foo.bar.baz " expr="2"/>
+ </onentry>
+ <transition event="foo" target="fail"/>
+ <transition event="error" target="pass"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test402.scxml b/test/w3c/jexl/test402.scxml
new file mode 100644
index 0000000..09ebafc
--- /dev/null
+++ b/test/w3c/jexl/test402.scxml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- the assertion that errors are 'like any other event' is pretty broad, but we can check that they
+are pulled off the internal queue in order, and that prefix matching works on them. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <!-- catch the failure case -->
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <state id="s01">
+ <onentry>
+ <!-- the first internal event. The error will be the second, and event2 will be the third -->
+ <raise event="event1"/>
+ <!-- assigning to a non-existent location should raise an error -->
+ <assign location="foo.bar.baz " expr="2"/>
+ </onentry>
+ <transition event="event1" target="s02">
+ <raise event="event2"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s02">
+ <transition event="error" target="s03"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s03">
+ <transition event="event2" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test403a.scxml b/test/w3c/jexl/test403a.scxml
new file mode 100644
index 0000000..e9c2c2d
--- /dev/null
+++ b/test/w3c/jexl/test403a.scxml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test one part of 'optimal enablement' meaning that of all transitions that are enabled, we chose the ones
+in child states over parent states, and use document order to break ties. We have
+a parent state s0 with two children, s01 and s02. In s01, we test that a) if
+a transition in the child matches, we don't consider matches in the parent and b)
+that if two transitions match in any state, we take the first in document order.
+In s02 we test that we take a transition in the parent if there is no
+matching transition in the child. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <!-- catch the failure case -->
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <transition event="event1" target="fail"/>
+ <transition event="event2" target="pass"/>
+ <state id="s01">
+ <onentry>
+ <!-- this should be caught by the first transition in this state, taking us to S02 -->
+ <raise event="event1"/>
+ </onentry>
+ <transition event="event1" target="s02"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s02">
+ <onentry>
+ <!-- since the local transition has a cond that evaluates to false this should be caught by a
+ transition in the parent state, taking us to pass -->
+ <raise event="event2"/>
+ </onentry>
+ <transition event="event1" target="fail"/>
+ <transition event="event2" cond="false" target="fail"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test403b.scxml b/test/w3c/jexl/test403b.scxml
new file mode 100644
index 0000000..86c589e
--- /dev/null
+++ b/test/w3c/jexl/test403b.scxml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that 'optimally enabled set' really is a set, specifically that if a transition is optimally enabled in
+two different states, it is taken only once. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0" initial="p0">
+ <!-- this transition should never be taken because a transition in a lower state should
+ always be selected -->
+ <transition event="event1">
+ <assign location="Var1" expr="Var1 + 1"/>
+ </transition>
+ <parallel id="p0">
+ <onentry>
+ <raise event="event1"/>
+ <raise event="event2"/>
+ </onentry>
+ <!-- this transition will be selected by both states p0s1 and p0s2, but should be executed only once -->
+ <transition event="event1">
+ <assign location="Var1" expr="Var1 + 1"/>
+ </transition>
+ <state id="p0s1">
+ <transition event="event2" cond="Var1==1" target="pass"/>
+ <transition event="event2" target="fail"/>
+ </state>
+ <state id="p0s2"/>
+ </parallel>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test403c.scxml b/test/w3c/jexl/test403c.scxml
new file mode 100644
index 0000000..c2402f1
--- /dev/null
+++ b/test/w3c/jexl/test403c.scxml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test 'optimally enabled set', specifically that preemption works correctly -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0" initial="p0">
+ <onentry>
+ <raise event="event1"/>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="event2" target="fail"/>
+ <transition event="timeout" target="fail"/>
+ <parallel id="p0">
+ <state id="p0s1">
+ <transition event="event1"/>
+ <transition event="event2"/>
+ </state>
+ <state id="p0s2">
+ <transition event="event1" target="p0s1">
+ <raise event="event2"/>
+ </transition>
+ </state>
+ <state id="p0s3">
+ <!-- this transition should be blocked by the one in p0s2-->
+ <transition event="event1" target="fail"/>
+ <!-- this transition will preempt the one that p0s2 inherits
+ from an ancestor -->
+ <transition event="event2" target="s1"/>
+ </state>
+ <state id="p0s4">
+ <!-- this transition never gets preempted, should fire twice -->
+ <transition event="*">
+ <assign location="Var1" expr="Var1 + 1"/>
+ </transition>
+ </state>
+ </parallel>
+ </state>
+ <state id="s1">
+ <transition cond="Var1==2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test404.scxml b/test/w3c/jexl/test404.scxml
new file mode 100644
index 0000000..387700a
--- /dev/null
+++ b/test/w3c/jexl/test404.scxml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that states are exited in exit order (children before parents with reverse doc order used to break ties
+ before the executable content in the transitions. event1, event2, event3, event4 should be raised in that
+ order when s01p is exited -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01p">
+ <parallel id="s01p">
+ <onexit>
+ <!-- this should be the 3rd event raised -->
+ <raise event="event3"/>
+ </onexit>
+ <transition target="s02">
+ <!-- this should be the fourth event raised -->
+ <raise event="event4"/>
+ </transition>
+ <state id="s01p1">
+ <onexit>
+ <!-- this should be the second event raised -->
+ <raise event="event2"/>
+ </onexit>
+ </state>
+ <state id="s01p2">
+ <!-- this should be the first event raised -->
+ <onexit>
+ <raise event="event1"/>
+ </onexit>
+ </state>
+ </parallel>
+ <state id="s02">
+ <transition event="event1" target="s03"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s03">
+ <transition event="event2" target="s04"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s04">
+ <transition event="event3" target="s05"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s05">
+ <transition event="event4" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test405.scxml b/test/w3c/jexl/test405.scxml
new file mode 100644
index 0000000..3190d7d
--- /dev/null
+++ b/test/w3c/jexl/test405.scxml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the executable content in the transitions is executed in document order after
+the states are exited. event1, event2, event3, event4 should be raised in that order when the
+state machine is entered -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01p">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <parallel id="s01p">
+ <transition event="event1" target="s02"/>
+ <state id="s01p1" initial="s01p11">
+ <state id="s01p11">
+ <onexit>
+ <!-- this should be the second event raised -->
+ <raise event="event2"/>
+ </onexit>
+ <transition target="s01p12">
+ <!-- this should be the third event raised -->
+ <raise event="event3"/>
+ </transition>
+ </state>
+ <state id="s01p12"/>
+ </state>
+ <!-- end s01p1 -->
+ <state id="s01p2" initial="s01p21">
+ <state id="s01p21">
+ <onexit>
+ <!-- this should be the first event raised -->
+ <raise event="event1"/>
+ </onexit>
+ <transition target="s01p22">
+ <!-- this should be the fourth event raised -->
+ <raise event="event4"/>
+ </transition>
+ </state>
+ <state id="s01p22"/>
+ </state>
+ <!-- end s01p2 -->
+ </parallel>
+ <state id="s02">
+ <transition event="event2" target="s03"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s03">
+ <transition event="event3" target="s04"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s04">
+ <transition event="event4" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ </state>
+ <!-- end s01 -->
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test406.scxml b/test/w3c/jexl/test406.scxml
new file mode 100644
index 0000000..b45362f
--- /dev/null
+++ b/test/w3c/jexl/test406.scxml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Test that states are entered in entry order (parents before children with document order used to break ties)
+after the executable content in the transition is executed. event1, event2, event3, event4 should be raised in that
+order when the transition in s01 is taken -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <state id="s01">
+ <transition target="s0p2">
+ <!-- this should be the first event raised -->
+ <raise event="event1"/>
+ </transition>
+ </state>
+ <parallel id="s0p2">
+ <transition event="event1" target="s03"/>
+ <state id="s01p21">
+ <onentry>
+ <!-- third event -->
+ <raise event="event3"/>
+ </onentry>
+ </state>
+ <state id="s01p22">
+ <onentry>
+ <!-- the fourth event -->
+ <raise event="event4"/>
+ </onentry>
+ </state>
+ <onentry>
+ <!-- this should be the second event raised -->
+ <raise event="event2"/>
+ </onentry>
+ </parallel>
+ <state id="s03">
+ <transition event="event2" target="s04"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s04">
+ <transition event="event3" target="s05"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s05">
+ <transition event="event4" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ </state>
+ <!-- end s0 -->
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test407.scxml b/test/w3c/jexl/test407.scxml
new file mode 100644
index 0000000..f19da29
--- /dev/null
+++ b/test/w3c/jexl/test407.scxml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- a simple test that onexit handlers work. var1 should be incremented when we leave s0 -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s0">
+ <onexit>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onexit>
+ <transition target="s1"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var1==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test409.scxml b/test/w3c/jexl/test409.scxml
new file mode 100644
index 0000000..39fe294
--- /dev/null
+++ b/test/w3c/jexl/test409.scxml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that states are removed from the active states list as they are exited. When s01's onexit handler
+fires, s011 should not be on the active state list, so in(S011) should be false, and event1 should not
+be raised. Therefore the timeout should fire to indicate success -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delayexpr="'1s'"/>
+ </onentry>
+ <transition event="timeout" target="pass"/>
+ <transition event="event1" target="fail"/>
+ <state id="s01" initial="s011">
+ <onexit>
+ <if cond="In('s011')">
+ <raise event="event1"/>
+ </if>
+ </onexit>
+ <state id="s011">
+ <transition target="s02"/>
+ </state>
+ </state>
+ <!-- end s01 -->
+ <state id="s02"/>
+ </state>
+ <!-- end s0 -->
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test411.scxml b/test/w3c/jexl/test411.scxml
new file mode 100644
index 0000000..559c253
--- /dev/null
+++ b/test/w3c/jexl/test411.scxml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that states are added to the active states list as they are entered and before onentry handlers
+are executed. When s0's onentry handler fires we should not be in s01. But when s01's onentry handler
+fires, we should be in s01. Therefore event1 should not fire, but event2 should. Either event1 or
+timeout also indicates failure -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ <if cond="In('s01')">
+ <raise event="event1"/>
+ </if>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <transition event="event1" target="fail"/>
+ <transition event="event2" target="pass"/>
+ <state id="s01">
+ <onentry>
+ <if cond="In('s01')">
+ <raise event="event2"/>
+ </if>
+ </onentry>
+ </state>
+ </state>
+ <!-- end s0 -->
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test412.scxml b/test/w3c/jexl/test412.scxml
new file mode 100644
index 0000000..48836f8
--- /dev/null
+++ b/test/w3c/jexl/test412.scxml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that executable content in the <initial> transition executes after the onentry handler on the state
+and before the onentry handler of the child states. Event1, event2, and event3 should occur in that order. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0" initial="s01">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <transition event="event1" target="fail"/>
+ <transition event="event2" target="pass"/>
+ <state id="s01">
+ <onentry>
+ <raise event="event1"/>
+ </onentry>
+ <initial>
+ <transition target="s011">
+ <raise event="event2"/>
+ </transition>
+ </initial>
+ <state id="s011">
+ <onentry>
+ <raise event="event3"/>
+ </onentry>
+ <transition target="s02"/>
+ </state>
+ </state>
+ <state id="s02">
+ <transition event="event1" target="s03"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s03">
+ <transition event="event2" target="s04"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s04">
+ <transition event="event3" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ </state>
+ <!-- end s0 -->
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test413.scxml b/test/w3c/jexl/test413.scxml
new file mode 100644
index 0000000..3fc208a
--- /dev/null
+++ b/test/w3c/jexl/test413.scxml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the state machine is put into the configuration specified by the initial element, without regard
+to any other defaults. we should start off in s2p111 and s2p122. the atomic
+states we should not enter all have immediate transitions to failure in them -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s2p112 s2p122" version="1.0" datamodel="jexl">
+ <state id="s1">
+ <transition target="fail"/>
+ </state>
+ <state id="s2" initial="s2p1">
+ <parallel id="s2p1">
+ <!-- this transition will be triggered only if we end up in an illegal configuration where we're in
+ either s2p112 or s2p122, but not both of them -->
+ <transition target="fail"/>
+ <state id="s2p11" initial="s2p111">
+ <state id="s2p111">
+ <transition target="fail"/>
+ </state>
+ <state id="s2p112">
+ <transition cond="In('s2p122')" target="pass"/>
+ </state>
+ </state>
+ <!-- end s2p11 -->
+ <state id="s2p12" initial="s2p121">
+ <state id="s2p121">
+ <transition target="fail"/>
+ </state>
+ <state id="s2p122">
+ <transition cond="In('s2p112')" target="pass"/>
+ </state>
+ </state>
+ </parallel>
+ </state>
+ <!-- end s2 -->
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test415.scxml b/test/w3c/jexl/test415.scxml
new file mode 100644
index 0000000..dbfa714
--- /dev/null
+++ b/test/w3c/jexl/test415.scxml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Test that the state machine halts when it enters a top-level final state. Since
+ the initial state is a final state, this machine should halt immediately without
+ processing "event1" which is raised in the final state's on-entry handler. This
+ is a manual test since there is no platform-independent way to test that event1
+ is not processed -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="final" version="1.0" datamodel="jexl">
+ <final id="final">
+ <onentry>
+ <raise event="event1"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test416.scxml b/test/w3c/jexl/test416.scxml
new file mode 100644
index 0000000..a8deae1
--- /dev/null
+++ b/test/w3c/jexl/test416.scxml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the done.state.id gets generated when we enter the final state of a compound state -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s1" datamodel="jexl">
+ <state id="s1" initial="s11">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <state id="s11" initial="s111">
+ <transition event="done.state.s11" target="pass"/>
+ <state id="s111">
+ <transition target="s11final"/>
+ </state>
+ <final id="s11final"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test417.scxml b/test/w3c/jexl/test417.scxml
new file mode 100644
index 0000000..cb375d4
--- /dev/null
+++ b/test/w3c/jexl/test417.scxml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that we get the done.state.id event when all of a
+parallel elements children enter final states. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s1" datamodel="jexl">
+ <state id="s1" initial="s1p1">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <parallel id="s1p1">
+ <transition event="done.state.s1p1" target="pass"/>
+ <state id="s1p11" initial="s1p111">
+ <state id="s1p111">
+ <transition target="s1p11final"/>
+ </state>
+ <final id="s1p11final"/>
+ </state>
+ <state id="s1p12" initial="s1p121">
+ <state id="s1p121">
+ <transition target="s1p12final"/>
+ </state>
+ <final id="s1p12final"/>
+ </state>
+ </parallel>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test419.scxml b/test/w3c/jexl/test419.scxml
new file mode 100644
index 0000000..702e2f5
--- /dev/null
+++ b/test/w3c/jexl/test419.scxml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that eventless transitions take precedence over event-driven ones -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s1" datamodel="jexl">
+ <state id="s1">
+ <onentry>
+ <raise event="internalEvent"/>
+ <send event="externalEvent"/>
+ </onentry>
+ <transition event="*" target="fail"/>
+ <transition target="pass"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test421.scxml b/test/w3c/jexl/test421.scxml
new file mode 100644
index 0000000..7e18c47
--- /dev/null
+++ b/test/w3c/jexl/test421.scxml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that internal events take priority over external ones, and that the processor
+keeps pulling off internal events until it finds one that triggers a transition -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s1" datamodel="jexl">
+ <state id="s1" initial="s11">
+ <onentry>
+ <send event="externalEvent"/>
+ <raise event="internalEvent1"/>
+ <raise event="internalEvent2"/>
+ <raise event="internalEvent3"/>
+ <raise event="internalEvent4"/>
+ </onentry>
+ <transition event="externalEvent" target="fail"/>
+ <state id="s11">
+ <transition event="internalEvent3" target="s12"/>
+ </state>
+ <state id="s12">
+ <transition event="internalEvent4" target="pass"/>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test422.scxml b/test/w3c/jexl/test422.scxml
new file mode 100644
index 0000000..09e0e06
--- /dev/null
+++ b/test/w3c/jexl/test422.scxml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Test that at the end of a macrostep, the processor executes all invokes in states
+that have been entered and not exited during the step. (The invokes are supposed to be executed
+in document order, but we can test that since each invocation is separate and they may take
+different amounts to time to start up.) In this case, there are three invoke statements,
+in states s1, s11 and s12. Each invoked process returns an event named after its parent state.
+The invokes in s1 and s12 should execute, but not the one
+in s11. So we should receive invokeS1, invokeS12, but not invokeS12. Furthermore, when the timeout fires, var1 should equal 2.-->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s1" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <state id="s1" initial="s11">
+ <onentry>
+ <send event="timeout" delayexpr="'2s'"/>
+ </onentry>
+ <transition event="invokeS1 invokeS12">
+ <assign location="Var1" expr="Var1 + 1"/>
+ </transition>
+ <transition event="invokeS11" target="fail"/>
+ <transition event="timeout" cond="Var1==2" target="pass"/>
+ <transition event="timeout" target="fail"/>
+ <invoke>
+ <content>
+ <!-- when invoked, send 'foo' to parent, then terminate. -->
+ <scxml initial="sub0" version="1.0" datamodel="jexl">
+ <state id="sub0">
+ <onentry>
+ <send target="#_parent" event="invokeS1"/>
+ </onentry>
+ <transition target="subFinal0"/>
+ </state>
+ <final id="subFinal0"/>
+ </scxml>
+ </content>
+ </invoke>
+ <state id="s11">
+ <invoke>
+ <content>
+ <!-- when invoked, send 'foo' to parent, then terminate. -->
+ <scxml initial="sub1" version="1.0" datamodel="jexl">
+ <state id="sub1">
+ <onentry>
+ <send target="#_parent" event="invokeS11"/>
+ </onentry>
+ <transition target="subFinal1"/>
+ </state>
+ <final id="subFinal1"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition target="s12"/>
+ </state>
+ <state id="s12">
+ <invoke>
+ <content>
+ <!-- when invoked, send 'foo' to parent, then terminate. -->
+ <scxml initial="sub2" version="1.0" datamodel="jexl">
+ <state id="sub2">
+ <onentry>
+ <send target="#_parent" event="invokeS12"/>
+ </onentry>
+ <transition target="subFinal2"/>
+ </state>
+ <final id="subFinal2"/>
+ </scxml>
+ </content>
+ </invoke>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test423.scxml b/test/w3c/jexl/test423.scxml
new file mode 100644
index 0000000..5d9929c
--- /dev/null
+++ b/test/w3c/jexl/test423.scxml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that we keep pulling external events off the queue till we find one that matches a transition. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="externalEvent1"/>
+ <send event="externalEvent2" delayexpr="'1s'"/>
+ <raise event="internalEvent"/>
+ </onentry>
+ <!-- in this state we should process only internalEvent -->
+ <transition event="internalEvent" target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <!-- in this state we ignore externalEvent1 and wait for externalEvent2 -->
+ <transition event="externalEvent2" target="pass"/>
+ <transition event="internalEvent" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test446.txt b/test/w3c/jexl/test446.txt
new file mode 100644
index 0000000..3a26a2e
--- /dev/null
+++ b/test/w3c/jexl/test446.txt
@@ -0,0 +1 @@
+[1,2,3] \ No newline at end of file
diff --git a/test/w3c/jexl/test487.scxml b/test/w3c/jexl/test487.scxml
new file mode 100644
index 0000000..84001f5
--- /dev/null
+++ b/test/w3c/jexl/test487.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test illegal assignment. error.execution should be raised. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1" expr="return"/>
+ <raise event="event"/>
+ </onentry>
+ <transition event="error.execution" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test488.scxml b/test/w3c/jexl/test488.scxml
new file mode 100644
index 0000000..b1cf582
--- /dev/null
+++ b/test/w3c/jexl/test488.scxml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that illegal expr in <param> produces error.execution and empty event.data -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <state id="s0" initial="s01">
+ <!-- we should get the error before the done event -->
+ <transition event="error.execution" target="s1"/>
+ <transition event="done.state.s0" target="fail"/>
+ <transition event="done.state.s0" target="fail">
+ </transition>
+ <state id="s01">
+ <transition target="s02"/>
+ </state>
+ <final id="s02">
+ <donedata>
+ <param expr="return" name="someParam"/>
+ </donedata>
+ </final>
+ </state>
+ <!-- if we get here, we received the error event. Now check that the done
+ event has empty event.data -->
+ <state id="s1">
+ <transition event="done.state.s0" cond="typeof _event.data === 'undefined'" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test495.scxml b/test/w3c/jexl/test495.scxml
new file mode 100644
index 0000000..6051ece
--- /dev/null
+++ b/test/w3c/jexl/test495.scxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the scxml event i/o processor puts events in the correct queues.-->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <!-- default target is external queue -->
+ <send event="event1" type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor"/>
+ <send event="event2" target="#_internal" type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor"/>
+ </onentry>
+ <!-- we should get the internal event first -->
+ <transition event="event1" target="fail"/>
+ <transition event="event2" target="s1"/>
+ </state>
+ <state id="s1">
+ <transition event="event1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test496.scxml b/test/w3c/jexl/test496.scxml
new file mode 100644
index 0000000..70f150b
--- /dev/null
+++ b/test/w3c/jexl/test496.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" event="event" target="#_scxml_foo"/>
+ <raise event="foo"/>
+ </onentry>
+ <transition event="error.communication" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test500.scxml b/test/w3c/jexl/test500.scxml
new file mode 100644
index 0000000..a970ee3
--- /dev/null
+++ b/test/w3c/jexl/test500.scxml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that location field is found inside entry for SCXML Event I/O processor -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="_ioprocessors['http://www.w3.org/TR/scxml/#SCXMLEventProcessor'].location"/>
+ </datamodel>
+ <state id="s0">
+ <transition cond="Var1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test501.scxml b/test/w3c/jexl/test501.scxml
new file mode 100644
index 0000000..d59ccc2
--- /dev/null
+++ b/test/w3c/jexl/test501.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the location entry for the SCXML Event I/O processor can be used as the target for an event -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="_ioprocessors['http://www.w3.org/TR/scxml/#SCXMLEventProcessor'].location"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send targetexpr="Var1" event="foo"/>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <transition event="foo" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test503.scxml b/test/w3c/jexl/test503.scxml
new file mode 100644
index 0000000..17a8b90
--- /dev/null
+++ b/test/w3c/jexl/test503.scxml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that a targetless transition does not exit and reenter its source state -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s1" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ <!-- how often we have exited s2 -->
+ <data id="Var2" expr="0"/>
+ <!-- how often the targetless transition in s2 has been executed -->
+ </datamodel>
+ <state id="s1">
+ <onentry>
+ <raise event="foo"/>
+ <raise event="bar"/>
+ </onentry>
+ <transition target="s2"/>
+ </state>
+ <state id="s2">
+ <onexit>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onexit>
+ <transition event="foo">
+ <assign location="Var2" expr="Var2 + 1"/>
+ </transition>
+ <!-- make sure the transition on foo was actually taken -->
+ <transition event="bar" cond="Var2==1" target="s3"/>
+ <transition event="bar" target="fail"/>
+ </state>
+ <state id="s3">
+ <!-- make sure that s2 was exited only once -->
+ <transition cond="Var1==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test504.scxml b/test/w3c/jexl/test504.scxml
new file mode 100644
index 0000000..c405733
--- /dev/null
+++ b/test/w3c/jexl/test504.scxml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that an external transition exits all states up the the LCCA -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s1" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ <!-- how often we have exited p -->
+ <data id="Var2" expr="0"/>
+ <!-- how often we have exited ps1 -->
+ <data id="Var3" expr="0"/>
+ <!-- how often we have exited ps2 -->
+ <data id="Var4" expr="0"/>
+ <!-- how often the transition for foo has been taken -->
+ <data id="Var5" expr="0"/>
+ <!-- how often we have exited s2 -->
+ </datamodel>
+ <state id="s1">
+ <onentry>
+ <raise event="foo"/>
+ <raise event="bar"/>
+ </onentry>
+ <transition target="p"/>
+ </state>
+ <state id="s2">
+ <onexit>
+ <assign location="Var5" expr="Var5 + 1"/>
+ </onexit>
+ <parallel id="p">
+ <onexit>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onexit>
+ <transition event="foo" target="ps1">
+ <assign location="Var4" expr="Var4 + 1"/>
+ </transition>
+ <!-- make sure the transition on foo was actually taken -->
+ <transition event="bar" cond="Var4==1" target="s3"/>
+ <transition event="bar" target="fail"/>
+ <state id="ps1">
+ <onexit>
+ <assign location="Var2" expr="Var2 + 1"/>
+ </onexit>
+ </state>
+ <state id="ps2">
+ <onexit>
+ <assign location="Var3" expr="Var3 + 1"/>
+ </onexit>
+ </state>
+ </parallel>
+ </state>
+ <state id="s3">
+ <!-- make sure that p was exited twice -->
+ <transition cond="Var1==2" target="s4"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s4">
+ <!-- make sure that ps1 was exited twice -->
+ <transition cond="Var2==2" target="s5"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s5">
+ <!-- make sure that ps2 was exited twice -->
+ <transition cond="Var3==2" target="s6"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s6">
+ <!-- make sure that s1 was exited once -->
+ <transition cond="Var5==1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test505.scxml b/test/w3c/jexl/test505.scxml
new file mode 100644
index 0000000..399a10e
--- /dev/null
+++ b/test/w3c/jexl/test505.scxml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that an internal transition does not exit its source state -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s1" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ <!-- how often we have exited s1 -->
+ <data id="Var2" expr="0"/>
+ <!-- how often we have exited s11 -->
+ <data id="Var3" expr="0"/>
+ <!-- how often the transition for foo has been taken -->
+ </datamodel>
+ <state id="s1">
+ <onentry>
+ <raise event="foo"/>
+ <raise event="bar"/>
+ </onentry>
+ <onexit>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onexit>
+ <transition event="foo" type="internal" target="s11">
+ <assign location="Var3" expr="Var3 + 1"/>
+ </transition>
+ <!-- make sure the transition on foo was actually taken -->
+ <transition event="bar" cond="Var3==1" target="s2"/>
+ <transition event="bar" target="fail"/>
+ <state id="s11">
+ <onexit>
+ <assign location="Var2" expr="Var2 + 1"/>
+ </onexit>
+ </state>
+ </state>
+ <state id="s2">
+ <!-- make sure that s1 was exited once -->
+ <transition cond="Var1==1" target="s3"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s3">
+ <!-- make sure that s11 was exited twice -->
+ <transition cond="Var2==2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test506.scxml b/test/w3c/jexl/test506.scxml
new file mode 100644
index 0000000..59fa1bd
--- /dev/null
+++ b/test/w3c/jexl/test506.scxml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that an internal transition whose targets are not proper descendants of its source state
+behaves like an external transition -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s1" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ <!-- how often we have exited s2 -->
+ <data id="Var2" expr="0"/>
+ <!-- how often we have exited s21 -->
+ <data id="Var3" expr="0"/>
+ <!-- how often the transition for foo has been taken -->
+ </datamodel>
+ <state id="s1">
+ <onentry>
+ <raise event="foo"/>
+ <raise event="bar"/>
+ </onentry>
+ <transition target="s2"/>
+ </state>
+ <state id="s2" initial="s21">
+ <onexit>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onexit>
+ <transition event="foo" type="internal" target="s2">
+ <assign location="Var3" expr="Var3 + 1"/>
+ </transition>
+ <!-- make sure the transition on foo was actually taken -->
+ <transition event="bar" cond="Var3==1" target="s3"/>
+ <transition event="bar" target="fail"/>
+ <state id="s21">
+ <onexit>
+ <assign location="Var2" expr="Var2 + 1"/>
+ </onexit>
+ </state>
+ </state>
+ <state id="s3">
+ <!-- make sure that s2 was exited twice -->
+ <transition cond="Var1==2" target="s4"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s4">
+ <!-- make sure that s21 was exited twice -->
+ <transition cond="Var2==2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test509.scxml b/test/w3c/jexl/test509.scxml
new file mode 100644
index 0000000..7f48203
--- /dev/null
+++ b/test/w3c/jexl/test509.scxml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that Basic HTTP Event I/O processor uses POST method and that it can receive messages
+at the accessURI -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="30s"/>
+ <send event="test" targetexpr="_ioprocessors['basichttp']['location']" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor"/>
+ </onentry>
+ <!-- if the event was send by http and we get it, we succeed -->
+ <transition event="test" cond="_event.raw.search('POST') !== -1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test510.scxml b/test/w3c/jexl/test510.scxml
new file mode 100644
index 0000000..9af949b
--- /dev/null
+++ b/test/w3c/jexl/test510.scxml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that Basic HTTP messages go into external queue. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="30s"/>
+ <send event="test" targetexpr="_ioprocessors['basichttp']['location']" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor"/>
+ <!-- this creates an internal event -->
+ <raise event="internal"/>
+ </onentry>
+ <!-- we should get 'internal' first, then 'test' -->
+ <transition event="internal" target="s1"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition event="test" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test513.txt b/test/w3c/jexl/test513.txt
new file mode 100644
index 0000000..08e9b01
--- /dev/null
+++ b/test/w3c/jexl/test513.txt
@@ -0,0 +1,16 @@
+This is a fully manual test. You send a well formed event to the 'location' URL
+ specified for your SCXML interpreter and check that you get a 200 response code back.
+ One way of doing this, using wget, is shown below (you can use any event name you
+ want, but you must use '_scxmleventname' to indicate the name of the event):
+
+$ wget \
+--post-data='key1=value1&key2=value2' \
+--header '_scxmleventname: test' \
+<!-- URL of your processor goes here -->
+
+--2014-06-25 17:54:49-- http://epikur.local:8090/925c760f-2093-4054-a24c-d972d75f0dcd/basichttp
+Resolving epikur.local (epikur.local)... 10.211.55.2, 10.37.129.2, 10.0.1.54, ...
+Connecting to epikur.local (epikur.local)|10.211.55.2|:8090... connected.
+HTTP request sent, awaiting response... 200 OK
+Length: 0 [text/html]
+Saving to: ‘basichttp’ \ No newline at end of file
diff --git a/test/w3c/jexl/test518.scxml b/test/w3c/jexl/test518.scxml
new file mode 100644
index 0000000..a5215f2
--- /dev/null
+++ b/test/w3c/jexl/test518.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that that namelist values get encoded as POST parameters. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="2"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="30s"/>
+ <send event="test" targetexpr="_ioprocessors['basichttp']['location']" namelist="Var1" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor"/>
+ </onentry>
+ <transition event="test" cond="_event.raw.search(/Var1=2/) !== -1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test519.scxml b/test/w3c/jexl/test519.scxml
new file mode 100644
index 0000000..73cbf69
--- /dev/null
+++ b/test/w3c/jexl/test519.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that that <param> values get encoded as POST parameters. . -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="30s"/>
+ <send event="test" targetexpr="_ioprocessors['basichttp']['location']" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor">
+ <param name="param1" expr="1"/>
+ </send>
+ </onentry>
+ <!-- if other end sends us back this event, we succeed -->
+ <transition event="test" cond="_event.raw.search('param1=1') !== -1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test520.scxml b/test/w3c/jexl/test520.scxml
new file mode 100644
index 0000000..8c73b96
--- /dev/null
+++ b/test/w3c/jexl/test520.scxml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that that <content> gets sent as the body of the message. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="30s"/>
+ <send targetexpr="_ioprocessors['basichttp']['location']" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor">
+ <content>this is some content</content>
+ </send>
+ </onentry>
+ <!-- if other end sends us back this event, we succeed. Test for two common
+ ways of encoding -->
+ <transition event="HTTP.POST" cond="_event.raw.search(/this+is+some+content/) !== -1" target="pass"/>
+ <transition event="HTTP.POST" cond="_event.raw.search(/this%20is%20some%20content/) !== -1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test521.scxml b/test/w3c/jexl/test521.scxml
new file mode 100644
index 0000000..6e0973f
--- /dev/null
+++ b/test/w3c/jexl/test521.scxml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that the processor raises error.communication if it cannot dispatch the event.
+(To create an undispatchable event, we choose a non-existent session as target). If it raises
+the error event, we succeed. Otherwise we eventually timeout and fail. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <!-- should cause an error -->
+ <send target="#_scxml_foo" event="event2"/>
+ <!-- this will get added to the external event queue after the error has been raised -->
+ <send event="timeout"/>
+ </onentry>
+ <!-- once we've entered the state, we should check for internal events first -->
+ <transition event="error.communication" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test522.scxml b/test/w3c/jexl/test522.scxml
new file mode 100644
index 0000000..72828f9
--- /dev/null
+++ b/test/w3c/jexl/test522.scxml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that location field the entry for Basic HTTP Event I/O processor can be used
+to send a message to the processor -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="30s"/>
+ <send event="test" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor" targetexpr="_ioprocessors['basichttp']['location']"/>
+ </onentry>
+ <!-- the event we receive should be called 'test', but that's not actually
+ required for this test. Only that the send deliver some event to us. So if
+ we get something other than timeout or error, we call it success -->
+ <transition event="timeout" target="fail"/>
+ <transition event="error" target="fail"/>
+ <transition event="*" target="pass"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test525.scxml b/test/w3c/jexl/test525.scxml
new file mode 100644
index 0000000..1f6f0ad
--- /dev/null
+++ b/test/w3c/jexl/test525.scxml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that <foreach> does a shallow copy, so that modifying the array does not change
+the iteration behavior. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1">
+ [1,2,3]
+ </data>
+ <data id="Var2" expr="0"/>
+ <!-- counts the number of iterations -->
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <foreach item="Var3" array="Var1">
+ <assign location="Var1" expr="[].concat(Var1, [4])"/>
+ <assign location="Var2" expr="Var2 + 1"/>
+ </foreach>
+ </onentry>
+ <transition cond="Var2==3" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test527.scxml b/test/w3c/jexl/test527.scxml
new file mode 100644
index 0000000..e502275
--- /dev/null
+++ b/test/w3c/jexl/test527.scxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- simple test that 'expr' works with <content> -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <state id="s0" initial="s01">
+ <transition event="done.state.s0" cond="_event.data == 'foo'" target="pass">
+ </transition>
+ <transition event="done.state.s0" target="fail">
+ </transition>
+ <state id="s01">
+ <transition target="s02"/>
+ </state>
+ <final id="s02">
+ <donedata>
+ <content expr="'foo'"/>
+ </donedata>
+ </final>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test528.scxml b/test/w3c/jexl/test528.scxml
new file mode 100644
index 0000000..e7ff45d
--- /dev/null
+++ b/test/w3c/jexl/test528.scxml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that illegal 'expr' produces error.execution and empty event.data -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <state id="s0" initial="s01">
+ <!-- we should get the error before the done event -->
+ <transition event="error.execution" target="s1"/>
+ <transition event="done.state.s0" target="fail"/>
+ <state id="s01">
+ <transition target="s02"/>
+ </state>
+ <final id="s02">
+ <donedata>
+ <content expr="return"/>
+ </donedata>
+ </final>
+ </state>
+ <!-- if we get here, we received the error event. Now check that the done
+ event has empty event.data -->
+ <state id="s1">
+ <transition event="done.state.s0" cond="typeof _event.data === 'undefined'" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test529.scxml b/test/w3c/jexl/test529.scxml
new file mode 100644
index 0000000..b092863
--- /dev/null
+++ b/test/w3c/jexl/test529.scxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- simple test that children workn with <content> -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" datamodel="jexl" initial="s0">
+ <state id="s0" initial="s01">
+ <transition event="done.state.s0" cond="_event.data == 21" target="pass">
+ </transition>
+ <transition event="done.state.s0" target="fail">
+ </transition>
+ <state id="s01">
+ <transition target="s02"/>
+ </state>
+ <final id="s02">
+ <donedata>
+ <content>21</content>
+ </donedata>
+ </final>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test530.scxml b/test/w3c/jexl/test530.scxml
new file mode 100644
index 0000000..a9693d4
--- /dev/null
+++ b/test/w3c/jexl/test530.scxml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that <content> child is evaluated when <invoke> is. Var1 is initialized
+with an integer value, then set to an scxml script in the onentry to s0. If <content>
+is evaluated at the right time, we should get invoke.done, otherwise an error -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="1"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <assign location="Var1">
+ <scxml version="1.0">
+ <final/>
+ </scxml>
+ </assign>
+ <send event="timeout" delay="2s"/>
+ </onentry>
+ <invoke type="http://www.w3.org/TR/scxml/">
+ <content expr="Var1"/>
+ </invoke>
+ <transition event="done.invoke" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test531.scxml b/test/w3c/jexl/test531.scxml
new file mode 100644
index 0000000..632984b
--- /dev/null
+++ b/test/w3c/jexl/test531.scxml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that that the value of the <param> _scxmleventname gets used as the name
+of the raised event. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="3s"/>
+ <send targetexpr="_ioprocessors['basichttp']['location']" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor">
+ <param name="_scxmleventname" expr="'test'"/>
+ </send>
+ </onentry>
+ <!-- if we get an event named 'test' we succeed. Otherwise fail -->
+ <transition event="test" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test532.scxml b/test/w3c/jexl/test532.scxml
new file mode 100644
index 0000000..2e108ae
--- /dev/null
+++ b/test/w3c/jexl/test532.scxml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that that if _scxmleventname is not present, the name of the HTTP method is used
+as the name of the resulting event. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="3s"/>
+ <send targetexpr="_ioprocessors['basichttp']['location']" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor">
+ <!-- this content will be ignored, but it's here to make sure we have a message body -->
+ <content>some content</content>
+ </send>
+ </onentry>
+ <transition event="HTTP.POST" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test533.scxml b/test/w3c/jexl/test533.scxml
new file mode 100644
index 0000000..43bd850
--- /dev/null
+++ b/test/w3c/jexl/test533.scxml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that an internal transition whose source state is not compound does exit its source state -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s1" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ <!-- how often we have exited p -->
+ <data id="Var2" expr="0"/>
+ <!-- how often we have exited ps1 -->
+ <data id="Var3" expr="0"/>
+ <!-- how often we have exited ps2 -->
+ <data id="Var4" expr="0"/>
+ <!-- how often the transition for foo has been taken -->
+ </datamodel>
+ <state id="s1">
+ <onentry>
+ <raise event="foo"/>
+ <raise event="bar"/>
+ </onentry>
+ <transition target="p"/>
+ </state>
+ <parallel id="p">
+ <onexit>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onexit>
+ <transition event="foo" type="internal" target="ps1">
+ <assign location="Var4" expr="Var4 + 1"/>
+ </transition>
+ <!-- make sure the transition on foo was actually taken -->
+ <transition event="bar" cond="Var4==1" target="s2"/>
+ <transition event="bar" target="fail"/>
+ <state id="ps1">
+ <onexit>
+ <assign location="Var2" expr="Var2 + 1"/>
+ </onexit>
+ </state>
+ <state id="ps2">
+ <onexit>
+ <assign location="Var3" expr="Var3 + 1"/>
+ </onexit>
+ </state>
+ </parallel>
+ <state id="s2">
+ <!-- make sure that p was exited twice -->
+ <transition cond="Var1==2" target="s3"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s3">
+ <!-- make sure that ps1 was exited twice -->
+ <transition cond="Var2==2" target="s4"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s4">
+ <!-- make sure that ps2 was exited twice -->
+ <transition cond="Var3==2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test534.scxml b/test/w3c/jexl/test534.scxml
new file mode 100644
index 0000000..e8438a7
--- /dev/null
+++ b/test/w3c/jexl/test534.scxml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that that <send> 'event' value gets sent as the param _scxmleventname . -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="30s"/>
+ <send event="test" targetexpr="_ioprocessors['basichttp']['location']" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor">
+ </send>
+ </onentry>
+ <!-- if other end sends us back this event, we succeed -->
+ <transition event="test" cond="_event.raw.search('_scxmleventname=test') !== -1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test539.txt b/test/w3c/jexl/test539.txt
new file mode 100644
index 0000000..de1b0a1
--- /dev/null
+++ b/test/w3c/jexl/test539.txt
@@ -0,0 +1,4 @@
+ <books xmlns="">
+ <book title="title1"/>
+ <book title="title2"/>
+ </books> \ No newline at end of file
diff --git a/test/w3c/jexl/test540.txt b/test/w3c/jexl/test540.txt
new file mode 100644
index 0000000..2191239
--- /dev/null
+++ b/test/w3c/jexl/test540.txt
@@ -0,0 +1,3 @@
+123
+4 5
+ \ No newline at end of file
diff --git a/test/w3c/jexl/test550.scxml b/test/w3c/jexl/test550.scxml
new file mode 100644
index 0000000..149cf68
--- /dev/null
+++ b/test/w3c/jexl/test550.scxml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that expr can be used to assign a value to a var. This test uses early binding -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl" binding="early">
+ <state id="s0">
+ <transition cond="Var1==2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s1">
+ <datamodel>
+ <data id="Var1" expr="2"/>
+ </datamodel>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test551.scxml b/test/w3c/jexl/test551.scxml
new file mode 100644
index 0000000..6c907a8
--- /dev/null
+++ b/test/w3c/jexl/test551.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that inline content can be used to assign a value to a var. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" binding="early" datamodel="jexl">
+ <state id="s0">
+ <transition cond="Var1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <state id="s1">
+ <datamodel>
+ <data id="Var1">
+ [1,2,3]
+ </data>
+ </datamodel>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test552.scxml b/test/w3c/jexl/test552.scxml
new file mode 100644
index 0000000..aa51c03
--- /dev/null
+++ b/test/w3c/jexl/test552.scxml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that src content can be used to assign a value to a var. Edit
+test552.txt to have a value that's legal for the datamodel in question -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" src="file:test552.txt"/>
+ </datamodel>
+ <state id="s0">
+ <transition cond="Var1" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test552.txt b/test/w3c/jexl/test552.txt
new file mode 100644
index 0000000..d8263ee
--- /dev/null
+++ b/test/w3c/jexl/test552.txt
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/w3c/jexl/test553.scxml b/test/w3c/jexl/test553.scxml
new file mode 100644
index 0000000..fd73e3c
--- /dev/null
+++ b/test/w3c/jexl/test553.scxml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- we test that the processor does not dispatch the event if evaluation
+of <send>'s args causes an error.. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <!-- timeout event -->
+ <send event="timeout" delayexpr="'1s'"/>
+ <!-- generate an invalid namelist -->
+ <send event="event1" namelist="&quot;foo"/>
+ </onentry>
+ <!-- if we get the timeout before event1, we assume that event1 hasn't been sent
+ We ignore the error event here because this assertion doesn't mention it -->
+ <transition event="timeout" target="pass"/>
+ <transition event="event1" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test554.scxml b/test/w3c/jexl/test554.scxml
new file mode 100644
index 0000000..11f0a08
--- /dev/null
+++ b/test/w3c/jexl/test554.scxml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that if the evaluation of <invoke>'s args causes an error, the
+invocation is cancelled. In this test, that means that we don't get done.invoke
+before the timer goes off. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="jexl">
+ <state id="s0">
+ <onentry>
+ <send event="timer" delayexpr="'1s'"/>
+ </onentry>
+ <!-- reference an invalid namelist -->
+ <invoke type="http://www.w3.org/TR/scxml/" namelist="&quot;foo">
+ <content>
+ <scxml initial="subFinal" version="1.0" datamodel="jexl">
+ <final id="subFinal"/>
+ </scxml>
+ </content>
+ </invoke>
+ <transition event="timer" target="pass"/>
+ <transition event="done.invoke" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test557.txt b/test/w3c/jexl/test557.txt
new file mode 100644
index 0000000..a8e51da
--- /dev/null
+++ b/test/w3c/jexl/test557.txt
@@ -0,0 +1,4 @@
+<books xmlns="">
+ <book title="title1"/>
+ <book title="title2"/>
+ </books> \ No newline at end of file
diff --git a/test/w3c/jexl/test558.txt b/test/w3c/jexl/test558.txt
new file mode 100644
index 0000000..bb2bcc7
--- /dev/null
+++ b/test/w3c/jexl/test558.txt
@@ -0,0 +1,3 @@
+
+this is
+a string \ No newline at end of file
diff --git a/test/w3c/jexl/test567.scxml b/test/w3c/jexl/test567.scxml
new file mode 100644
index 0000000..ba37868
--- /dev/null
+++ b/test/w3c/jexl/test567.scxml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that that any content in the message other than _scxmleventname is used to populate
+_event.data. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="2"/>
+ </datamodel>
+ <state id="s0">
+ <onentry>
+ <send event="timeout" delay="3s"/>
+ <!-- in this case, 'test' will be placed in _scxmleventname. The <param> should
+ be used to populate _event.data -->
+ <send event="test" targetexpr="_ioprocessors['basichttp']['location']" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor">
+ <param name="param1" expr="2"/>
+ </send>
+ </onentry>
+ <!-- if we get this event, we succeed -->
+ <transition event="test" target="s1">
+ <assign location="Var1" expr="_event.data.param1"/>
+ </transition>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s1">
+ <transition cond="Var1==2" target="pass"/>
+ <transition target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test570.scxml b/test/w3c/jexl/test570.scxml
new file mode 100644
index 0000000..6b44f45
--- /dev/null
+++ b/test/w3c/jexl/test570.scxml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that we generate done.state.id when all a parallel state's children are in final states -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="p0" datamodel="jexl" version="1.0">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <parallel id="p0">
+ <onentry>
+ <send event="timeout" delay="2s"/>
+ <raise event="e1"/>
+ <raise event="e2"/>
+ </onentry>
+ <!-- record that we get the first done event -->
+ <transition event="done.state.p0s1">
+ <assign location="Var1" expr="1"/>
+ </transition>
+ <!-- we should get the second done event before done.state.p0 -->
+ <transition event="done.state.p0s2" target="s1"/>
+ <transition event="timeout" target="fail"/>
+ <state id="p0s1" initial="p0s11">
+ <state id="p0s11">
+ <transition event="e1" target="p0s1final"/>
+ </state>
+ <final id="p0s1final"/>
+ </state>
+ <state id="p0s2" initial="p0s21">
+ <state id="p0s21">
+ <transition event="e2" target="p0s2final"/>
+ </state>
+ <final id="p0s2final"/>
+ </state>
+ </parallel>
+ <state id="s1">
+ <!-- if we get done.state.p0, success -->
+ <transition event="done.state.p0" cond="Var1==1" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test576.scxml b/test/w3c/jexl/test576.scxml
new file mode 100644
index 0000000..5b58eb1
--- /dev/null
+++ b/test/w3c/jexl/test576.scxml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that the 'initial' value of scxml is respected. We set the value to deeply nested non-default parallel siblings and
+test that both are entered. -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s11p112 s11p122" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <transition target="fail"/>
+ </state>
+ <state id="s1">
+ <onentry>
+ <send event="timeout" delay="1s"/>
+ </onentry>
+ <transition event="timeout" target="fail"/>
+ <state id="s11" initial="s111">
+ <state id="s111"/>
+ <parallel id="s11p1">
+ <state id="s11p11" initial="s11p111">
+ <state id="s11p111"/>
+ <state id="s11p112">
+ <onentry>
+ <raise event="In-s11p112"/>
+ </onentry>
+ </state>
+ </state>
+ <state id="s11p12" initial="s11p121">
+ <state id="s11p121"/>
+ <state id="s11p122">
+ <transition event="In-s11p112" target="pass"/>
+ </state>
+ </state>
+ </parallel>
+ </state>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test577.scxml b/test/w3c/jexl/test577.scxml
new file mode 100644
index 0000000..0ffcf18
--- /dev/null
+++ b/test/w3c/jexl/test577.scxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that that <send> without target in basichttp event i/o processor
+causes error.communication to get added to internal queue . -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="jexl" version="1.0">
+ <state id="s0">
+ <onentry>
+ <!-- sent by scxml event i/o processor, added to external queue -->
+ <send event="event1"/>
+ <!-- should put error.communication on internal queue -->
+ <send event="test" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor"/>
+ </onentry>
+ <transition event="error.communication" target="pass"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test579.scxml b/test/w3c/jexl/test579.scxml
new file mode 100644
index 0000000..94046e3
--- /dev/null
+++ b/test/w3c/jexl/test579.scxml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that default history content is executed correctly. The Process MUST execute any executable content in the transition after the parent state's onentry handlers, and, in the case where the history pseudo-state is the target of an <initial> transition,
+the executable content inside the <initial> transition. However the Processor MUST
+execute this content only if there is no stored history. Once the history state's
+parent state has been visited and exited, the default history content must not be executed -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0" datamodel="jexl">
+ <state id="s0">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <initial>
+ <transition target="sh1">
+ <raise event="event2"/>
+ </transition>
+ </initial>
+ <onentry>
+ <send delayexpr="'1s'" event="timeout"/>
+ <raise event="event1"/>
+ </onentry>
+ <onexit>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onexit>
+ <history id="sh1">
+ <transition target="s01">
+ <raise event="event3"/>
+ </transition>
+ </history>
+ <state id="s01">
+ <transition event="event1" target="s02"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s02">
+ <transition event="event2" target="s03"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s03">
+ <transition cond="Var1==0" event="event3" target="s0"/>
+ <transition cond="Var1==1" event="event1" target="s2"/>
+ <transition event="*" target="fail"/>
+ </state>
+ </state>
+ <state id="s2">
+ <transition event="event2" target="s3"/>
+ <transition event="*" target="fail"/>
+ </state>
+ <state id="s3">
+ <transition event="event3" target="fail"/>
+ <transition event="timeout" target="pass"/>
+ </state>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>
diff --git a/test/w3c/jexl/test580.scxml b/test/w3c/jexl/test580.scxml
new file mode 100644
index 0000000..fe4ae43
--- /dev/null
+++ b/test/w3c/jexl/test580.scxml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- test that a history state never ends up part of the configuration -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="p1" datamodel="jexl">
+ <datamodel>
+ <data id="Var1" expr="0"/>
+ </datamodel>
+ <parallel id="p1">
+ <onentry>
+ <send delay="2s" event="timeout"/>
+ </onentry>
+ <state id="s0">
+ <transition cond="In('sh1')" target="fail"/>
+ <transition event="timeout" target="fail"/>
+ </state>
+ <state id="s1">
+ <initial>
+ <transition target="sh1"/>
+ </initial>
+ <history id="sh1">
+ <transition target="s11"/>
+ </history>
+ <state id="s11">
+ <transition cond="In('sh1')" target="fail"/>
+ <transition target="s12"/>
+ </state>
+ <state id="s12"/>
+ <transition cond="In('sh1')" target="fail"/>
+ <transition cond="Var1==0" target="sh1"/>
+ <transition cond="Var1==1" target="pass"/>
+ <onexit>
+ <assign location="Var1" expr="Var1 + 1"/>
+ </onexit>
+ </state>
+ </parallel>
+ <final id="pass">
+ <onentry>
+ <log label="Outcome" expr="'pass'"/>
+ </onentry>
+ </final>
+ <final id="fail">
+ <onentry>
+ <log label="Outcome" expr="'fail'"/>
+ </onentry>
+ </final>
+</scxml>