[
  {
      "element": "flow",
      "id": "newProperty",
      "config": {
          "category": "gazetteer",
          "label": "Make a new property",
          "description": "Create a new property",
          "instigators": ["newTab"]
      }
  },
  {
    "element": "activity",
    "id": "start",
    "path": "newProperty",
    "config": {
      "activityType": "start",
      "config": {
      }
    }
  },

  {
    "element": "goto",
    "path": "newProperty.start",
    "config": {
      "state": "finished",
      "targetActivityId": "grabBlpuLists"
    }
  },




  {
    "element": "activity",
    "id": "grabBlpuLists",
    "path": "newProperty",
    "config": {
      "activityType": "grabLists",
      "config": {
        "listIds": [
          "logicalStatusCodes",
          "blpuStates",
          "rpcCodes",
          "postalAddressCodes",
          "languageCodes",
          "usrnMatchIndicatorCodes",
          "officialFlagCodes",
          "postcodeTypeCodes",
          "xrefSources"
        ],
        "targetActivityId": "showPropertyCreateUi"
      }
    }
  },

  {
    "element": "goto",
    "path": "newProperty.grabBlpuLists",
    "config": {
      "state": "finished",
      "targetActivityId": "setUprn"
    }
  },




  {
    "element": "activity",
    "id": "setUprn",
    "path": "newProperty",
    "config": {
      "activityType": "setValueFromCounter",
      "config": {
        "counterId": "uprnCounter",
        "targetActivityId": "showPropertyCreateUi",
        "path": "uprn"
      }
    }
  },

  {
    "element": "goto",
    "path": "newProperty.setUprn",
    "config": {
      "state": "finished",
      "targetActivityId": "setDefaults"
    }
  },



  {
    "element": "activity",
    "id": "setDefaults",
    "path": "newProperty",
    "config": {
      "activityType": "setDefaults",
      "config": {
        "targetActivityId": "showPropertyCreateUi",
        "defaults": {

          "logicalStatus": 1,
          "blpuState": 2,
          "startDate": "[[DATE(1900-01-01)]]",
          "blpuStateDate": "[[DATE(1900-01-01)]]",
          "rpc": 1,
          "blpuStateDate": "[[TODAY]]",
          "lastUpdateDate": "[[TODAY]]",
          "entryDate": "[[TODAY]]",
          "postalAddress": "S",

          "xCoordinate": 400000,
          "yCoordinate": 300000
        }
      }
    }
  },

  {
    "element": "goto",
    "path": "newProperty.setDefaults",
    "config": {
      "state": "finished",
      "targetActivityId": "showPropertyCreateUi"
    }
  },



  {
        "element": "activity",
        "id": "showPropertyCreateUi",
        "path": "newProperty",
        "config": {
            "activityType": "showUi",
            "config": {
                "uiId": "propertyCreateUi"
            }
        }
    },
    {
        "element": "goto",
        "path": "newProperty.showPropertyCreateUi",
        "config": {
            "state": "finished",
            "targetActivityId": "saveData"
        }
    },
    {
        "element": "activity",
        "id": "saveData",
        "path": "newProperty",
        "config": {
            "activityType": "saveData",
            "config": {
                "sourceDataActivityId": "showPropertyCreateUi",
                "method": "post",
                "schema": "blpus"
            }
        }
    },
    {
        "element": "goto",
        "path": "newProperty.saveData",
        "config": {
            "state": "finished",
            "targetActivityId": "finish"
        }
    },
  {
    "element": "goto",
    "path": "newProperty.saveData",
    "config": {
      "state": "failed",
      "targetActivityId": "showPropertyCreateUi"
    }
  }

]
