summaryrefslogtreecommitdiffstats
path: root/test/samples/uscxml/test-prolog.scxml
blob: e29def16ff9abfcb25c8eb834ed206eb10405ab0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?xml version="1.0"?>
<scxml datamodel="prolog" initial="start" binding="late">
	<datamodel>
		<data id="facts">
% see http://www.swi-prolog.org/FAQ/Multifile.html
:- multifile animal/1.
cat(tom).
animal(X):- cat(X).
		</data>
	</datamodel>
	<script>
mouse(jerry).
animal(X):- mouse(X).
	</script>
	<state id="start">
		<onentry>
			<log label="SessionId" expr="sessionId(X)"/>
			<log label="Name" expr="name(X)"/>
			<send event="foo">This is a foo event.</send>
		</onentry>
		<transition event="foo" cond="not(cat(jerry)), cat(tom), mouse(jerry)." target="s1"/>
	</state>
	<state id="s1">
		<onentry>
			<log expr="eventName(X)."/>
			<send event="bar">
				<ISBNdb server_time="2009-03-19T02:01:00Z">
					<BookList total_results="1" page_size="10" page_number="1" shown_results="1">
						<BookData book_id="the_data_compression_book" isbn="1558514341">
							<Title>The Data Compression Book</Title>
							<TitleLong/>
							<AuthorsText>Mark Nelson, Jean-Loup Gailly, </AuthorsText>
							<PublisherText publisher_id="m_t_books">M&amp;T Books</PublisherText>
						</BookData>
					</BookList>
				</ISBNdb>
			</send>
		</onentry>
		<transition target="end"/>
	</state>
	<state id="end" final="true">
		<onentry>
			<log expr="animal(X)."/>
		</onentry>
	</state>
</scxml>