{
  "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_pi_af" ],
      "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_af",
      "uri" : "osisoft.afsdk://{{System.Variables.pi_host_central}}: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 Asset Framework.",
      "tags" : [ "starter_pi_af" ],
      "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" : "pi_af_input_metadata_assets_attributes_with_pages",
      "connection" : "pi_af",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "assetmetadata",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : false,
          "includeAttributes" : true,
          "database" : "Grains",
          "query" : "Template: 'Base'",
          "index" : false,
          "indexWindow" : "",
          "paging" : true,
          "startIndex" : "{{this.pageIndex}}",
          "pageSize" : "{{this.pageSize}}"
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "inline",
        "model" : {
          "name" : "params",
          "tags" : [ ],
          "attributes" : [ {
            "attributeType" : "Internal",
            "name" : "pageIndex",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : 0,
            "internalType" : "String"
          }, {
            "attributeType" : "Internal",
            "name" : "pageSize",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : 1000,
            "internalType" : "String"
          } ]
        }
      }
    }, {
      "name" : "pi_af_input_metadata_assets_pumps",
      "connection" : "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" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "EmptyParameters"
      }
    }, {
      "name" : "pi_af_input_metadata_assets_with_pages",
      "connection" : "pi_af",
      "type" : "osisoft.afsdk",
      "qualifier" : {
        "type" : "assetmetadata",
        "options" : {
          "get" : "currentValue",
          "includeMetaData" : false,
          "includeChildren" : false,
          "includeAttributes" : false,
          "database" : "Grains",
          "query" : "Template: 'Base'",
          "index" : false,
          "indexWindow" : "",
          "paging" : true,
          "startIndex" : "{{this.pageIndex}}",
          "pageSize" : "{{this.pageSize}}"
        }
      },
      "cacheLifetime" : {
        "enabled" : false
      },
      "template" : {
        "type" : "Off"
      },
      "parameters" : {
        "type" : "inline",
        "model" : {
          "name" : "params",
          "tags" : [ ],
          "attributes" : [ {
            "attributeType" : "Internal",
            "name" : "pageIndex",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : 0,
            "internalType" : "String"
          }, {
            "attributeType" : "Internal",
            "name" : "pageSize",
            "nullable" : false,
            "required" : false,
            "array" : false,
            "defaultValue" : 1000,
            "internalType" : "String"
          } ]
        }
      }
    } ],
    "outputs" : [ ],
    "modeling" : {
      "models" : [ {
        "name" : "starter_metadata_asset",
        "description" : "This is an example provide for modeling asset metadata.  It is a component of a starter solution.",
        "groupAs" : "/starter_hist_read_metadata_asset",
        "tags" : [ "starter_pi_af" ],
        "attributes" : [ {
          "attributeType" : "Internal",
          "name" : "assetId",
          "nullable" : false,
          "required" : true,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "assetName",
          "nullable" : false,
          "required" : true,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "assetTemplateId",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "assetPath",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "assetVersion",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "source",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "time",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "DateTime"
        } ]
      }, {
        "name" : "starter_metadata_asset_attribute",
        "description" : "This is an example provide for modeling asset attribute metadata.  It is a component of a starter solution.",
        "groupAs" : "/starter_hist_read_metadata_asset",
        "tags" : [ "starter_pi_af" ],
        "attributes" : [ {
          "attributeType" : "Internal",
          "name" : "assetId",
          "nullable" : false,
          "required" : true,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "assetPath",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "attributeId",
          "nullable" : false,
          "required" : true,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "attributeName",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "attributeDescription",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "attributeDataType",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "attributeUnits",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "pointID",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "source",
          "nullable" : true,
          "required" : false,
          "array" : false,
          "internalType" : "String"
        }, {
          "attributeType" : "Internal",
          "name" : "time",
          "nullable" : false,
          "required" : false,
          "array" : false,
          "internalType" : "DateTime"
        } ]
      } ],
      "instances" : [ ]
    },
    "conditions" : [ ],
    "functions" : [ ],
    "tags" : [ {
      "name" : "starter_pi_af"
    } ],
    "pipelines" : [ {
      "name" : "starter_output_pi_af_metadata_asset_attributes_to_mqtt",
      "description" : "This Pipeline obtains asset attribute metadata from AVEVA PI System Asset Framework and models the data before publishing the data to the Intelligence Hub MQTT Broker.",
      "groupAs" : "/starter_hist_read_metadata_asset",
      "tags" : [ "starter_pi_af" ],
      "inputStages" : [ "read_pi_data" ],
      "stages" : [ {
        "name" : "asset_metadata",
        "display" : {
          "position" : {
            "x" : 1140,
            "y" : 0
          }
        },
        "description" : "The Stage moves the asset information to metadata.",
        "config" : {
          "type" : ".JavaScriptTransformConfig",
          "transformExpression" : "var path = event.value._path;\r\nvar result = path.includes(\"\\\\\") ? path.replaceAll(\"\\\\\", \"/\") : path;\r\nstage.setMetadata(\"assetPath\", result);\r\nstage.setMetadata(\"elementID\", event.value.elementID);\r\nstage.setValue(event.value);"
        },
        "outputs" : [ "elevate_attributes" ]
      }, {
        "name" : "read_pi_data",
        "display" : {
          "position" : {
            "x" : 240,
            "y" : 0
          }
        },
        "description" : "This Stage reads the data from AVEVA PI System.",
        "config" : {
          "type" : ".ReadConfig",
          "failureOutputs" : [ ],
          "reference" : {
            "type" : "Input",
            "name" : "pi_af_input_metadata_assets_pumps",
            "path" : "",
            "params" : { },
            "connectionName" : "pi_af"
          }
        },
        "outputs" : [ "breakup_assets" ]
      }, {
        "name" : "breakup_attributes",
        "display" : {
          "position" : {
            "x" : 2040,
            "y" : 0
          }
        },
        "description" : "The Stage breaks up the attributes array.",
        "config" : {
          "type" : ".BreakupConfig",
          "breakupType" : "array",
          "depth" : 1
        },
        "outputs" : [ "apply_model" ]
      }, {
        "name" : "elevate_attributes",
        "display" : {
          "position" : {
            "x" : 1590,
            "y" : 0
          }
        },
        "description" : "This JavaScript Stage elevates the attributes array.",
        "config" : {
          "type" : ".JavaScriptTransformConfig",
          "transformExpression" : "stage.setValue(event.value.attributes);"
        },
        "outputs" : [ "breakup_attributes" ]
      }, {
        "name" : "sized_buffer",
        "display" : {
          "position" : {
            "x" : 2940,
            "y" : 0
          }
        },
        "description" : "A buffer Stage is often used before writing data to a Data Lake or Data Warehouse.",
        "config" : {
          "type" : ".SizedBufferConfig",
          "windowExpression" : "stage.setBufferKey(null);",
          "windowSize" : 100,
          "timeout" : {
            "duration" : 10,
            "units" : "Seconds"
          }
        },
        "outputs" : [ "to_mqtt" ]
      }, {
        "name" : "apply_model",
        "display" : {
          "position" : {
            "x" : 2490,
            "y" : 0
          }
        },
        "description" : "This Stage applies the desired schema to the payload.",
        "config" : {
          "type" : ".ModelConfig",
          "model" : "starter_metadata_asset_attribute",
          "objectName" : "",
          "initExpression" : "",
          "attributes" : [ {
            "name" : "assetId",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.metadata.elementID"
            }
          }, {
            "name" : "assetPath",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.metadata.assetPath"
            }
          }, {
            "name" : "attributeId",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value.ID"
            }
          }, {
            "name" : "attributeName",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value.name"
            }
          }, {
            "name" : "attributeDescription",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value.description"
            }
          }, {
            "name" : "attributeDataType",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value.dataType"
            }
          }, {
            "name" : "attributeUnits",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value.uom"
            }
          }, {
            "name" : "pointID",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value.point.ID"
            }
          }, {
            "name" : "source",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : ""
            },
            "defaultValue" : "AVEVA PI System Asset Framework"
          }, {
            "name" : "time",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.timestamp"
            }
          } ]
        },
        "outputs" : [ "sized_buffer" ]
      }, {
        "name" : "to_mqtt",
        "display" : {
          "position" : {
            "x" : 3390,
            "y" : 0
          }
        },
        "description" : "This Stage publishes the payload to the Intelligence Hub MQTT broker which is being used in this case to allow easy visualization of the output.",
        "config" : {
          "type" : ".DynamicWriteConfig",
          "failureOutputs" : [ ],
          "connectionReference" : "{{Connection.mqtt}}",
          "qualifier" : {
            "topic" : "Metadata_Asset_Attribute_PI_AF",
            "qos" : 0,
            "namedRoot" : false,
            "retained" : false,
            "breakupArrays" : false,
            "filterList" : [ "_name", "_model", "_timestamp" ]
          },
          "qualifierExpression" : "",
          "writeReturn" : "ignore"
        },
        "outputs" : [ ]
      }, {
        "name" : "breakup_assets",
        "display" : {
          "position" : {
            "x" : 690,
            "y" : 0
          }
        },
        "description" : "The Stage breaks up the asset array.",
        "config" : {
          "type" : ".BreakupConfig",
          "breakupType" : "array",
          "depth" : 1
        },
        "outputs" : [ "asset_metadata" ]
      } ],
      "trackActivity" : false,
      "triggers" : [ {
        "name" : "polled_trigger",
        "display" : {
          "position" : {
            "x" : -450,
            "y" : 0
          }
        },
        "description" : "An asset attribute metadata Pipeline typically runs infrequently.   Perhaps every few hours or fractions of a day.",
        "config" : {
          "type" : ".TriggerPolled",
          "enabled" : false,
          "interval" : {
            "duration" : 8,
            "units" : "Hours"
          },
          "mode" : "interval"
        }
      } ],
      "errorHandler" : {
        "type" : "default"
      }
    }, {
      "name" : "starter_output_pi_af_metadata_assets_to_mqtt",
      "description" : "This Pipeline obtains asset metadata from AVEVA PI System Asset Framework and models the data before publishing the data to the Intelligence Hub MQTT Broker.",
      "groupAs" : "/starter_hist_read_metadata_asset",
      "tags" : [ "starter_pi_af" ],
      "inputStages" : [ "read_pi_data" ],
      "stages" : [ {
        "name" : "read_pi_data",
        "display" : {
          "position" : {
            "x" : 240,
            "y" : 0
          }
        },
        "description" : "This Stage reads the data from AVEVA PI System.",
        "config" : {
          "type" : ".ReadConfig",
          "failureOutputs" : [ ],
          "reference" : {
            "type" : "Input",
            "name" : "pi_af_input_metadata_assets_pumps",
            "path" : "",
            "params" : { },
            "connectionName" : "pi_af"
          }
        },
        "outputs" : [ "breakup_array" ]
      }, {
        "name" : "size_buffer",
        "display" : {
          "position" : {
            "x" : 1590,
            "y" : 0
          }
        },
        "description" : "A buffer Stage is often used before writing data to a Data Lake or Data Warehouse.",
        "config" : {
          "type" : ".SizedBufferConfig",
          "windowExpression" : "stage.setBufferKey(null);",
          "windowSize" : 100,
          "timeout" : {
            "duration" : 10,
            "units" : "Seconds"
          }
        },
        "outputs" : [ "to_mqtt" ]
      }, {
        "name" : "to_mqtt",
        "display" : {
          "position" : {
            "x" : 2040,
            "y" : 0
          }
        },
        "description" : "This Stage publishes the payload to the Intelligence Hub MQTT broker which is being used in this case to allow easy visualization of the output.",
        "config" : {
          "type" : ".DynamicWriteConfig",
          "failureOutputs" : [ ],
          "connectionReference" : "{{Connection.mqtt}}",
          "qualifier" : {
            "topic" : "Metadata_Asset_PI_AF",
            "qos" : 0,
            "namedRoot" : false,
            "retained" : false,
            "breakupArrays" : false,
            "filterList" : [ "_name", "_model", "_timestamp" ]
          },
          "qualifierExpression" : "",
          "writeReturn" : "ignore"
        },
        "outputs" : [ ]
      }, {
        "name" : "apply_model",
        "display" : {
          "position" : {
            "x" : 1140,
            "y" : 0
          }
        },
        "description" : "This Stage applies the desired schema to the payload.",
        "config" : {
          "type" : ".ModelConfig",
          "model" : "starter_metadata_asset",
          "objectName" : "",
          "initExpression" : "",
          "attributes" : [ {
            "name" : "assetId",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value.elementID"
            }
          }, {
            "name" : "assetName",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value._name"
            }
          }, {
            "name" : "assetTemplateId",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value.template.ID"
            }
          }, {
            "name" : "assetPath",
            "expression" : {
              "type" : "JavaScript",
              "expression" : "let path = event.value._path;\r\nlet result = path.includes(\"\\\\\") ? path.replaceAll(\"\\\\\", \"/\") : str;\r\nreturn result;"
            }
          }, {
            "name" : "assetVersion",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.value.version"
            }
          }, {
            "name" : "source",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : ""
            },
            "defaultValue" : "AVEVA PI System Asset Framework"
          }, {
            "name" : "time",
            "expression" : {
              "type" : "PipelineStageReference",
              "stageReference" : "event.timestamp"
            }
          } ]
        },
        "outputs" : [ "size_buffer" ]
      }, {
        "name" : "breakup_array",
        "display" : {
          "position" : {
            "x" : 690,
            "y" : 0
          }
        },
        "description" : "The Stage breaks up the asset array.",
        "config" : {
          "type" : ".BreakupConfig",
          "breakupType" : "array",
          "depth" : 1
        },
        "outputs" : [ "apply_model" ]
      } ],
      "trackActivity" : false,
      "triggers" : [ {
        "name" : "polled_trigger",
        "display" : {
          "position" : {
            "x" : -450,
            "y" : 0
          }
        },
        "description" : "An asset metadata Pipeline typically runs infrequently.   Perhaps every few hours or fractions of a day.",
        "config" : {
          "type" : ".TriggerPolled",
          "enabled" : true,
          "interval" : {
            "duration" : 8,
            "units" : "Hours"
          },
          "mode" : "interval"
        }
      } ],
      "errorHandler" : {
        "type" : "default"
      }
    } ],
    "namespace" : [ ]
  },
  "network" : {
    "groups" : [ ],
    "hubs" : [ ]
  }
}