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
61
62
63
64
65
66
67
68
69
70
71
72
73
|
digraph g {
// both "neato" and "dot" produce reasonable & interesting outputs
graph [rankdir=LR size="20,15" overlap="scale" splines="true"]
node [fontname="Ubuntu Mono" fontsize=12 margin=0]
edge [fontname="Ubuntu Mono" fontsize=10 decorate=true]
// states
node []
"INIT" [shape=doublecircle]
"Error" [shape=doublecircle color="#990000"]
"Configured"
"Identified"
"SysBusOK" [label="System\nBus\nGO"]
"Waiting4Conn" [label="Waiting\nfor\nConnectivity"]
"Connected" [label="Network\nConnected"]
"SesBusOK" [label="Session\nBus\nGO"]
"Running"
"Notified"
"Shown" [label="Notification\nShown"]
"Clicked"
// auto-transitions
node [shape=triangle]
"read config" [label="read\nconfig"]
"get system id" [label="get\nsystem\nid"]
"conn sys bus" [label="connect\nsystem\nbus"]
"watch conn" [label="watch\nconnectivity"]
"conn ses bus" [label="connect\nsession\nbus"]
"start session" [label="start\npush\nsession"]
"show notification" [label="show\nnotification"]
"dispatch URL" [label="dispatch\nURL"]
//
"INIT" -> "read config"
"Configured" -> "get system id"
"Identified" -> { "conn sys bus" "conn ses bus" }
"SysBusOK" -> "watch conn"
"Connected" -> "start session"
"Notified" -> "show notification"
"Clicked" -> "dispatch URL" -> "SesBusOK"
"Shown" -> "SesBusOK" // XXX state:state auto-transition?
// events
edge [color="#000099"]
"Waiting4Conn" -> "Connected" [label="connected"]
"Waiting4Conn" -> "Waiting4Conn" [label="disconnected"]
"SesBusOK" -> "Notified" [label="notification\narrived"]
"SesBusOK" -> "Clicked" [label="user\nclicked\nnotification"]
{ "Connected" "Running" } -> "Waiting4Conn" [constraint=false label="disconnected"]
"Running" -> "SesBusOK" [constraint=false style=dotted label=notification]
"Shown" -> "Running" [constraint=false style=dotted label=shown]
// OKs
edge [color="#009900" label="OK"]
"read config" -> "Configured"
"get system id" -> "Identified"
"conn sys bus" -> "SysBusOK"
"conn ses bus" -> "SesBusOK"
"watch conn" -> "Waiting4Conn"
"start session" -> "Running"
"show notification" -> "Shown"
//err
edge [color="#990000" label="err" constraint=false]
{ "read config"
"get system id"
} -> Error
"conn ses bus" -> "conn ses bus"
"conn sys bus" -> "conn sys bus"
"watch conn" -> "conn sys bus"
"start session" -> "start session"
}
|