{
  "productInfo" : {
    "company" : "HighByte",
    "product" : "IntelligenceHub",
    "version" : "4.5.0",
    "build" : "2026.8.14.399",
    "stage" : "Release"
  },
  "project" : {
    "version" : 14,
    "connections" : [ {
      "name" : "kepserverex_sp",
      "uri" : "opc.tcp://{{System.Variables.central_host}}:49320",
      "groupAs" : "/solution_patterns",
      "description" : "This is a Connection to KEPServerEX and a simulation for 10,000+ pumps each with 10 process values changing every second.\nThis Connection supports solution patterns.",
      "tags" : [ "historian1_historization", "telemetry1_value_opc", "telemetry2_asset_opc" ],
      "writes" : {
        "flattenModeledValues" : false
      },
      "writeThrottle" : {
        "enabled" : false,
        "maxBatchSizePerTarget" : 1000,
        "batchDelay" : {
          "duration" : 20,
          "units" : "Milliseconds"
        }
      },
      "subscriptions" : {
        "subscriptionRate" : {
          "duration" : 500,
          "units" : "Milliseconds"
        }
      },
      "storeForward" : {
        "enabled" : false,
        "maxEntries" : 100,
        "waitOnFailureInterval" : {
          "duration" : 1,
          "units" : "Seconds"
        }
      },
      "settings" : {
        "security" : "None",
        "authentication" : {
          "type" : "Anonymous"
        },
        "connectTimeoutSeconds" : 5,
        "requestTimeoutMS" : 5000,
        "maxItemsPerRead" : 2048,
        "maxItemsPerWrite" : 32,
        "sessionName" : "",
        "identifierMode" : "NodeId",
        "mcpEnabled" : "disabled"
      }
    }, {
      "name" : "pi_sp",
      "uri" : "osisoft.afsdk://{{System.Variables.reference_host}}:45299",
      "groupAs" : "/solution_patterns",
      "description" : "This is a Connection to AVEVA PI System.  \nThis Connection supports solution patterns.  \nHighByte note: this Connection uses a dedicated agent installed on a demo system EC2.",
      "tags" : [ "historian1_historization", "historian2_replication", "historian3_specialization" ],
      "writes" : {
        "flattenModeledValues" : false
      },
      "writeThrottle" : {
        "enabled" : false,
        "maxBatchSizePerTarget" : 1000,
        "batchDelay" : {
          "duration" : 20,
          "units" : "Milliseconds"
        }
      },
      "subscriptions" : { },
      "storeForward" : {
        "enabled" : false,
        "maxEntries" : 100,
        "waitOnFailureInterval" : {
          "duration" : 1,
          "units" : "Seconds"
        }
      },
      "settings" : {
        "connectTimeoutSeconds" : 5,
        "requestTimeoutMS" : 120000,
        "compression" : "GZIP",
        "auth" : {
          "type" : "credentials",
          "username" : "osisoft",
          "password" : {
            "type" : "Reference",
            "value" : "pi_password"
          }
        },
        "password" : {
          "type" : "Reference",
          "value" : "pi_token_reference"
        }
      }
    }, {
      "name" : "postgresql_sp",
      "uri" : "jdbc.postgresql://{{System.Variables.connections_host}}:5432",
      "groupAs" : "/solution_patterns",
      "description" : "This is a Connection to the local PostgreSQL database.  This Connection supports Solution Patterns.",
      "tags" : [ "historian1_historization", "historian2_replication", "historian3_specialization", "telemetry1_value_opc", "telemetry1_value_sparkplug", "telemetry2_asset_opc", "telemetry2_asset_sparkplug", "telemetry3_downtime", "telemetry4_maintenance" ],
      "writes" : {
        "flattenModeledValues" : false
      },
      "writeThrottle" : {
        "enabled" : false,
        "maxBatchSizePerTarget" : 1000,
        "batchDelay" : {
          "duration" : 20,
          "units" : "Milliseconds"
        }
      },
      "subscriptions" : { },
      "storeForward" : {
        "enabled" : true,
        "maxEntries" : 2000,
        "waitOnFailureInterval" : {
          "duration" : 10,
          "units" : "Seconds"
        }
      },
      "settings" : {
        "strategy" : {
          "type" : "default"
        },
        "database" : "solution_patterns",
        "username" : "postgres",
        "password" : {
          "type" : "Reference",
          "value" : "postgresql_password"
        },
        "connectString" : "reWriteBatchedInserts=true&stringtype=unspecified"
      }
    } ],
    "inputs" : [ {
      "name" : "opc_input_pump_parameterized",
      "connection" : "kepserverex_sp",
      "type" : "opc.tcp",
      "qualifier" : {
        "type" : "Collection",
        "samplingInterval" : {
          "duration" : 0,
          "units" : "Seconds"
        },
        "isComplex" : false,
        "maxDepth" : 1,
        "cacheInterval" : {
          "duration" : 1,
          "units" : "Hours"
        },
        "ignoreBadQuality" : false,
        "browseVariableNodes" : false,
        "collection" : [ {
          "name" : "dischargePressure",
          "identifier" : {
            "type" : "NodeId",
            "namespaceIndex" : "2",
            "identifierType" : "String",
            "value" : "{{this.dischargePressure}}"
          }
        }, {
          "name" : "flowRate",
          "identifier" : {
            "type" : "NodeId",
            "namespaceIndex" : "2",
            "identifierType" : "String",
            "value" : "{{this.flowRate}}"
          }
        }, {
          "name" : "intakePressure",
          "identifier" : {
            "type" : "NodeId",
            "namespaceIndex" : "2",
            "identifierType" : "String",
            "value" : "{{this.intakePressure}}"
          }
        } ]
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "inline",
        "model" : {
          "name" : "params",
          "tags" : [ ],
          "attributes" : [ {
            "attributeType" : "Internal",
            "name" : "dischargePressure",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : "Channel1.PumpDevice.OutboundFlowPressure1",
            "internalType" : {
              "variant" : "String"
            }
          }, {
            "attributeType" : "Internal",
            "name" : "flowRate",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : "Channel1.PumpDevice.TargetNozzleFlowRate1",
            "internalType" : {
              "variant" : "String"
            }
          }, {
            "attributeType" : "Internal",
            "name" : "intakePressure",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : "Channel1.PumpDevice.ThroatFlowPressure1",
            "internalType" : {
              "variant" : "String"
            }
          } ],
          "modelVersion" : ""
        }
      }
    }, {
      "name" : "opc_input_value_to_pi_templated",
      "connection" : "kepserverex_sp",
      "type" : "opc.tcp",
      "qualifier" : {
        "type" : "Tag",
        "identifier" : {
          "type" : "NodeId",
          "namespaceIndex" : "2",
          "identifierType" : "String",
          "value" : "{{this.opcTagPath}}"
        },
        "samplingInterval" : {
          "duration" : 0,
          "units" : "Seconds"
        },
        "isComplex" : true
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "name" : "{{this.piPoint}}",
        "type" : "Dynamic",
        "reference" : "{{Connection.postgresql_sp.postgresql_input_north_field_opc_tags_pi_point}}"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "opc_input_value_to_sql_templated",
      "connection" : "kepserverex_sp",
      "type" : "opc.tcp",
      "qualifier" : {
        "type" : "Tag",
        "identifier" : {
          "type" : "NodeId",
          "namespaceIndex" : "2",
          "identifierType" : "String",
          "value" : "{{this.opcTagPath}}"
        },
        "samplingInterval" : {
          "duration" : 0,
          "units" : "Seconds"
        },
        "isComplex" : true
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "name" : "{{this.path}}",
        "type" : "Dynamic",
        "reference" : "{{Connection.postgresql_sp.postgresql_input_north_field_opc_tags_attribute}}"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "pi_input_current_values_maintenance",
      "connection" : "pi_sp",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "point",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : true,
          "useReference" : true,
          "points" : [ ],
          "query" : "",
          "index" : false,
          "indexWindow" : "",
          "calcBasis" : "timeWeighted",
          "format" : "JSON",
          "reference" : "{{this.reference}}"
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ {
        "path" : "options.reference",
        "reference" : "{{this.reference}}"
      } ],
      "parameters" : {
        "type" : "inline",
        "model" : {
          "name" : "params",
          "tags" : [ ],
          "attributes" : [ {
            "attributeType" : "Internal",
            "name" : "reference",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : [ "Grains.05071eb9-fcdd-11ee-ba85-060be97f82e1.Value Imperial", "Grains.05071ebc-fcdd-11ee-ba85-060be97f82e1.Value Imperial", "Grains.05071ebf-fcdd-11ee-ba85-060be97f82e1.Value Imperial", "Grains.05071ec2-fcdd-11ee-ba85-060be97f82e1.Value Imperial", "Grains.05071ec5-fcdd-11ee-ba85-060be97f82e1.Value Imperial", "Grains.05071ec8-fcdd-11ee-ba85-060be97f82e1.Value Imperial", "Grains.05071ecb-fcdd-11ee-ba85-060be97f82e1.Value Imperial", "Grains.05071ed2-fcdd-11ee-ba85-060be97f82e1.Value Imperial", "Grains.05071ed5-fcdd-11ee-ba85-060be97f82e1.Value Imperial", "Grains.05071edc-fcdd-11ee-ba85-060be97f82e1.Value Imperial" ],
            "internalType" : {
              "variant" : "String"
            }
          } ],
          "modelVersion" : ""
        }
      }
    }, {
      "name" : "pi_input_point_subscription",
      "connection" : "pi_sp",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "pointdatapipe",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : true,
          "useReference" : true,
          "format" : "JSON",
          "reference" : "{{Connection.pi_sp.pi_input_points_list}}",
          "subscriptionId" : "pi_input_point_subscription_08-15",
          "maxPerRead" : 10000,
          "query" : "",
          "index" : false,
          "indexWindow" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "pi_input_points_list",
      "connection" : "pi_sp",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "pointbrowse",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : true,
          "query" : "*Grains*",
          "index" : false,
          "indexWindow" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : true,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "pi_input_verify_pi_point_update",
      "connection" : "pi_sp",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "point",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : true,
          "useReference" : false,
          "points" : [ "Grains.05071f35-fcdd-11ee-ba85-060be97f82e1.Value Imperial" ],
          "query" : "",
          "index" : false,
          "indexWindow" : "",
          "calcBasis" : "timeWeighted",
          "format" : "JSON"
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "postgresql_input_downtime_event",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "type" : "query",
        "query" : "SELECT * FROM \"public\".\"downtime_event\" ORDER BY \"startTime\" DESC LIMIT 100;",
        "index" : {
          "enabled" : false,
          "indexName" : "",
          "indexValue" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "postgresql_input_north_field_opc_tags_attribute",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "type" : "query",
        "query" : "SELECT\n  replace(regexp_replace(topic, '^PermianBasin/NorthField/', ''), '/', '.') AS \"opcTagPath\",\n  substring(path from '[^/]+$')                                             AS \"newAttribute\",\n  path\nFROM path_mapping\nWHERE topic LIKE '%NorthField%'\n  AND (substring(topic from 'Channel(\\d+)/'))::int <= 10;",
        "index" : {
          "enabled" : false,
          "indexName" : "",
          "indexValue" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "postgresql_input_north_field_opc_tags_pi_point",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "type" : "query",
        "query" : "SELECT\n  replace(regexp_replace(topic, '^PermianBasin/NorthField/', ''), '/', '.') AS \"opcTagPath\",\n  substring(path from '[^/]+$')                                             AS \"newAttribute\",\n  path,\n  \"piPoint\"\nFROM path_mapping\nWHERE topic LIKE '%NorthField%'\n  AND (substring(topic from 'Channel(\\d+)/'))::int <= 10;",
        "index" : {
          "enabled" : false,
          "indexName" : "",
          "indexValue" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "postgresql_input_north_field_opc_tags_pump",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "type" : "query",
        "query" : "-- One row per asset. Three OPC UA tag paths pivoted into columns.\n-- opcTagPath = topic, dot-delimited, 'PermianBasin/NorthField/' prefix removed.\n-- path = asset path (full path minus the metric leaf).\nSELECT\n  regexp_replace(path, '/[^/]*$', '')                                          AS \"path\",\n  MAX(CASE WHEN topic ~ '/OutboundFlowPressure[0-9]+$'\n      THEN replace(regexp_replace(topic, '^PermianBasin/NorthField/', ''), '/', '.') END) AS \"dischargePressure\",\n  MAX(CASE WHEN topic ~ '/TargetNozzleFlowRate[0-9]+$'\n      THEN replace(regexp_replace(topic, '^PermianBasin/NorthField/', ''), '/', '.') END) AS \"flowRate\",\n  MAX(CASE WHEN topic ~ '/ThroatFlowPressure[0-9]+$'\n      THEN replace(regexp_replace(topic, '^PermianBasin/NorthField/', ''), '/', '.') END) AS \"intakePressure\"\nFROM path_mapping\nWHERE topic LIKE '%NorthField%'\n  AND (topic ~ '/OutboundFlowPressure[0-9]+$'\n    OR topic ~ '/TargetNozzleFlowRate[0-9]+$'\n    OR topic ~ '/ThroatFlowPressure[0-9]+$')\nGROUP BY regexp_replace(path, '/[^/]*$', '')\nORDER BY \"path\";",
        "index" : {
          "enabled" : false,
          "indexName" : "",
          "indexValue" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "postgresql_input_process_data",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "type" : "query",
        "query" : "SELECT * FROM \"public\".\"process_data\" ORDER BY \"inserted_at\"  DESC LIMIT 100;",
        "index" : {
          "enabled" : false,
          "indexName" : "",
          "indexValue" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "postgresql_input_pumps_centrifugal",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "type" : "query",
        "query" : "SELECT * FROM \"public\".\"process_data_pumps_centrifugal\"",
        "index" : {
          "enabled" : false,
          "indexName" : "",
          "indexValue" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "postgresql_input_south_field_maintenance_data",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "type" : "query",
        "query" : "SELECT\n    regexp_replace(\"path\", '/[^/]+$', '') AS \"path\",\n    MAX(\"workCenter\") AS \"workCenter\",\n    MAX(CASE WHEN topic LIKE '%MotorCurrent%' THEN \"piPoint\" END) AS \"MotorCurrent\",\n    MAX(CASE WHEN topic LIKE '%MotorTemp%'    THEN \"piPoint\" END) AS \"MotorTemp\"\nFROM path_mapping\nWHERE split_part(topic, '/', 2) = 'SouthField'\n  AND substring(split_part(topic, '/', 3) FROM 4)::int <= 5\n  AND \"path\" LIKE '%{{this.assetPath}}%'\n  AND (topic LIKE '%MotorCurrent%' OR topic LIKE '%MotorTemp%')\nGROUP BY regexp_replace(\"path\", '/[^/]+$', '')\nORDER BY \"path\";",
        "index" : {
          "enabled" : false,
          "indexName" : "",
          "indexValue" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "inline",
        "model" : {
          "name" : "params",
          "tags" : [ ],
          "attributes" : [ {
            "attributeType" : "Internal",
            "name" : "assetPath",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : "site01/area01/line01/asset01",
            "internalType" : {
              "variant" : "String"
            }
          } ],
          "modelVersion" : ""
        }
      }
    }, {
      "name" : "postgresql_input_south_field_maintenance_status",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "type" : "query",
        "query" : "SELECT\n    split_part(topic, '/', 1)                       AS \"group\",\n    split_part(topic, '/', 2)                       AS \"edgeNode\",\n    split_part(topic, '/', 3)                       AS \"device\",\n    regexp_replace(topic, '^([^/]+/){3}', '')       AS \"metric\",\n    path                                            AS \"path\",\n    \"workCenter\",\n    replace(regexp_replace(topic, '^([^/]+/){3}', ''), '/', '.') AS \"metricDecimal\"\nFROM path_mapping\nWHERE split_part(topic, '/', 2) = 'SouthField'\n  AND substring(split_part(topic, '/', 3) FROM 4)::int <= 5\n  AND \"path\" LIKE '%{{this.assetPath}}%'\n  AND topic LIKE '%RunStatus%'\nORDER BY topic;",
        "index" : {
          "enabled" : false,
          "indexName" : "",
          "indexValue" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "inline",
        "model" : {
          "name" : "params",
          "tags" : [ ],
          "attributes" : [ {
            "attributeType" : "Internal",
            "name" : "assetPath",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : "site01/area01/line01/asset01",
            "internalType" : {
              "variant" : "String"
            }
          } ],
          "modelVersion" : ""
        }
      }
    }, {
      "name" : "postgresql_input_south_field_sparkplug_run_status",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "type" : "query",
        "query" : "SELECT\n    split_part(topic, '/', 1)                       AS \"group\",\n    split_part(topic, '/', 2)                       AS \"edgeNode\",\n    split_part(topic, '/', 3)                       AS \"device\",\n    regexp_replace(topic, '^([^/]+/){3}', '')       AS \"metric\",\n    regexp_replace(path, '/[^/]*$', '')             AS \"path\",\n    regexp_replace(path, '.*/', '')                 AS \"newAttribute\",\n    replace(regexp_replace(topic, '^([^/]+/){3}', ''), '/', '.') AS \"metricDecimal\"\nFROM path_mapping\nWHERE split_part(topic, '/', 2) = 'SouthField'\n  AND substring(split_part(topic, '/', 3) FROM 4)::int <= 5\n  AND topic LIKE '%RunStatus%'\nORDER BY topic;",
        "index" : {
          "enabled" : false,
          "indexName" : "",
          "indexValue" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "postgresql_input_south_field_sparkplug_topics_attribute",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "type" : "query",
        "query" : "SELECT\n    split_part(topic, '/', 1)                       AS \"group\",\n    split_part(topic, '/', 2)                       AS \"edgeNode\",\n    split_part(topic, '/', 3)                       AS \"device\",\n    regexp_replace(topic, '^([^/]+/){3}', '')       AS \"metric\",\n    path                                            AS \"path\",\n    regexp_replace(path, '.*/', '')                 AS \"newAttribute\",\n    replace(regexp_replace(topic, '^([^/]+/){3}', ''), '/', '.') AS \"metricDecimal\"\nFROM path_mapping\nWHERE split_part(topic, '/', 2) = 'SouthField'\n  AND substring(split_part(topic, '/', 3) FROM 4)::int <= 5\nORDER BY topic;",
        "index" : {
          "enabled" : false,
          "indexName" : "",
          "indexValue" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "postgresql_input_south_field_sparkplug_topics_well",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "type" : "query",
        "query" : "SELECT\n    split_part(topic, '/', 1)                       AS \"group\",\n    split_part(topic, '/', 2)                       AS \"edgeNode\",\n    split_part(topic, '/', 3)                       AS \"device\",\n    split_part(topic, '/', 4)                       AS \"metric\",\n    regexp_replace(path, '/[^/]*$', '')             AS \"path\"\nFROM path_mapping\nWHERE split_part(topic, '/', 2) = 'SouthField'\n  AND substring(split_part(topic, '/', 3) FROM 4)::int <= 5\nORDER BY topic;",
        "index" : {
          "enabled" : false,
          "indexName" : "",
          "indexValue" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "referenceMap" : [ ],
      "parameters" : {
        "type" : "EmptyParameters"
      }
    } ],
    "outputs" : [ {
      "name" : "pi_output_point",
      "connection" : "pi_sp",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "point",
        "breakupArrays" : false,
        "options" : {
          "updateOption" : "Insert",
          "create" : true
        },
        "filterList" : [ "_name", "_model", "_timestamp" ]
      }
    }, {
      "name" : "postgresql_output_downtime_event_end",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "writeType" : "update",
        "createOption" : "off",
        "breakupArrays" : false,
        "tableCacheInterval" : {
          "duration" : 1,
          "units" : "Hours"
        },
        "table" : "downtime_event",
        "whereColumn" : "\"path\" = '{{this.path}}'\n  AND \"endTime\" IS NULL\n  AND \"startTime\" IS NOT NULL\n  AND '{{this.endTime}}'::timestamp >= \"startTime\" + INTERVAL '1 minute';",
        "logAsJSON" : false,
        "filterList" : [ "_name", "_model", "_timestamp" ]
      }
    }, {
      "name" : "postgresql_output_downtime_event_start",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "writeType" : "insert",
        "createOption" : "off",
        "breakupArrays" : false,
        "tableCacheInterval" : {
          "duration" : 1,
          "units" : "Hours"
        },
        "table" : "downtime_event",
        "whereColumn" : "",
        "logAsJSON" : false,
        "filterList" : [ "_name", "_model", "_timestamp" ]
      }
    }, {
      "name" : "postgresql_output_process_data",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "writeType" : "insert",
        "createOption" : "off",
        "breakupArrays" : false,
        "tableCacheInterval" : {
          "duration" : 1,
          "units" : "Hours"
        },
        "table" : "process_data",
        "whereColumn" : "",
        "logAsJSON" : false,
        "filterList" : [ "_model", "_name", "_timestamp" ]
      }
    }, {
      "name" : "postgresql_output_process_data_pumps_centrifugal",
      "connection" : "postgresql_sp",
      "type" : "jdbc.postgresql",
      "qualifier" : {
        "writeType" : "upsert",
        "createOption" : "create",
        "breakupArrays" : false,
        "tableCacheInterval" : {
          "duration" : 1,
          "units" : "Hours"
        },
        "table" : "process_data_pumps_centrifugal",
        "whereColumn" : "\"path\" = '{{this.path}}'",
        "filterList" : [ "_name", "_model", "_timestamp" ],
        "logAsJSON" : false
      }
    } ],
    "modeling" : {
      "models" : [ {
        "name" : "value_pi",
        "groupAs" : "/historian",
        "tags" : [ "historian1_historization" ],
        "attributes" : [ {
          "attributeType" : "Internal",
          "name" : "piPoint",
          "nullable" : false,
          "required" : true,
          "array" : false,
          "internalType" : {
            "variant" : "String"
          }
        }, {
          "attributeType" : "Internal",
          "name" : "value",
          "nullable" : false,
          "required" : true,
          "array" : false,
          "internalType" : {
            "variant" : "Any"
          }
        }, {
          "attributeType" : "Internal",
          "name" : "_timestamp",
          "nullable" : false,
          "required" : true,
          "array" : false,
          "internalType" : {
            "variant" : "DateTime"
          }
        } ],
        "modelVersion" : ""
      } ],
      "instances" : [ ]
    },
    "conditions" : [ ],
    "functions" : [ ],
    "tags" : [ {
      "name" : "historian1_historization"
    } ],
    "pipelines" : [ {
      "name" : "value_opc_to_pi",
      "description" : "This Pipeline obtains values from KEPServerEX on change.  The values are written to AVEVA PI System Data Archive.",
      "groupAs" : "/historian",
      "tags" : [ "historian1_historization" ],
      "inputStages" : [ "apply_model" ],
      "stages" : [ {
        "name" : "timed_buffer",
        "display" : {
          "position" : {
            "x" : 690,
            "y" : 0
          }
        },
        "description" : "This Stage creates and array of value changes so that they can be written to AVEVA PI System efficiently.  ",
        "config" : {
          "type" : ".TimedBufferConfig",
          "windowExpression" : "stage.setBufferKey(null);",
          "windowInterval" : {
            "duration" : 1,
            "units" : "Seconds"
          }
        },
        "outputs" : [ "transform_values" ]
      }, {
        "name" : "transform_values",
        "display" : {
          "position" : {
            "x" : 1140,
            "y" : 0
          }
        },
        "description" : "This Stage uses JSONata to assign the value to the PI Point name.  It processes and array of values.",
        "config" : {
          "type" : ".JSONataTransformConfig",
          "transformExpression" : "$map(event.value, function($v) {\r\n    {\r\n        $v.piPoint: $v.value,\r\n        \"_timestamp\": $v._timestamp\r\n    }\r\n})"
        },
        "outputs" : [ "to_pi" ]
      }, {
        "name" : "apply_model",
        "display" : {
          "position" : {
            "x" : 240,
            "y" : 0
          }
        },
        "description" : "This Stage formats the incoming values.",
        "config" : {
          "type" : ".ModelConfig",
          "model" : "value_pi",
          "objectName" : "",
          "initExpression" : "",
          "attributes" : [ {
            "name" : "piPoint",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.metadata.parameters.piPoint"
            }
          }, {
            "name" : "value",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value.value"
            }
          }, {
            "name" : "_timestamp",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value._tagTimestamp"
            }
          } ],
          "expandArray" : false
        },
        "outputs" : [ "timed_buffer" ]
      }, {
        "name" : "to_pi",
        "display" : {
          "position" : {
            "x" : 1590,
            "y" : 0
          }
        },
        "description" : "This Stage writes values to AVEVA PI System.",
        "config" : {
          "type" : ".WriteConfig",
          "failureOutputs" : [ ],
          "references" : [ "{{Connection.pi_sp.pi_output_point}}" ],
          "eventPath" : "",
          "writeReturn" : "ignore"
        },
        "outputs" : [ ]
      } ],
      "trackActivity" : false,
      "queueSize" : 10000,
      "triggers" : [ {
        "name" : "event_trigger",
        "display" : {
          "position" : {
            "x" : -450,
            "y" : 0
          }
        },
        "description" : "The Pipeline is triggered when a value changes.",
        "config" : {
          "type" : ".TriggerEvent",
          "enabled" : false,
          "reference" : {
            "type" : "Input",
            "name" : "opc_input_value_to_pi_templated",
            "path" : "",
            "params" : { },
            "connectionName" : "kepserverex_sp"
          },
          "outputMode" : "ALL"
        }
      } ],
      "errorHandler" : {
        "type" : "default"
      }
    } ],
    "namespace" : [ ],
    "lookupMap" : [ ],
    "servers" : {
      "i3x" : {
        "historyReadPipeline" : {
          "type" : "Empty"
        },
        "writePipeline" : {
          "type" : "Empty"
        }
      }
    }
  },
  "network" : {
    "groups" : [ ],
    "hubs" : [ ]
  }
}