digraph G {

node[weight=100]
// Session ID
A0[label="Get session ID"]

    subgraph cluster_A {
label="Critical section"
style=dotted
labeljust="r"

A1[shape=diamond,label="cache[ID] exists?"]
A3[label="Get cache[ID]"]
A4[shape=diamond,label="cache[ID][shape] exists?"]
A5[label="Get cache[ID][shape]"]

B[label="return null object"]
B1[shape=diamond,label="cache[ID][shape][name] exists?"]
B3[label="Get cache[ID][shape][name]"]
B4[label="return object of cache[ID][shape][name]"]
}

A0 -> A1 [label="ID"]
A1 -> B [label="no"]
A1 -> A3 [label="yes"]
A3 -> A4
A4 -> B  [label="no"]
A4 -> A5 [label="yes"]

A5 -> B1
B1 -> B3 [label="yes"]
B1 -> B [label="no"]
B3 -> B4 

}
