{
 "$schema": "../../lib/umlimator.schema.json",
 "schemaVersion": 2,
 "title": "Activity diagram",
 "root": "fulfil",
 "nodes": [
  {
   "id": "lane-shop",
   "type": "uml.ActivityPartition",
   "label": "Bookshop"
  },
  {
   "id": "lane-desk",
   "type": "uml.ActivityPartition",
   "label": "Order desk",
   "parent": "lane-shop"
  },
  {
   "id": "lane-warehouse",
   "type": "uml.ActivityPartition",
   "label": "Warehouse",
   "parent": "lane-shop"
  },
  {
   "id": "lane-email",
   "type": "uml.ActivityPartition",
   "label": "Email service"
  },
  {
   "id": "start",
   "type": "uml.InitialNode",
   "parent": "lane-desk"
  },
  {
   "id": "take-order",
   "type": "uml.Action",
   "label": "Take the next order from the queue",
   "parent": "lane-desk"
  },
  {
   "id": "order-object",
   "type": "uml.ObjectNode",
   "label": "Order",
   "parent": "lane-desk"
  },
  {
   "id": "check-stock",
   "type": "uml.Action",
   "label": "Check the stock of each book",
   "parent": "lane-warehouse"
  },
  {
   "id": "stock",
   "type": "uml.DataStoreNode",
   "label": "Stock levels",
   "parent": "lane-warehouse"
  },
  {
   "id": "in-stock",
   "type": "uml.DecisionNode",
   "label": "All books in stock?",
   "parent": "lane-warehouse"
  },
  {
   "id": "ask-restock",
   "type": "uml.SendSignalAction",
   "label": "Restock request",
   "parent": "lane-warehouse"
  },
  {
   "id": "books-arrive",
   "type": "uml.AcceptEventAction",
   "label": "Books delivered",
   "parent": "lane-warehouse"
  },
  {
   "id": "stock-ready",
   "type": "uml.MergeNode",
   "parent": "lane-warehouse",
   "label": "books ready"
  },
  {
   "id": "split",
   "type": "uml.ForkNode",
   "parent": "lane-desk"
  },
  {
   "id": "call-payment",
   "type": "uml.CallBehaviorAction",
   "label": "Take payment",
   "parent": "lane-desk",
   "opensView": "take-payment"
  },
  {
   "id": "pick",
   "type": "uml.Action",
   "label": "Pick and pack the books",
   "parent": "lane-warehouse"
  },
  {
   "id": "tell-shopper",
   "type": "uml.Action",
   "label": "Email \"your order is being packed\"",
   "parent": "lane-email"
  },
  {
   "id": "told",
   "type": "uml.FlowFinalNode",
   "parent": "lane-email"
  },
  {
   "id": "packed-and-paid",
   "type": "uml.JoinNode",
   "parent": "lane-warehouse"
  },
  {
   "id": "ship",
   "type": "uml.Action",
   "label": "Hand the parcel to the carrier",
   "parent": "lane-warehouse"
  },
  {
   "id": "done",
   "type": "uml.ActivityFinalNode",
   "parent": "lane-warehouse"
  },
  {
   "id": "note-stock",
   "type": "uml.Comment",
   "label": "In stock means every line of the order, not just the first book"
  },
  {
   "id": "pay-start",
   "type": "uml.InitialNode"
  },
  {
   "id": "pay-again",
   "type": "uml.MergeNode",
   "label": "try a card"
  },
  {
   "id": "charge",
   "type": "uml.Action",
   "label": "Charge the customer's card"
  },
  {
   "id": "accepted",
   "type": "uml.DecisionNode",
   "label": "Card accepted?"
  },
  {
   "id": "ask-card",
   "type": "uml.Action",
   "label": "Ask for another card"
  },
  {
   "id": "record",
   "type": "uml.Action",
   "label": "Record the payment on the order"
  },
  {
   "id": "pay-done",
   "type": "uml.ActivityFinalNode"
  }
 ],
 "edges": [
  {
   "id": "f-start",
   "type": "uml.ControlFlow",
   "from": "start",
   "to": "take-order"
  },
  {
   "id": "f-order-out",
   "type": "uml.ObjectFlow",
   "from": "take-order",
   "to": "order-object"
  },
  {
   "id": "f-order-in",
   "type": "uml.ObjectFlow",
   "from": "order-object",
   "to": "check-stock"
  },
  {
   "id": "f-stock-read",
   "type": "uml.ObjectFlow",
   "from": "stock",
   "to": "check-stock",
   "label": "levels"
  },
  {
   "id": "f-checked",
   "type": "uml.ControlFlow",
   "from": "check-stock",
   "to": "in-stock"
  },
  {
   "id": "f-in-stock",
   "type": "uml.ControlFlow",
   "from": "in-stock",
   "to": "stock-ready",
   "props": {
    "guard": "yes"
   }
  },
  {
   "id": "f-short",
   "type": "uml.ControlFlow",
   "from": "in-stock",
   "to": "ask-restock",
   "props": {
    "guard": "else"
   }
  },
  {
   "id": "f-wait",
   "type": "uml.ControlFlow",
   "from": "ask-restock",
   "to": "books-arrive"
  },
  {
   "id": "f-arrived",
   "type": "uml.ControlFlow",
   "from": "books-arrive",
   "to": "stock-ready"
  },
  {
   "id": "f-ready",
   "type": "uml.ControlFlow",
   "from": "stock-ready",
   "to": "split"
  },
  {
   "id": "f-to-pay",
   "type": "uml.ControlFlow",
   "from": "split",
   "to": "call-payment"
  },
  {
   "id": "f-to-pick",
   "type": "uml.ControlFlow",
   "from": "split",
   "to": "pick"
  },
  {
   "id": "f-to-tell",
   "type": "uml.ControlFlow",
   "from": "split",
   "to": "tell-shopper"
  },
  {
   "id": "f-told",
   "type": "uml.ControlFlow",
   "from": "tell-shopper",
   "to": "told"
  },
  {
   "id": "f-paid",
   "type": "uml.ControlFlow",
   "from": "call-payment",
   "to": "packed-and-paid"
  },
  {
   "id": "f-packed",
   "type": "uml.ControlFlow",
   "from": "pick",
   "to": "packed-and-paid"
  },
  {
   "id": "f-ship",
   "type": "uml.ControlFlow",
   "from": "packed-and-paid",
   "to": "ship"
  },
  {
   "id": "f-done",
   "type": "uml.ControlFlow",
   "from": "ship",
   "to": "done"
  },
  {
   "id": "note-stock-link",
   "type": "uml.CommentLink",
   "from": "note-stock",
   "to": "in-stock"
  },
  {
   "id": "f-pay-start",
   "type": "uml.ControlFlow",
   "from": "pay-start",
   "to": "pay-again"
  },
  {
   "id": "f-pay-try",
   "type": "uml.ControlFlow",
   "from": "pay-again",
   "to": "charge"
  },
  {
   "id": "f-charged",
   "type": "uml.ControlFlow",
   "from": "charge",
   "to": "accepted"
  },
  {
   "id": "f-accepted",
   "type": "uml.ControlFlow",
   "from": "accepted",
   "to": "record",
   "label": "paid",
   "props": {
    "guard": "yes"
   }
  },
  {
   "id": "f-declined",
   "type": "uml.ControlFlow",
   "from": "accepted",
   "to": "ask-card",
   "props": {
    "guard": "else"
   }
  },
  {
   "id": "f-retry",
   "type": "uml.ControlFlow",
   "from": "ask-card",
   "to": "pay-again"
  },
  {
   "id": "f-recorded",
   "type": "uml.ControlFlow",
   "from": "record",
   "to": "pay-done"
  }
 ],
 "views": [
  {
   "id": "fulfil",
   "diagram": "uml.activity",
   "title": "Fulfilling a bookshop order",
   "parent": null,
   "direction": "down",
   "nodeIds": [
    "lane-shop",
    "lane-desk",
    "lane-warehouse",
    "lane-email",
    "start",
    "take-order",
    "order-object",
    "check-stock",
    "stock",
    "in-stock",
    "ask-restock",
    "books-arrive",
    "stock-ready",
    "split",
    "call-payment",
    "pick",
    "tell-shopper",
    "told",
    "packed-and-paid",
    "ship",
    "done",
    "note-stock"
   ],
   "layout": {
    "ask-restock": [
     4,
     4
    ],
    "books-arrive": [
     5,
     4
    ]
   }
  },
  {
   "id": "fulfil-right",
   "diagram": "uml.activity",
   "title": "The same activity, laid out right",
   "parent": "fulfil",
   "direction": "right",
   "nodeIds": [
    "lane-shop",
    "lane-desk",
    "lane-warehouse",
    "lane-email",
    "start",
    "take-order",
    "order-object",
    "check-stock",
    "stock",
    "in-stock",
    "ask-restock",
    "books-arrive",
    "stock-ready",
    "split",
    "call-payment",
    "pick",
    "tell-shopper",
    "told",
    "packed-and-paid",
    "ship",
    "done",
    "note-stock"
   ]
  },
  {
   "id": "take-payment",
   "diagram": "uml.activity",
   "title": "Take payment, the activity the call opens",
   "parent": "fulfil",
   "direction": "down",
   "nodeIds": [
    "pay-start",
    "pay-again",
    "charge",
    "accepted",
    "ask-card",
    "record",
    "pay-done"
   ]
  }
 ]
}