2022.1

Table Of Contents
An OL Connect web flow in Node-RED
This topic explains which nodes and files are used in a typical OL Connect web flow in Node-
RED.
Tip
An easy way to create the files that the typical OLConnect web flow needs, is to use a
Sample Project. See "Sample Project: Serving a Web Page" on page178. You would
use all files except the Workflow configuration file.
The structure of an OL Connect web flow
In an OL Connect web flow only one plugin is essential: the html content plugin.
The html content node creates a set of web pages, using the Web context in a Connect
template, and stores them in the File Store or serves it.
If the template doesn't need any data, set msg.payload to an empty JSON string: {}.
If the template should be merged with data, the data can be the output of another node. Nodes
that output data that can be used by the html content node are:
l An HTTP in node. It will pass any query parameters via the payload. Query parameters
are key/value pairs attached to the end of an URL. The first parameter is appended to the
URL using a ? (question mark). If there are multiple parameters, an & (ampersand) is
added in between each. Example: http://localhost:1881/hello?first=Peter. Note that in
order to use them as data, the parameter names must match field names in the template's
data model.
The flow should end with a http response node which serves the HTML output.
l An OL Connect data mapping node which retrieves data from the job file (such as the
request XML). In addition to creating records in the Connect database, this task can
output the (IDs of the) records.
l An OL Connect data get node which retrieves an existing record set from the Connect
database.
l A standard create file node that creates a JSON file.
l Etc.
Page 217