{
  "productInfo" : {
    "company" : "HighByte",
    "product" : "IntelligenceHub",
    "version" : "4.4.1",
    "build" : "2026.4.14.7",
    "stage" : "Release"
  },
  "project" : {
    "version" : 13,
    "connections" : [ {
      "name" : "mqtt",
      "uri" : "mqtt://localhost:1889",
      "description" : "This is a Connection to the Intelligence Hub MQTT broker created for the purpose of viewing Pipeline outputs.",
      "tags" : [ "starter_canary", "starter_ip21", "starter_pi_af", "starter_pi_da" ],
      "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" : {
        "connectionTimeoutSeconds" : 10,
        "keepAliveSeconds" : 60,
        "requestTimeoutMS" : 5000,
        "maxInflight" : 1000,
        "cleanSession" : true,
        "mcpEnabled" : "disabled",
        "ssl" : false,
        "redundantBrokers" : [ ],
        "inputDiscovery" : "",
        "clientId" : "Intelligence_Hub_Reference"
      }
    }, {
      "name" : "pi_da",
      "uri" : "osisoft.afsdk://{{System.Variables.host_reference}}:45299",
      "description" : "This is a Connection to AVEVA PI System.  The purpose of the Connection is to obtain data for starter solution examples and, specifically starter solutions related to PI Data Archive.  HighByte note: this Connection uses a dedicated agent installed on a demo system EC2.",
      "tags" : [ "starter_pi_da" ],
      "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"
        }
      }
    } ],
    "inputs" : [ {
      "name" : "mqtt_input_value_changes_test",
      "connection" : "mqtt",
      "type" : "mqtt",
      "qualifier" : {
        "inputType" : "LastPublish",
        "payloadType" : "json",
        "qos" : 0,
        "topic" : "testValue",
        "includeTopic" : true
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "pi_da_input_current_values",
      "connection" : "pi_da",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "point",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : true,
          "useReference" : false,
          "query" : "",
          "index" : false,
          "indexWindow" : "",
          "calcBasis" : "timeWeighted",
          "points" : [ "{{this.flow}}", "{{this.status}}" ]
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "inline",
        "model" : {
          "name" : "params",
          "tags" : [ ],
          "attributes" : [ {
            "attributeType" : "Internal",
            "name" : "flow",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : "OSIDemo_Line 1.Inlet Pump.Flow Rate.71d17760-99ae-5bcc-3123-3ca8750adb04",
            "internalType" : "String"
          }, {
            "attributeType" : "Internal",
            "name" : "status",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : "OSIDemo_Line 1.Inlet Pump.Status.794e1058-b3b2-54ff-0364-8e5b16aaee56",
            "internalType" : "String"
          } ]
        }
      }
    }, {
      "name" : "pi_da_input_metadata_points",
      "connection" : "pi_da",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "pointbrowse",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : true,
          "includeChildren" : true,
          "query" : "OSIDemo_Line*p.Flow* OR OSIDemo_Line*p.Status*",
          "index" : false,
          "indexWindow" : "",
          "additionalMetadataProperties" : [ "changedate" ]
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "pi_da_input_point_list",
      "connection" : "pi_da",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "pointbrowse",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : true,
          "query" : "OSIDemo_Line*p.Flow* OR OSIDemo_Line*p.Status*",
          "index" : false,
          "indexWindow" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : true,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "pi_da_input_points_for_current_values",
      "connection" : "pi_da",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "pointbrowse",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : true,
          "query" : "OSIDemo_Line 1*p.Flow* OR OSIDemo_Line 1*p.Status* OR OSIDemo_Line 2*p.Flow* OR OSIDemo_Line 2*p.Status*",
          "index" : false,
          "indexWindow" : "",
          "additionalMetadataProperties" : [ ]
        }
      },
      "cacheLifetime" : {
        "enabled" : true,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "pi_da_input_points_for_time_span",
      "connection" : "pi_da",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "pointbrowse",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : true,
          "query" : "OSIDemo_Line*p.Flow* OR OSIDemo_Line*p.Status*",
          "index" : false,
          "indexWindow" : "",
          "additionalMetadataProperties" : [ ]
        }
      },
      "cacheLifetime" : {
        "enabled" : true,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "pi_da_input_points_for_value_changes",
      "connection" : "pi_da",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "pointbrowse",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : true,
          "query" : "OSIDemo_Line*",
          "index" : false,
          "indexWindow" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : true,
        "interval" : {
          "duration" : 1,
          "units" : "Days"
        }
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "pi_da_input_value_changes",
      "connection" : "pi_da",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "pointdatapipe",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : true,
          "useReference" : true,
          "maxPerRead" : 10000,
          "reference" : "{{Connection.pi_da.pi_da_input_points_for_value_changes}}",
          "subscriptionId" : "pi_da_input_value_changes_5_26",
          "query" : "",
          "index" : false,
          "indexWindow" : ""
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "pi_da_input_values_time_span",
      "connection" : "pi_da",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "point",
        "options" : {
          "get" : "rawValues",
          "includeMetaData" : true,
          "includeChildren" : true,
          "useReference" : true,
          "boundaryType" : "inside",
          "startTime" : "{{this.startTime}}",
          "endTime" : "{{this.endTime}}",
          "query" : "",
          "index" : false,
          "indexWindow" : "",
          "calcBasis" : "timeWeighted",
          "points" : [ "{{this.tagList}}]]]" ],
          "reference" : "{{Connection.pi_da.pi_da_input_points_for_time_span}}"
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "inline",
        "model" : {
          "name" : "params",
          "tags" : [ ],
          "attributes" : [ {
            "attributeType" : "Internal",
            "name" : "startTime",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "internalType" : "String"
          }, {
            "attributeType" : "Internal",
            "name" : "endTime",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "internalType" : "String"
          } ]
        }
      }
    }, {
      "name" : "pi_da_input_verify_write",
      "connection" : "pi_da",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "point",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : true,
          "useReference" : false,
          "points" : [ "path2.testValue3", "path3.subPath.testValue4", "staticPath.testValue2", "dynamicPath.testValue" ],
          "query" : "",
          "index" : false,
          "indexWindow" : "",
          "calcBasis" : "timeWeighted"
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    } ],
    "outputs" : [ {
      "name" : "pi_output_value",
      "connection" : "pi_da",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "point",
        "breakupArrays" : false,
        "options" : {
          "updateOption" : "Insert",
          "create" : true,
          "timestamp" : "{{this.time}}",
          "pointSource" : "starter",
          "path" : "{{this.path}}"
        },
        "filterList" : [ "path", "time", "_model", "_name", "_timestamp" ]
      }
    } ],
    "modeling" : {
      "models" : [ {
        "name" : "starter_write_values",
        "groupAs" : "/starter_write_values",
        "tags" : [ "starter_canary", "starter_pi_da" ],
        "attributes" : [ {
          "attributeType" : "Internal",
          "name" : "path",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "attributeName",
          "nullable" : false,
          "required" : true,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "value",
          "nullable" : false,
          "required" : true,
          "array" : false,
          "internalType" : "Any"
        }, {
          "attributeType" : "Internal",
          "name" : "time",
          "nullable" : false,
          "required" : true,
          "array" : false,
          "internalType" : "DateTime"
        } ]
      } ],
      "instances" : [ ]
    },
    "conditions" : [ ],
    "functions" : [ ],
    "tags" : [ {
      "name" : "starter_pi_da"
    } ],
    "pipelines" : [ {
      "name" : "starter_output_mqtt_value_changes_pi_da",
      "description" : "This Pipeline obtains a value from a MQTT broker and writes the value to AVEVA PI System Data Archive.  The MQTT topic name is used as part of the PI Point name.  ",
      "groupAs" : "/starter_hist_write_values",
      "tags" : [ "starter_pi_da" ],
      "inputStages" : [ "check_for_payload" ],
      "stages" : [ {
        "name" : "assign_test_value",
        "display" : {
          "position" : {
            "x" : 690,
            "y" : -45
          }
        },
        "description" : "This Stage assigns a test payload.",
        "config" : {
          "type" : ".JavaScriptTransformConfig",
          "transformExpression" : "event.value = {\r\n\t\"_topic\": \"testValue\",\r\n\t\"value\": 1\r\n}\r\nstage.setValue(event.value);"
        },
        "outputs" : [ "apply_model" ]
      }, {
        "name" : "apply_model",
        "display" : {
          "position" : {
            "x" : 1140,
            "y" : 0
          }
        },
        "description" : "This Stage models the payload to normalize the attributes names for downstream processing. ",
        "config" : {
          "type" : ".ModelConfig",
          "model" : "starter_write_values",
          "objectName" : "",
          "initExpression" : "",
          "attributes" : [ {
            "name" : "path",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : ""
            },
            "defaultValue" : "dynamicPath"
          }, {
            "name" : "attributeName",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value._topic"
            }
          }, {
            "name" : "value",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value.value"
            }
          }, {
            "name" : "time",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.timestamp"
            }
          } ]
        },
        "outputs" : [ "transform_payload" ]
      }, {
        "name" : "transform_payload",
        "display" : {
          "position" : {
            "x" : 1590,
            "y" : 0
          }
        },
        "description" : "JavaScript is used to format the payload for PI.  The PI Connection Output requires the value to be assigned to the PI Point Name.",
        "config" : {
          "type" : ".JavaScriptTransformConfig",
          "transformExpression" : "const { attributeName, value, ...rest } = event.value;\r\nstage.setValue({ ...rest, [attributeName]: value });"
        },
        "outputs" : [ "to_pi" ]
      }, {
        "name" : "to_pi",
        "display" : {
          "position" : {
            "x" : 2040,
            "y" : 0
          }
        },
        "description" : "The value payload is written to the Connection Output in this Stage. ",
        "config" : {
          "type" : ".WriteConfig",
          "failureOutputs" : [ ],
          "references" : [ "{{Connection.pi_da.pi_output_value}}" ],
          "writeReturn" : "ignore"
        },
        "outputs" : [ ]
      }, {
        "name" : "check_for_payload",
        "display" : {
          "position" : {
            "x" : 240,
            "y" : 0
          }
        },
        "description" : "This Switch Stage is used for diagnostic purposes and allows the Pipeline to be executed on demand using a test value. ",
        "config" : {
          "type" : ".SwitchConfig",
          "switchCases" : [ {
            "expression" : "return Boolean((event.metadata.source === null || event.metadata.source === undefined || event.metadata.source === \"\"))",
            "outputs" : [ "assign_test_value" ],
            "description" : "no payload"
          }, {
            "expression" : "return true",
            "outputs" : [ "apply_model" ],
            "description" : "payload"
          } ]
        },
        "outputs" : [ ]
      } ],
      "trackActivity" : false,
      "triggers" : [ {
        "name" : "event_trigger",
        "display" : {
          "position" : {
            "x" : -450,
            "y" : 0
          }
        },
        "description" : "The event triggers when a value is published to the topic.",
        "config" : {
          "type" : ".TriggerEvent",
          "enabled" : true,
          "reference" : {
            "type" : "Input",
            "name" : "mqtt_input_value_changes_test",
            "path" : "",
            "params" : { },
            "connectionName" : "mqtt"
          },
          "outputMode" : "ALL"
        }
      } ],
      "errorHandler" : {
        "type" : "default"
      }
    } ],
    "namespace" : [ ]
  },
  "network" : {
    "groups" : [ ],
    "hubs" : [ ]
  }
}