Deploying resources for OL Connect Automate

OL Connect resources are files created with OL Connect’s Designer or DataMapper. In order to use them in the OL Connect nodes for OL Connect Automate, they need to be deployed to the OL Connect Server first. This article explains how this is done using the Designer and provides a recipe to automate this from within your project.

Deployed resources are stored in the OL Connect File Store. Nodes can reference these resources either by their name or by the internal database ID (also known as the managed file ID). Using the resource name is the simplest approach, as it ensures the nodes always access the latest available version. This way, when a resource is updated or redeployed, the nodes automatically use the new version.

The following image shows the Properties of the Paginated Content node referring to a template by name.

Send to Server

Resources can be deployed to the OL Connect Server directly from OL Connect Designer using the Send to Server option. This sends the resources to the server’s File Store, making them active immediately after upload. This is helpful when developing an OL Connect Automate project, especially when you want to review and test changes quickly.

To upload a resource to the OL Connect Server:

  1. Open/create a template, data mapper configuration or preset in OL Connect Designer.
  2. Choose: File > Send to Server. The Send to Server dialog appears.
  3. Click Send to deploy the resource to the selected OL Connect Server.

By default resources are sent to the OL Connect Server on the local machine. Additional OL Connect Server connection can be configured in the Preferences dialog of OL Connect Designer.

Automated deployments

Uploading resources via OL Connect Designer works well when developing a local project, but it becomes cumbersome when deploying/relocating it on a different machine (for example when moving from development to test or production in a DTAP environment). Let’s take a look at how to automate resource deployment using a Startup flow.

Trigger the flow at Startup

The flow starts with the Inject node. This node can be used to trigger the flow in the Node-RED editor and can be configured to inject once each time the flows are started.

Iterating resources

The Folder Listing node retrieves a list of OL Connect resources from a specified project folder or workspace location. The folder path can be hardcoded, but it is recommended to use a Global Environment Variable for flexibility. The node outputs an array (list) of file paths in msg.payload, which can be iterated over by connecting a Split node.

The image below shows the Folder Listing node configuration. The folder location is set using a Global Environment Variable called ENV_WORKSPACE, and the File Masks field is configured to filter and retrieve only OL Connect-related resource files.

More information on Global Environment Variables is found in the Sample data tactics for Folder Capture in OL Connect Automate article.

Uploading files

As mentioned, the Folder Listing node stores the array of file paths in msg.payload. The Split node iterates over this list by creating a sequence of messages, each containing a file path in msg.payload.

The File Store Upload node uploads files to the OL Connect File Store. In this example, the node is configured to read the file path from msg.payload. The File Duration option is set to Permanent, ensuring the file remains in the File Store. Files marked as permanent will not be removed automatically by OL Connect’s Clean-Up Service. When uploading a file with the same name, it replaces the previous version, ensuring OL Connect nodes always use the latest version.

Wrapping it up

This completes the Startup flow concept. You can finish the flow with a Debug node or a Join node. A Join node is useful if you plan to add follow-up tasks for this flow.

This flow is also available in the examples included with the @objectif-lune/node-red-contrib-connect package. To access it, go to the Node-RED menu: Import > Examples.

Navigate to common patterns > startup flows under @objectif-lune/node-red-contrib-connect.