{
  "productInfo" : {
    "company" : "HighByte",
    "product" : "IntelligenceHub",
    "version" : "4.5.0",
    "build" : "2026.8.14.399",
    "stage" : "Release"
  },
  "project" : {
    "version" : 14,
    "connections" : [ ],
    "inputs" : [ ],
    "outputs" : [ ],
    "modeling" : {
      "models" : [ ],
      "instances" : [ ]
    },
    "conditions" : [ ],
    "functions" : [ ],
    "tags" : [ ],
    "pipelines" : [ {
      "name" : "PagingExample_HandleNoData",
      "tags" : [ "PagingExamples" ],
      "inputStages" : [ "SetTop1500" ],
      "stages" : [ {
        "name" : "SetTop1500",
        "display" : {
          "position" : {
            "x" : 345,
            "y" : 0
          }
        },
        "description" : "",
        "config" : {
          "type" : ".JavaScriptTransformConfig",
          "transformExpression" : "let top = 1500;\r\nstage.setMetadata(\"Top\", top);\r\nstage.setValue(event.value);\r\n\r\n"
        },
        "outputs" : [ "While_Read" ]
      }, {
        "name" : "PagingExampleMQTT",
        "display" : {
          "position" : {
            "x" : 3345,
            "y" : 0
          }
        },
        "description" : "",
        "config" : {
          "type" : ".DynamicWriteConfig",
          "failureOutputs" : [ ],
          "connectionReference" : "{{Connection.PagingExamplesMQTT}}",
          "eventPath" : "",
          "connectionType" : "mqtt",
          "qualifier" : {
            "topic" : "Orders",
            "qos" : 0,
            "namedRoot" : false,
            "retained" : true,
            "breakupArrays" : false
          },
          "qualifierExpression" : "",
          "writeReturn" : "ignore"
        },
        "outputs" : [ ]
      }, {
        "name" : "While_Read",
        "display" : {
          "position" : {
            "x" : 795,
            "y" : -217
          },
          "size" : {
            "width" : 2400,
            "height" : 525
          },
          "metadata" : { }
        },
        "description" : "",
        "config" : {
          "type" : ".WhileLoopConfig",
          "failureOutputs" : [ ],
          "loopOutputs" : [ "HasSkipInMetadata" ],
          "stageTimeout" : {
            "duration" : 15,
            "units" : "Seconds"
          },
          "expression" : "// Keep looping if DataFound is true\r\nreturn loop.metadata.DataFound;",
          "loopValue" : "ACCUMULATED"
        },
        "outputs" : [ "PagingExampleMQTT" ]
      }, {
        "name" : "Return",
        "display" : {
          "position" : {
            "x" : 1950,
            "y" : 217
          },
          "metadata" : {
            "parent" : "While_Read"
          }
        },
        "description" : "",
        "config" : {
          "type" : ".ReturnConfig"
        },
        "outputs" : [ ]
      }, {
        "name" : "HasSkipInMetadata",
        "display" : {
          "position" : {
            "x" : 150,
            "y" : 217
          },
          "metadata" : {
            "parent" : "While_Read"
          }
        },
        "description" : "",
        "config" : {
          "type" : ".SwitchConfig",
          "switchCases" : [ {
            "expression" : "return Boolean(event.metadata.hasOwnProperty('Skip'))",
            "outputs" : [ "SetNextSkips" ],
            "description" : "Value Is True"
          }, {
            "expression" : "return true",
            "outputs" : [ "SetFirstSkip" ],
            "description" : "Default"
          } ]
        },
        "outputs" : [ ]
      }, {
        "name" : "SetNextSkips",
        "display" : {
          "position" : {
            "x" : 600,
            "y" : 150
          },
          "metadata" : {
            "parent" : "While_Read"
          }
        },
        "description" : "",
        "config" : {
          "type" : ".JavaScriptTransformConfig",
          "transformExpression" : "let skip = event.metadata.Skip + event.metadata.Top;\r\nstage.setMetadata(\"Skip\", skip);\r\nstage.setValue(event.value);\r\n\r\n"
        },
        "outputs" : [ "OrderWithPaging" ]
      }, {
        "name" : "OrderWithPaging",
        "display" : {
          "position" : {
            "x" : 1050,
            "y" : 217
          },
          "metadata" : {
            "parent" : "While_Read"
          }
        },
        "description" : "",
        "config" : {
          "type" : ".ReadConfig",
          "failureOutputs" : [ ],
          "reference" : {
            "type" : "Input",
            "name" : "OrdersWithPaging",
            "path" : "",
            "params" : {
              "Top" : "{{event.metadata.Top}}",
              "Skip" : "{{event.metadata.Skip}}"
            },
            "connectionName" : "PagingExamplesMSSQL"
          },
          "handleGoodNoData" : true,
          "goodNoDataOutputs" : [ "DataFoundFalse" ]
        },
        "outputs" : [ "DataFoundTrue" ]
      }, {
        "name" : "SetFirstSkip",
        "display" : {
          "position" : {
            "x" : 600,
            "y" : 285
          },
          "metadata" : {
            "parent" : "While_Read"
          }
        },
        "description" : "",
        "config" : {
          "type" : ".JavaScriptTransformConfig",
          "transformExpression" : "let skip = 0;\r\nstage.setMetadata(\"Skip\", skip);\r\nstage.setValue(event.value);\r\n\r\n"
        },
        "outputs" : [ "OrderWithPaging" ]
      }, {
        "name" : "DataFoundTrue",
        "display" : {
          "position" : {
            "x" : 1500,
            "y" : 150
          },
          "metadata" : {
            "parent" : "While_Read"
          }
        },
        "description" : "",
        "config" : {
          "type" : ".JavaScriptTransformConfig",
          "transformExpression" : "stage.setMetadata(\"DataFound\", true);\r\nstage.setValue(event.value);"
        },
        "outputs" : [ "Return" ]
      }, {
        "name" : "DataFoundFalse",
        "display" : {
          "position" : {
            "x" : 1500,
            "y" : 285
          },
          "metadata" : {
            "parent" : "While_Read"
          }
        },
        "description" : "",
        "config" : {
          "type" : ".JavaScriptTransformConfig",
          "transformExpression" : "stage.setMetadata(\"DataFound\", false);\r\nstage.setValue(event.value);"
        },
        "outputs" : [ "Return" ]
      } ],
      "trackActivity" : false,
      "queueSize" : 10000,
      "triggers" : [ ],
      "errorHandler" : {
        "type" : "default"
      }
    } ],
    "namespace" : [ ],
    "lookupMap" : [ ],
    "servers" : {
      "i3x" : {
        "historyReadPipeline" : {
          "type" : "Empty"
        },
        "writePipeline" : {
          "type" : "Empty"
        }
      }
    }
  },
  "network" : {
    "groups" : [ ],
    "hubs" : [ ]
  }
}