blob: 6a15429588db982e48567d42ee45343efaf89427 (
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
<?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 beforeTakingTransitions($interpreter,$transitions) {
print "MyMonitor.beforeTakingTransitions()\n";
}
}
$monitor = new MyMonitor();
$interpreter = Interpreter::fromURI('https://raw.github.com/tklab-tud/uscxml/master/test/samples/uscxml/test-ecmascript.scxml');
$interpreter->addMonitor($monitor);
$interpreter->interpret();
$interpreter = Interpreter::fromURI('https://raw.github.com/tklab-tud/uscxml/master/test/samples/uscxml/test-invoked.scxml');
$parentQueue = new ParentQueue();
$interpreter->setParentQueue($parentQueue);
$interpreter->interpret();
//$interpreter->start();
#while($interpreter->isRunning()) {
$event = $parentQueue->pop();
print_r($event);
print(Event_name_get($event) . "\n");
#}
?>
|