- or download this
create table nodes (
node_id int primary key,
name varchar(32)
-- other node info goes here
)
- or download this
create table edges (
from_node_id int not null references nodes(node_id),
...
description varchar(32)
-- other edge info goes here
)
- or download this
-- Allowed states for "Daily Work Task"
insert graph_nodes values (1, 'Wait/Idle')
...
insert graph_edges values (5, 2, 'Fault resolved normally')
insert graph_edges values (1, 6, 'System halted')
insert graph_edges values (2, 6, 'System halted')
- or download this
-- Where can I go from node 5?
select FR.node_id, '-->', TO.node_id, 'When: ' + E.description
...
join nodes FR on FR.node_id=E.from_node_id
join nodes TO on TO.node_id=E.to_node_id
where E.from_node_id = 5
- or download this
node_id node_id
------- --- ------- ----------------------------------
5 --> 2 When: Fault resolved normally
5 --> 6 When: Manual intervention required