summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-07-26 19:05:33 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-07-26 19:05:33 (GMT)
commit720bbe5c1b8c0789b5c7ad9ffca33e52bf77f1da (patch)
tree8f692eb636ddb21649097e053f8504a2dab70a01 /test
parent8ff01ac995c8b95fa2695b6ff7e3e985bd4579d6 (diff)
downloaduscxml-720bbe5c1b8c0789b5c7ad9ffca33e52bf77f1da.zip
uscxml-720bbe5c1b8c0789b5c7ad9ffca33e52bf77f1da.tar.gz
uscxml-720bbe5c1b8c0789b5c7ad9ffca33e52bf77f1da.tar.bz2
Started calendar invoker and bug fixes
Diffstat (limited to 'test')
-rw-r--r--test/samples/uscxml/test-prolog.scxml109
1 files changed, 66 insertions, 43 deletions
diff --git a/test/samples/uscxml/test-prolog.scxml b/test/samples/uscxml/test-prolog.scxml
index ea2365e..dd299a0 100644
--- a/test/samples/uscxml/test-prolog.scxml
+++ b/test/samples/uscxml/test-prolog.scxml
@@ -1,4 +1,6 @@
-<scxml datamodel="prolog">
+<scxml datamodel="prolog" name="outer">
+ <!-- a nested SCXML interpreter with prolog -->
+
<datamodel>
<data src="" />
<data id="father">
@@ -20,48 +22,69 @@
<child name="john" father="bob" />
</data>
</datamodel>
- <state id="s1">
- <onentry>
- <log label="Entering s1" expr="listing." />
- <script>
- :- dynamic ampel/1.
- ampel(false).
- ampel(X) :- retract(ampel(_)), assertz(ampel(X)).
- </script>
- <script type="query">
- ampel(true).
- </script>
- <assign location="">
- retract(father(bob, jim)).
- assert(father(steve, jim)).
- assert(father(bob, jack)).
- </assign>
- <log label="index" expr="listing." />
- <foreach array="father(bob, X)"
- item="child"
- index="index">
- <log label="index" expr="index(X)" />
- <log label="child" expr="child(X)" />
- </foreach>
- </onentry>
- <transition target="s2"
- cond="mother(martha, X), father(bob, X), in(s1)"/>
- </state>
- <state id="s2">
- <onentry>
- <send type="basichttp"
- targetexpr="ioprocessors(basichttp(location(X)))"
- event="foo">
- <content>
- <p>Snippet of XML</p>
- </content>
- </send>
- </onentry>
- <transition
- target="end"
- event="foo"
- cond="member(element('p',_,_), X), event(data(X))" />
+ <state id="start">
+ <invoke type="http://www.w3.org/TR/scxml/" autoforward="true">
+ <content>
+ <scxml datamodel="prolog" name="inner">
+ <state id="idle">
+ <onentry>
+ <log label="Entering inner" />
+ <send target="#_parent" event="inner" />
+ </onentry>
+ <transition target="end" event="foo" />
+ <transition type="internal" event="*" target="idle">
+ <log label="invoked" expr="event(name(X))." />
+ </transition>
+ </state>
+ <state id="end" final="true" />
+ </scxml>
+ </content>
+ </invoke>
+
+ <state id="s1">
+ <onentry>
+ <log label="Entering s1" />
+ <script>
+ :- dynamic ampel/1.
+ ampel(false).
+ ampel(X) :- retract(ampel(_)), assertz(ampel(X)).
+ </script>
+ <script type="query">
+ ampel(true).
+ </script>
+ <assign location="">
+ retract(father(bob, jim)).
+ assert(father(steve, jim)).
+ assert(father(bob, jack)).
+ </assign>
+ <log label="foreach" />
+ <foreach array="father(bob, X)"
+ item="child"
+ index="index">
+ <log label="index" expr="index(X)" />
+ <log label="child" expr="child(X)" />
+ </foreach>
+ </onentry>
+ <transition event="inner"
+ target="s2"
+ cond="mother(martha, X), father(bob, X), in(s1)"/>
+ </state>
+ <state id="s2">
+ <onentry>
+ <log label="Entering s2" />
+ <send type="basichttp"
+ targetexpr="ioprocessors(basichttp(location(X)))"
+ event="foo">
+ <content>
+ <p>Snippet of XML</p>
+ </content>
+ </send>
+ </onentry>
+ <transition
+ target="end"
+ event="foo"
+ cond="member(element('p',_,_), X), event(data(X))" />
+ </state>
</state>
-
<state id="end" final="true" />
</scxml>