@l3av/node-red-truth-table v1.1.0
Node-RED Truth Table Node
This Node-RED node, truth-table, provides a truth table functionality for evaluating expressions based on input data.
Installation
To use this node, you need to have Node-RED installed. Follow the official Node-RED documentation for installation instructions.
After installing Node-RED, you can install the truth-table node by either using the Node-RED Editor's palette manager or by running the following command in your Node-RED user directory:
npm install node-red-contrib-truth-table
Usage
The truth-table node evaluates expressions based on the input data and generates a result object. The node has the following properties:
- Name: A name for the node (optional).
- Render Options: Specify the labels for different render levels. These labels will be used in their indexed order in the generated truth table.
- Expressions: An array of expressions to evaluate. Each expression consists of a
path,stateExp, andissueExp. Thepathis used to extract a value from the input payload, and thestateExpandissueExpare JSONata expressions used to evaluate the state and issue for the extracted value, respectively. The expressions are defined in the following format:[{ "path": "<path>", "stateExp": "<state expression>", "issueExp": "<issue expression>" }, ...].
The node has one input and two outputs. The input data should be provided to the input of the node. The outputs are generated based on the evaluation result:
Output 1: Contains the result object, which includes the following properties:
render: The render level based on the evaluated expressions (ok,warning, orcritical).issues: An array of issues generated from the evaluated expressions.raw_data: The original input data.
Output 2: Contains an error message if an error occurs during the evaluation process.