Sample startup flow: deploy resources

This topic describes a sample startup flow in an OL Connect solution. It sendsOL Connect resources - templates, data mapping configurations, job presets, and output presets - to OL Connect's File Store when the flow is deployed to Node-RED.

This flow could also be used to initialize context variables, or to send a notification that Node-RED has been restarted.

Note: Sample flows are provided by OL Connect Automate, once installed. It appears in the flows folder in the Import dialog in Node-RED which allows you to import the sample into a new or existing flow; see Importing and Exporting Flows in the Node-RED documentation. Instructions are given in this topic, but can also be found in the Read me comment that comes with the sample flow.
For a list of all sample flows, see Sample flows.

Prerequisites

Before running this sample flow:

  1. In the settings of the file store upload node, select the OL Connect Server to which the resources must be uploaded.

  2. Create the following directory directory in the root of your drive before deploying this example:

    \workspace\

  3. Place your OL Connect resources in this folder (or use subfolders).

The sample startup flow

Sample Startup flow

The inject node is configured to trigger this flow once, on deploying the flow.

The folder listing node returns an array with file paths in msg.payload.

The split node iterates over the entries in this array.

Subsequently, the file store upload node uploads the file to the OL Connect Server.

Note: The resources overwrite any resources in the OL Connect Server that were previously uploaded.