{
  "productInfo" : {
    "company" : "HighByte",
    "product" : "IntelligenceHub",
    "version" : "4.3.0",
    "build" : "2025.10.21.317",
    "stage" : "Release"
  },
  "project" : {
    "version" : 12,
    "connections" : [ {
      "name" : "Start_Hist_MQTT",
      "uri" : "mqtt://0.0.0.0:1885",
      "tags" : [ "Start_Hist_Canary", "Start_Hist_PI_AF", "Start_Hist_PI_DA", "Start_Hist_IP21" ],
      "writes" : {
        "flattenModeledValues" : false
      },
      "subscriptions" : { },
      "storeForward" : {
        "enabled" : false,
        "maxEntries" : 100,
        "waitOnFailureInterval" : {
          "duration" : 1,
          "units" : "Seconds"
        }
      },
      "settings" : {
        "connectionTimeoutSeconds" : 10,
        "keepAliveSeconds" : 60,
        "requestTimeoutMS" : 5000,
        "cleanSession" : true,
        "ssl" : false,
        "redundantBrokers" : [ ],
        "inputDiscovery" : "",
        "clientId" : "Start_Hist_MQTT",
        "maxInflight" : 1000
      }
    }, {
      "name" : "Start_Hist_PI_AF",
      "uri" : "osisoft.afsdk://{{System.Variables.Local_IP}}:45290",
      "tags" : [ "Start_Hist_PI_AF" ],
      "writes" : {
        "flattenModeledValues" : false
      },
      "subscriptions" : { },
      "storeForward" : {
        "enabled" : false,
        "maxEntries" : 100,
        "waitOnFailureInterval" : {
          "duration" : 1,
          "units" : "Seconds"
        }
      },
      "settings" : {
        "requestTimeoutMS" : 60000,
        "compression" : "NONE",
        "auth" : {
          "type" : "credentials",
          "username" : "osisoft",
          "password" : {
            "type" : "Reference",
            "value" : "PI_User_Password"
          }
        },
        "connectTimeoutSeconds" : 5,
        "password" : {
          "type" : "Encrypted",
          "value" : {
            "keyId" : "Pd0g08wqAOrlvCQyMEHkBg==",
            "iv" : "Sdy1/pvD+EsTyNAYD0hnEQ==",
            "ciphertext" : "noh9vh5msr1bcyB8Eb81k2IY1iOu7IJkSnNaoGlqeAouyV4WfObQgJMiTgOavflT"
          }
        }
      }
    } ],
    "inputs" : [ {
      "name" : "Start_Hist_PI_AF_Asset_Metadata_Pumps",
      "connection" : "Start_Hist_PI_AF",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "assetmetadata",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : false,
          "includeAttributes" : true,
          "database" : "ReactorsDemo",
          "query" : "Name: 'Inlet Pump' OR Name: 'Outlet Pump'",
          "index" : false,
          "indexWindow" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : true,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "Start_Hist_PI_AF_Current_Values_Pumps",
      "connection" : "Start_Hist_PI_AF",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "asset",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : true,
          "includeChildren" : false,
          "database" : "ReactorsDemo",
          "query" : "Template: 'Pump'",
          "attributes" : [ "FlowRate", "Status" ],
          "index" : false,
          "indexWindow" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "Start_Hist_PI_AF_Downtime_Values",
      "connection" : "Start_Hist_PI_AF",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "asset",
        "options" : {
          "startIndex" : 0,
          "maxCount" : -1,
          "includeMetaData" : true,
          "includeChildren" : false,
          "get" : "rawValues",
          "database" : "ReactorsDemo",
          "query" : "ID: '{{this.elementID}}'",
          "endTime" : "{{this.end}}",
          "startTime" : "{{this.start}}",
          "interval" : "10m",
          "attributes" : [ "BearingTemperature", "SuctionPressure" ],
          "index" : false,
          "indexWindow" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "inline",
        "model" : {
          "name" : "params",
          "tags" : [ ],
          "attributes" : [ {
            "attributeType" : "Internal",
            "name" : "elementID",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "internalType" : "String"
          }, {
            "attributeType" : "Internal",
            "name" : "start",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "internalType" : "String"
          }, {
            "attributeType" : "Internal",
            "name" : "end",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "internalType" : "String"
          } ]
        }
      }
    }, {
      "name" : "Start_Hist_PI_AF_Event_Downtime",
      "connection" : "Start_Hist_PI_AF",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "eventframe",
        "options" : {
          "startIndex" : 0,
          "maxCount" : -1,
          "includeMetaData" : false,
          "includeChildren" : false,
          "get" : "currentValue",
          "database" : "ReactorsDemo",
          "query" : "Template: \"Downtime\" AND Start:>\"{{this.startTime}}\" AND End:<\"{{this.endTime}}\"",
          "index" : false,
          "indexWindow" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off",
        "params" : [ {
          "name" : "end_datetime",
          "pattern" : "\"2025-04-21T00:00:00.000Z\""
        } ]
      },
      "parameters" : {
        "type" : "inline",
        "model" : {
          "name" : "params",
          "tags" : [ ],
          "attributes" : [ {
            "attributeType" : "Internal",
            "name" : "startTime",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : "2025-11-03T00:00:00.0000000Z",
            "internalType" : "String"
          }, {
            "attributeType" : "Internal",
            "name" : "endTime",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : "2025-11-03T08:00:00.0000000Z",
            "internalType" : "String"
          } ]
        }
      }
    }, {
      "name" : "Start_Hist_PI_AF_Time_Span_Values_Pumps",
      "connection" : "Start_Hist_PI_AF",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "asset",
        "options" : {
          "get" : "rawValues",
          "includeMetaData" : true,
          "includeChildren" : false,
          "database" : "ReactorsDemo",
          "query" : "Template: 'Pump'",
          "attributes" : [ "FlowRate", "Status" ],
          "index" : false,
          "indexWindow" : "",
          "startTime" : "{{this.start}}",
          "endTime" : "{{this.end}}",
          "interval" : "1s"
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "inline",
        "model" : {
          "name" : "params",
          "tags" : [ ],
          "attributes" : [ {
            "attributeType" : "Internal",
            "name" : "start",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : "2025-07-09T00:00:00.0000000Z",
            "internalType" : "String"
          }, {
            "attributeType" : "Internal",
            "name" : "end",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : "2025-07-09T00:01:00.0000000Z",
            "internalType" : "String"
          } ]
        }
      }
    }, {
      "name" : "Start_Hist_PI_AF_Value_Changes_Pumps",
      "connection" : "Start_Hist_PI_AF",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "assetdatapipe",
        "options" : {
          "get" : "rawValues",
          "includeMetaData" : true,
          "includeChildren" : false,
          "database" : "ReactorsDemo",
          "query" : "Template: 'Pump'",
          "attributes" : [ "FlowRate", "Status" ],
          "index" : false,
          "indexWindow" : "",
          "startTime" : "{{this.start}}",
          "endTime" : "{{this.end}}",
          "interval" : "1s",
          "subscriptionId" : "Start_Hist_PI_AF_Value_Changes_Pumps_4"
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    } ],
    "outputs" : [ {
      "name" : "Start_Hist_PI_AF_Write_Asset",
      "connection" : "Start_Hist_PI_AF",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "Tag",
        "options" : {
          "updateOption" : "Insert",
          "database" : "ReactorsDemo",
          "path" : "{{this.assetPath}}",
          "name" : "{{this.assetName}}",
          "timestamp" : "{{this.time}}",
          "delimiter" : ".",
          "create" : true,
          "pointSource" : "Start_Hist"
        },
        "breakupArrays" : false,
        "filterList" : [ "_name", "_timestamp", "assetPath", "assetName", "time", "_model" ]
      }
    } ],
    "modeling" : {
      "models" : [ {
        "name" : "Start_Hist_Asset_Value_Changes",
        "groupAs" : "/Start_Hist_Read_Value_Changes",
        "tags" : [ "Start_Hist_PI_AF" ],
        "attributes" : [ {
          "attributeType" : "Internal",
          "name" : "asset",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "assetPath",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "attribute",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "valueNumeric",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "valueOther",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "time",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "transaction",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "source",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        } ]
      }, {
        "name" : "Start_Hist_Pump_Status",
        "groupAs" : "/Start_Hist_Read_Last_Values",
        "tags" : [ "Start_Hist_Canary", "Start_Hist_IP21", "Start_Hist_PI_AF", "Start_Hist_PI_DA" ],
        "attributes" : [ {
          "attributeType" : "Internal",
          "name" : "assetName",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "assetPath",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "flowRate",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "flowRateUOM",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "state",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "someContext1",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "someContext2",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "time",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "source",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "Any"
        } ]
      } ],
      "instances" : [ ]
    },
    "conditions" : [ ],
    "functions" : [ ],
    "tags" : [ {
      "name" : "Start_Hist_PI_AF"
    } ],
    "pipelines" : [ {
      "name" : "Start_Hist_PI_AF_Value_Changes_Pumps",
      "groupAs" : "/Start_Hist_Read_Value_Changes",
      "tags" : [ "Start_Hist_PI_AF" ],
      "inputStages" : [ "Read" ],
      "stages" : [ {
        "name" : "Read",
        "display" : {
          "position" : {
            "x" : 240,
            "y" : 0
          }
        },
        "config" : {
          "type" : ".ReadConfig",
          "failureOutputs" : [ ],
          "reference" : {
            "type" : "Input",
            "name" : "Start_Hist_PI_AF_Value_Changes_Pumps",
            "path" : "",
            "params" : { },
            "connectionName" : "Start_Hist_PI_AF"
          }
        },
        "outputs" : [ "Breakup_Object" ]
      }, {
        "name" : "Breakup_Object",
        "display" : {
          "position" : {
            "x" : 690,
            "y" : 0
          }
        },
        "config" : {
          "type" : ".BreakupConfig",
          "breakupType" : "object",
          "depth" : 1
        },
        "outputs" : [ "Breakup_Array" ]
      }, {
        "name" : "Breakup_Array",
        "display" : {
          "position" : {
            "x" : 1140,
            "y" : 0
          }
        },
        "config" : {
          "type" : ".BreakupConfig",
          "breakupType" : "array",
          "depth" : 1
        },
        "outputs" : [ "Model" ]
      }, {
        "name" : "Model",
        "display" : {
          "position" : {
            "x" : 1590,
            "y" : 0
          }
        },
        "config" : {
          "type" : ".ModelConfig",
          "model" : "Start_Hist_Asset_Value_Changes",
          "objectName" : "",
          "initExpression" : "",
          "attributes" : [ {
            "name" : "asset",
            "expression" : {
              "type" : "JavaScript",
              "expression" : "return event.value._name;"
            }
          }, {
            "name" : "assetPath",
            "expression" : {
              "type" : "JavaScript",
              "expression" : "var _path = event.value._path;\r\nvar convertedPath = \"PI_AF/\" + _path.replace(/\\\\/g, \"/\");\r\nreturn convertedPath;"
            }
          }, {
            "name" : "attribute",
            "expression" : {
              "type" : "JavaScript",
              "expression" : "return event.value.attributeName;"
            }
          }, {
            "name" : "valueNumeric",
            "expression" : {
              "type" : "JavaScript",
              "expression" : "// checks if event.value.value is not not a number (is a number), not null, not blank and is finite number (not +Infinity, or -Infinity).   If true, cast event.value.value to a number.  If false, set to null.\r\nif (!isNaN(event.value.value) && event.value.value !==null && event.value.value !== \"\" && isFinite(event.value.value))\r\n{\r\n\treturn Number(event.value.value);\r\n}\r\nelse\r\n{\r\n\treturn null;\r\n}"
            }
          }, {
            "name" : "valueOther",
            "expression" : {
              "type" : "JavaScript",
              "expression" : "// checks if event.value.value is not not a number (is a number), not null, not blank and is finite number (not +Infinity, or -Infinity).   If true, set to null.  If false, set to event.value.value.\r\nif (!isNaN(event.value.value) && event.value.value !==null && event.value.value !== \"\" && isFinite(event.value.value))\r\n{\r\n\treturn null;\r\n}\r\nelse\r\n{\r\n\treturn (event.value.value);\r\n}\r\n"
            }
          }, {
            "name" : "time",
            "expression" : {
              "type" : "JavaScript",
              "expression" : "var extendedDateStr = event.value._timestamp;\r\n// Truncate to 3 digits of milliseconds to make it a standard ISO string\r\nvar trimmedDateStr = extendedDateStr.replace(/(\\.\\d{3})\\d*Z$/, '$1Z');\r\n// Convert to Date object\r\nvar date = new Date(trimmedDateStr);\r\n// Convert back to standard ISO string (e.g., \"2025-07-09T21:21:35.000Z\")\r\nvar standardISOString = date.toISOString();\r\nreturn standardISOString;"
            }
          }, {
            "name" : "transaction",
            "expression" : {
              "type" : "JavaScript",
              "expression" : "return event.metadata.breakupName;"
            }
          }, {
            "name" : "source",
            "expression" : {
              "type" : "JavaScript",
              "expression" : "return \"PI_AF\""
            }
          } ]
        },
        "outputs" : [ "To_MQTT" ]
      }, {
        "name" : "To_MQTT",
        "display" : {
          "position" : {
            "x" : 2040,
            "y" : 0
          }
        },
        "config" : {
          "type" : ".DynamicWriteConfig",
          "failureOutputs" : [ ],
          "connectionReference" : "{{Connection.Start_Hist_MQTT}}",
          "qualifier" : {
            "topic" : "{{event.value.assetPath}}/{{event.value.attribute}}",
            "qos" : 0,
            "namedRoot" : false,
            "retained" : false,
            "breakupArrays" : false,
            "filterList" : [ "_name", "_model", "_timestamp" ],
            "type" : "Tag"
          },
          "qualifierExpression" : "",
          "writeReturn" : "ignore"
        },
        "outputs" : [ ]
      } ],
      "trackActivity" : false,
      "triggers" : [ {
        "name" : "Polled_Trigger",
        "display" : {
          "position" : {
            "x" : -450,
            "y" : 0
          }
        },
        "config" : {
          "type" : ".TriggerPolled",
          "enabled" : false,
          "interval" : {
            "duration" : 15,
            "units" : "Seconds"
          }
        }
      } ],
      "errorHandler" : {
        "type" : "default"
      }
    } ],
    "namespace" : [ ]
  },
  "network" : {
    "groups" : [ ],
    "hubs" : [ ]
  }
}