Rule Nodes Overview¶
A routing rule consists of multiple rule nodes connected head-to-tail, where each node processes a single incoming message and generates one or more outgoing messages to its downstream nodes.
You can drag and drop the nodes into the design canvas in Routing Rule List to form routing rules as per your requirements.
Node Types¶
The nodes in Routing Rule are divided into the following types.
Starting Node
A routing rule can start with either a Rule Entry or Scheduler node, depending on what was chosen as the Trigger Type when creating the rule. For more information, see Creating Rules.
Note that rules starting with the Scheduler node does not support the full range of routing rule nodes in the node library. For the comprehensive list, see List of Nodes.
Filter
A filter node filters and identifies an input message, after which the messages are processed separately, for example: filtering out messages that correspond to a certain model, and processing the messages for different message types such as reporting measurement points, updating attributes, etc.
Enrichment
An enrichment node enriches the incoming message by updating it with additional details.
Logic
A logic node enables you to set rules and conditions to process and split the routing rule into different paths for subsequent processing without any programming needed.
Transformation
A transformation node transforms the incoming message and outputs to the downstream nodes for subsequent processing.
EnOS
An EnOS node processes EnOS standard data, such as saving attributes and measurement points to be viewed in EnOS Management Console.
Action
An action node initiates an action with its input message, for example, adding selected data from the metadata to the msg, converting data format, etc.
External
An external node interacts with external systems.
Expressions ¶
There are two parts to a message: msg and metadata. The msg is the payload and the metadata contains attribute information in JSON format, for example, that are passed down from node to node via the input and output messages. You can use expressions to retrieve certain information from the node’s input msg or metadata, if they are a standard JSON object, for node processing.
The expression ${msg.key} for example, can quickly retrieve a key-value pair, where key is the key of a key-value pair in the JSON. See the below, where a node receives the following JSON object as its input message:
{
"assetId":"Inverter",
"timestamp":24214324324,
"measurepoints":{
"temperature":22.4,
"humidity":78
}
}
Using the following expressions will return these values respectively.
Expression |
Returned Value |
---|---|
${msg.assetid} |
Inverter |
${msg.measurepoints.humidity} |
78 |
Similarly, if a node supports using expressions to refer to a value in its JSON metadata, you can use ${metadata.key} to return the required value, where key is the key of a key-value pair in the metadata. The key of metadata is not case sensitive, and the value needs to be case sensitive.
Note
Expressions can only be used for JSON objects, not JSON arrays. You must convert any non-JSON input into JSON objects if you want to use an expression. Use the Script node to help you convert the input. For JSON arrays, use the Split node to split the array into JSON objects.
List of Nodes¶
Starting Node¶
Node |
Rule Entry Routing Rule |
Scheduler Routing Rule |
---|---|---|
√ |
× |
|
× |
√ |
Subrule¶
Node |
Rule Entry Routing Rule |
Scheduler Routing Rule |
---|---|---|
√ |
√ |
|
√ |
√ |
Filter¶
Node |
Rule Entry Routing Rule |
Scheduler Routing Rule |
---|---|---|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
√ |
Enrichment¶
Node |
Rule Entry Routing Rule |
Scheduler Routing Rule |
---|---|---|
√ |
√ |
|
√ |
√ |
|
√ |
√ |
Logic¶
Node |
Rule Entry Routing Rule |
Scheduler Routing Rule |
---|---|---|
√ |
√ |
|
√ |
√ |
|
√ |
√ |
|
√ |
√ |
|
√ |
√ |
|
√ |
√ |
Transformation¶
Node |
Rule Entry Routing Rule |
Scheduler Routing Rule |
---|---|---|
√ |
√ |
|
√ |
× |
EnOS¶
Node |
Rule Entry Routing Rule |
Scheduler Routing Rule |
---|---|---|
√ |
√ |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
|
√ |
× |
Action¶
Node |
Rule Entry Routing Rule |
Scheduler Routing Rule |
---|---|---|
√ |
√ |
|
√ |
√ |
|
√ |
√ |
|
√ |
√ |
External¶
Node |
Rule Entry Routing Rule |
Scheduler Routing Rule |
---|---|---|
√ |
√ |
|
√ |
√ |