Skip to content

Using function nodes

The function nodes are described in a simple scenario with the examples of:

Context nodes

The context nodes are used to store and read the values with the associated context type and key. The supported context nodes are:

Note

You can store and retrieve data from context variables using the specific nodes.

Using store-ctx node

To store the values into the context using "store-ctx" node, follow these steps:

  1. From the node palette, drag and drop the "inject" node from the input palette and "store-context" node from the function palette to the working area. Connect the nodes in a flow as shown below:

    welcome to VFC

  2. Double click on "inject" node to edit the properties. For more information, refer to Editing nodes.

  3. Double click on "store-context" node to edit the properties.

    • Enter the name as "store in context".
    • Select the context type as "Flow".
    • To select the respective key value, click dot.
    • Click "Done".

      Edit store-context

  4. Save and execute the flow.

The values are stored into the context successfully. The output is displayed in the context data tab:

Context

To refresh the display of updated key and value, click refresh.

Using read-ctx node

To read the values from the context using read-context node, follow these steps:

  1. From the node palette, drag and drop the "inject" node from the input palette, "read ctx" node from the function palette and "debug" node from output palette to the working area. Connect the nodes in a flow as shown below:

    Design the flow

  2. Double click on "inject" node to edit the properties. For more information, refer to Editing nodes.

  3. Double click on "Read ctx" node to edit the properties.

    • Enter the name as "read from context".
    • Select the context type as "Flow".
    • To select the respective key value, click dot.

      Flow context

    • Click "Done".

  4. Save and execute the flow.

The output is displayed in the debug tab:

Welcome to VFC

Parquet node

To get the array object into parquet format using parquet node, follow these steps:

  1. From the node palette, drag and drop the following nodes with the respective palette to the working area. Connect the nodes in a flow as shown below:

    • Inject node
    • Function node
    • Two Parquet node
    • Debug node

    Design the flow

  2. Double click on "function" node to edit the properties.

    • Enter the "Name".
    • Enter the "Code".

          msg.payload = [{
              bool: true,
              num: 1
          },
          {
              bool: false,
              num: 2
          }];
          msg.schema = {
              bool: {type: "BOOLEAN"},
              num: {type: "DOUBLE"},
          };
          return msg;
      
    • Click "Done".

  3. Save and execute the flow.

The output will be displayed in the debug tab.

Debug tab


Last update: July 18, 2024