{
  "format": 3,
  "id": "door",
  "title": "Door: a finite state machine",
  "direction": "right",
  "layers": {
    "process": {
      "label": "Process"
    }
  },
  "lanes": {},
  "frames": {},
  "nodes": {
    "start": {
      "label": "Start",
      "layer": "process",
      "box": [
        16,
        120.9,
        60,
        36
      ]
    },
    "closed": {
      "label": "Closed",
      "layer": "process",
      "box": [
        260.099,
        120.9,
        66,
        36
      ]
    },
    "open": {
      "label": "Open",
      "layer": "process",
      "box": [
        568.6919999999999,
        199.5,
        60,
        36
      ]
    },
    "locked": {
      "label": "Locked",
      "layer": "process",
      "box": [
        564.1919999999999,
        20.30000000000001,
        69,
        36
      ]
    },
    "end": {
      "label": "End",
      "layer": "process",
      "box": [
        568.6919999999999,
        120.9,
        60,
        36
      ]
    }
  },
  "edges": {
    "start": {
      "from": "start",
      "to": "closed",
      "label": {
        "at": [
          108,
          161.4
        ],
        "text": "init [true] / reset"
      },
      "path": "M76,138.9 L168.0495,138.9 L260.099,138.9",
      "badge": [
        99.01237499999999,
        138.9
      ]
    },
    "open": {
      "from": "closed",
      "to": "open",
      "label": {
        "at": [
          358.099,
          262.3
        ],
        "text": "push [unlocked] / open"
      },
      "path": "M317.09858374628345,156.9 L427.63,239.8 L568.6919999999999,221.41086272813365",
      "badge": [
        424.17589324207137,
        237.20937500000002
      ]
    },
    "close": {
      "from": "open",
      "to": "closed",
      "label": {
        "at": [
          399.90156249999995,
          175.82193746236925
        ],
        "text": "pull [true] / close"
      },
      "path": "M568.6919999999999,213.58913727186635 L427.63,195.2 L326.099,152.71019987958167",
      "badge": [
        421.2843125,
        192.54438749247385
      ]
    },
    "lock": {
      "from": "closed",
      "to": "locked",
      "label": {
        "at": [
          372.07366864730176,
          107.27759065022572
        ],
        "text": "turnKey [key] / lock"
      },
      "path": "M326.099,121.09146516416291 L427.63,66.30000000000001 L564.1919999999999,43.94707532941274",
      "badge": [
        444.70025,
        63.505884416176606
      ]
    },
    "unlock": {
      "from": "locked",
      "to": "closed",
      "label": {
        "at": [
          347.38386389377746,
          12.631373089683983
        ],
        "text": "turnKey [key] / unlock"
      },
      "path": "M564.1919999999999,33.8025078626463 L427.63,16 L312.80248250610254,120.9",
      "badge": [
        388.1580408614727,
        52.059374999999996
      ]
    },
    "blocked": {
      "from": "locked",
      "to": "locked",
      "label": {
        "at": [
          669.1919999999999,
          42.500000000000014
        ],
        "text": "push [locked] / rattle"
      },
      "path": "M633.1919999999999,29.30000000000001 L657.1919999999999,29.30000000000001 L657.1919999999999,47.30000000000001 L633.1919999999999,47.30000000000001",
      "badge": [
        657.1919999999999,
        38.30000000000001
      ]
    },
    "finish": {
      "from": "closed",
      "to": "end",
      "label": {
        "at": [
          364.42,
          161.4
        ],
        "text": "finish [done] / stop"
      },
      "path": "M326.099,138.9 L427.63,138.9 L568.6919999999999,138.9",
      "badge": [
        498.16099999999994,
        138.9
      ]
    }
  },
  "scenarios": [
    {
      "id": "locked-door",
      "label": "Try to open a locked door",
      "display": {
        "counterLabel": true,
        "edges": "progressive",
        "edgeBadges": false,
        "nodeBadges": false,
        "log": "incremental"
      },
      "steps": [
        {
          "id": "start",
          "title": "Start closed",
          "text": "Start is an ordinary node standing in for an initial state.",
          "show": [
            "start",
            "closed"
          ],
          "current": [
            "closed"
          ],
          "edges": [
            "start"
          ],
          "defs": [],
          "sources": [],
          "deeper": []
        },
        {
          "id": "lock",
          "title": "Lock the door",
          "text": "Turn the key: the door becomes locked.",
          "show": [
            "locked"
          ],
          "current": [
            "locked"
          ],
          "edges": [
            "lock"
          ],
          "defs": [],
          "sources": [],
          "deeper": []
        },
        {
          "id": "try",
          "title": "Try to open it",
          "text": "Pushing a locked door rattles the handle. The self-transition leaves the door locked.",
          "show": [],
          "current": [
            "locked"
          ],
          "edges": [
            "blocked"
          ],
          "defs": [],
          "log": [
            "push [locked] / rattle",
            "State stays Locked."
          ],
          "sources": [],
          "deeper": []
        },
        {
          "id": "unlock",
          "title": "Unlock with the key",
          "text": "Turn the key again to unlock the door.",
          "show": [],
          "current": [
            "closed"
          ],
          "edges": [
            "unlock"
          ],
          "defs": [],
          "sources": [],
          "deeper": []
        },
        {
          "id": "open",
          "title": "Open the door",
          "text": "Push the unlocked door.",
          "show": [
            "open"
          ],
          "current": [
            "open"
          ],
          "edges": [
            "open"
          ],
          "defs": [],
          "sources": [],
          "deeper": []
        },
        {
          "id": "close",
          "title": "Close the door",
          "text": "Pull the door closed.",
          "show": [],
          "current": [
            "closed"
          ],
          "edges": [
            "close"
          ],
          "defs": [],
          "sources": [],
          "deeper": []
        },
        {
          "id": "end",
          "title": "Finish the demonstration",
          "text": "End is an ordinary node standing in for a final state.",
          "show": [
            "end"
          ],
          "current": [
            "end"
          ],
          "edges": [
            "finish"
          ],
          "defs": [],
          "sources": [],
          "deeper": []
        }
      ],
      "flow": [
        {
          "node": "start",
          "step": "start",
          "log": []
        },
        {
          "node": "closed",
          "step": "start",
          "log": [
            "State: Closed"
          ],
          "edge": "start"
        },
        {
          "node": "locked",
          "step": "lock",
          "log": [
            "State: Locked"
          ],
          "edge": "lock"
        },
        {
          "node": "locked",
          "step": "try",
          "log": [
            "push [locked] / rattle; state stays Locked"
          ],
          "edge": "blocked"
        },
        {
          "node": "closed",
          "step": "unlock",
          "log": [
            "State: Closed"
          ],
          "edge": "unlock"
        },
        {
          "node": "open",
          "step": "open",
          "log": [
            "State: Open"
          ],
          "edge": "open"
        },
        {
          "node": "closed",
          "step": "close",
          "log": [
            "State: Closed"
          ],
          "edge": "close"
        },
        {
          "node": "end",
          "step": "end",
          "log": [
            "Demonstration finished."
          ],
          "edge": "finish"
        }
      ]
    }
  ],
  "definitions": {},
  "code": {},
  "concepts": [],
  "callouts": {},
  "deeper": [],
  "viewBox": [
    824.2539999999999,
    280.40000000000003
  ],
  "measurement": {
    "name": "font-table",
    "labels": {
      "start": {
        "width": 120.09899999999998,
        "height": 12.6
      },
      "open": {
        "width": 139.06199999999998,
        "height": 12.6
      },
      "close": {
        "width": 120.09899999999998,
        "height": 12.6
      },
      "lock": {
        "width": 126.41999999999997,
        "height": 12.6
      },
      "unlock": {
        "width": 139.06199999999998,
        "height": 12.6
      },
      "blocked": {
        "width": 139.06199999999998,
        "height": 12.6
      },
      "finish": {
        "width": 126.41999999999997,
        "height": 12.6
      }
    }
  }
}
