{
  "processId" : 1,
  "id" : 1,
  "name" : "purchase",
  "locked" : false,
  "version" : 1,
  "nodes" : [
    {
      "id" : 1,
      "type" : "start",
      "name" : "workflow.start",
      "posX" : 101.0,
      "posY" : 100.0,
      "description" : null,
      "sourcePosition" : "bottom",
      "targetPosition" : "none",
      "transitions" : [
        {
          "id" : 1,
          "type" : "smoothstep",
          "name" : null,
          "color" : "#000000",
          "script" : "",
          "animated" : false,
          "source" : 1,
          "target" : 3
        }
      ],
      "script" : null,
      "form" : null,
      "assignExpr" : null,
      "dueDate" : null,
      "repeat" : null,
      "notificationSubject" : null,
      "notificationBody" : null,
      "recipients" : null,
      "subject" : null,
      "body" : null
    },
    {
      "id" : 2,
      "type" : "task",
      "name" : "run_config",
      "posX" : 205.18475907298713,
      "posY" : 70.01329864409209,
      "description" : "",
      "sourcePosition" : "bottom",
      "targetPosition" : "top",
      "transitions" : [

      ],
      "script" : null,
      "form" : "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE workflow-form PUBLIC \"-//OpenKM//DTD Workflow Form 1.0//EN\"\n                                \"https://www.openkm.com/dtd/workflow-form-1.0.dtd\">\n<workflow-form>\n  <input label=\"Purchase price\" name=\"price\" />\n    <textarea label=\"Purchase description\" name=\"description\" />\n    <button name=\"submit\" label=\"Submit\" />\n</workflow-form>",
      "assignExpr" : "return \"\";",
      "dueDate" : "",
      "repeat" : "",
      "notificationSubject" : "Workflow task assignment",
      "notificationBody" : "A workflow task has been assigned",
      "recipients" : null,
      "subject" : null,
      "body" : null
    },
    {
      "id" : 3,
      "type" : "decision",
      "name" : "Decision",
      "posX" : 100.92025799287791,
      "posY" : 275.7319615478331,
      "description" : "",
      "sourcePosition" : "bottom",
      "targetPosition" : "top",
      "transitions" : [
        {
          "id" : 3,
          "type" : "default",
          "name" : "is expensive",
          "color" : "#000000",
          "script" : null,
          "animated" : false,
          "source" : 3,
          "target" : 6
        },
        {
          "id" : 4,
          "type" : "default",
          "name" : "is cheap",
          "color" : "#8BC34A",
          "script" : null,
          "animated" : false,
          "source" : 3,
          "target" : 4
        }
      ],
      "script" : "import com.openkm.sdk4j.impl.OKMWebservices;\nimport com.openkm.sdk4j.bean.*;\nimport com.openkm.okmflow.util.*;\nimport com.openkm.okmflow.bean.*;\nimport com.openkm.bean.form.*;\nimport com.openkm.util.*;\n\nInput priceInput = (Input) context.get(\"price\");\nint price = Integer.parseInt(priceInput.getValue());\nif (price < 500) {\n  return \"is cheap\";\n} else {\n  return \"is expensive\";\n}",
      "form" : null,
      "assignExpr" : null,
      "dueDate" : null,
      "repeat" : null,
      "notificationSubject" : null,
      "notificationBody" : null,
      "recipients": null,
      "subject": null,
      "body": null
    },
    {
      "id": 4,
      "type" : "mail",
      "name" : "Approved",
      "posX": -136.90677423575954,
      "posY": 818.6753526471496,
      "description" : "",
      "sourcePosition" : "bottom",
      "targetPosition" : "top",
      "transitions": [
        {
          "id": 7,
          "type" : "default",
          "name" : "",
          "color" : "#8BC34A",
          "script": null,
          "animated": false,
          "source": 4,
          "target": 5
        }
      ],
      "script": null,
      "form": null,
      "assignExpr": null,
      "dueDate": null,
      "repeat": null,
      "notificationSubject": null,
      "notificationBody": null,
      "recipients" : "${initiator.email}",
      "subject" : "Purchase approved",
      "body" : "<p>Hi ${initiator.name}</p>\n<p>The purchase order ${node.path} have been approved</p>\n<p> </p>"
    },
    {
      "id": 5,
      "type" : "end",
      "name" : "workflow.end",
      "posX": 108.07174054058935,
      "posY": 1068.5348348167552,
      "description" : "",
      "sourcePosition": null,
      "targetPosition" : "top",
      "transitions": [

      ],
      "script": null,
      "form": null,
      "assignExpr": null,
      "dueDate": null,
      "repeat": null,
      "notificationSubject": null,
      "notificationBody": null,
      "recipients": null,
      "subject": null,
      "body": null
    },
    {
      "id": 6,
      "type": "task",
      "name": "Evaluate price",
      "posX": 258.74943163027507,
      "posY": 520.8837445652772,
      "description": "",
      "sourcePosition": "bottom",
      "targetPosition": "top",
      "transitions": [
        {
          "id": 6,
          "type": "default",
          "name": "approve",
          "color": "#8BC34A",
          "script": null,
          "animated": false,
          "source": 6,
          "target": 4
        },
        {
          "id": 11,
          "type": "smoothstep",
          "name": "deny",
          "color": "#F44336",
          "script": null,
          "animated": false,
          "source": 6,
          "target": 7
        }
      ],
      "script": null,
      "form": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE workflow-form PUBLIC \"-//OpenKM//DTD Workflow Form 1.0//EN\"\n                                \"https://www.openkm.com/dtd/workflow-form-1.0.dtd\">\n<workflow-form>\n  <input label=\"Purchase price\" name=\"price\" data=\"price\" readonly=\"true\" />\n    <textarea label=\"Purchase description\" name=\"description\" data=\"description\" readonly=\"true\" />\n    <button name=\"approve\" label=\"Approve\" transition=\"approve\"/>\n    <button name=\"deny\" label=\"Deny\" transition=\"deny\"/>\n</workflow-form>",
      "assignExpr": "return \"manager\";",
      "dueDate": "",
      "repeat": "",
      "notificationSubject": "Workflow task assignment",
      "notificationBody": "A workflow task has been assigned",
      "recipients": null,
      "subject": null,
      "body": null
    },
    {
      "id": 7,
      "type": "mail",
      "name": "Denied",
      "posX": 305.96636685850063,
      "posY": 813.1122129281537,
      "description": "",
      "sourcePosition": "bottom",
      "targetPosition": "top",
      "transitions": [
        {
          "id": 8,
          "type": "default",
          "name": "",
          "color": "#F44336",
          "script": null,
          "animated": false,
          "source": 7,
          "target": 5
        }
      ],
      "script": null,
      "form": null,
      "assignExpr": null,
      "dueDate": null,
      "repeat": null,
      "notificationSubject": null,
      "notificationBody": null,
      "recipients": "${initiator.email}",
      "subject": "Purchase denied",
      "body": "<p>Hi ${initiator.name}</p>\n<p>The purchase order ${node.path} have been revoked</p>\n<p> </p>"
    }
  ]
}
