diff options
Diffstat (limited to 'test/w3c/namespace/test237.scxml')
-rw-r--r-- | test/w3c/namespace/test237.scxml | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/w3c/namespace/test237.scxml b/test/w3c/namespace/test237.scxml new file mode 100644 index 0000000..6411566 --- /dev/null +++ b/test/w3c/namespace/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:scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" xmlns:scxml="http://www.w3.org/2005/07/scxml" initial="s0" version="1.0" datamodel="ecmascript"> + <scxml:state id="s0"> + <scxml:onentry> + <scxml:send event="timeout1" delayexpr="'1s'"/> + </scxml:onentry> + <scxml:invoke type="http://www.w3.org/TR/scxml/"> + <scxml:content> + <!-- when invoked, sleep for 2 secs then terminate. Parent will try to cancel this session --> + <scxml:scxml initial="sub0" version="1.0" datamodel="ecmascript"> + <scxml:state id="sub0"> + <scxml:onentry> + <scxml:send event="timeout" delayexpr="'2s'"/> + </scxml:onentry> + <scxml:transition event="timeout" target="subFinal"/> + </scxml:state> + <scxml:final id="subFinal"/> + </scxml:scxml> + </scxml:content> + </scxml:invoke> + <scxml:transition event="timeout1" target="s1"/> + </scxml:state> + <scxml:state id="s1"> + <scxml:onentry> + <scxml:send event="timeout2" delayexpr="'1.5s'"/> + </scxml:onentry> + <!-- here we should NOT get done.invoke --> + <scxml:transition event="done.invoke" target="fail"/> + <scxml:transition event="*" target="pass"/> + </scxml:state> + <scxml:final id="pass"> + <scxml:onentry> + <scxml:log label="Outcome" expr="'pass'"/> + </scxml:onentry> + </scxml:final> + <scxml:final id="fail"> + <scxml:onentry> + <scxml:log label="Outcome" expr="'fail'"/> + </scxml:onentry> + </scxml:final> +</scxml:scxml> |