Rule engine
Process every device message with rule chains and queues, build chains safely and look up each rule node in this build.
Every message (telemetry, attribute update, RPC, device connect/disconnect, alarm, entity event) goes through a rule chain: a graph of rule nodes that filter, enrich, transform and act on messages. The Root Rule Chain receives messages unless a device or asset profile names another chain.
Messages
A message has an originator (the device or asset), a type (POST_TELEMETRY_REQUEST, POST_ATTRIBUTES_REQUEST, ATTRIBUTES_UPDATED, RPC_CALL_FROM_SERVER_TO_DEVICE, ACTIVITY_EVENT, INACTIVITY_EVENT, ALARM …), a JSON payload and metadata (key/value strings such as deviceName, deviceType, ts). Nodes pass the message on through named connections: Success, Failure, True, False, or custom labels from switch nodes.
Building chains safely
- Keep the root chain small: route by profile (device profile switch) into one chain per solution (
Water Tank Processing,BMS Processing,Smart Campus Processing). - Always connect
Failureof external calls (REST, MQTT, Kafka, e-mail) to a log node or an alarm, so failures are visible. - Scripts (filter, switch, transformation) run in TBEL by default: fast and sandboxed. Keep them short; move shared logic into calculated fields where possible.
- Use debug mode on a node for a limited time to see the messages passing through it.
- Test a changed chain on a copy assigned to one test device profile before switching production devices.
Queues
Messages are processed through queues (Main, HighPriority, SequentialByOriginator …), set per device profile. SequentialByOriginator processes one message per device at a time, which keeps time order (the Water package uses it). Queue settings (pack timeout, retries) are under Settings > Queues for the system administrator. With the default in-memory queue, messages in flight are lost on a restart; see Kafka for a durable queue.
Rule node reference
The reference below is generated from the rule nodes compiled into this build (the @RuleNode annotations in rule-engine/ and application/), so it lists exactly what the node palette offers.
- Action (27)
- Enrichment (11)
- External (14)
- Filter (12)
- Flow (4)
- Transformation (9)
Action nodes
assign to customer
Assign message originator entity to customer
Finds target customer by title and assign message originator entity to this customer. Rule node will create a new customer if it doesn't exist, and 'Create new customer if it doesn't exist' enabled.
Category Action · outputs Success, Failure · class TbAssignToCustomerNode
calculated fields and alarm rules
Pushes incoming messages to calculated fields and alarm rules services
Node enables the processing of calculated fields and alarm rules without persisting incoming messages to the database. By default, the processing of calculated fields and alarm rules is triggered by the save attributes and save time series nodes. This rule node accepts the same messages as these nodes but allows you to trigger the processing of calculated fields or alarm rules independently, ensuring that derived data can be computed and utilized in real time without storing the original message in the database.
Category Action · outputs Success, Failure · class TbCalculatedFieldsNode
clear alarm
Clear Alarm
Details - JS function that creates JSON object based on incoming message. This object will be added into Alarm.details field.
Node output:
If alarm was not cleared, original message is returned. Otherwise new Message returned with type 'ALARM', Alarm object in 'msg' property and 'metadata' will contains 'isClearedAlarm' property.
Message payload can be accessed via msg property. For example 'temperature = ' + msg.temperature ;.
Message metadata can be accessed via metadata property. For example 'name = ' + metadata.customerName;.
Category Action · outputs Cleared, False · class TbClearAlarmNode
copy to view
Copy attributes from asset/device to entity view and changes message originator to related entity view
Copy attributes from asset/device to related entity view according to entity view configuration. Copy will be done only for attributes that are between start and end dates and according to attribute keys configuration. Changes message originator to related entity view and produces new messages according to count of updated entity views
Category Action · outputs Success, Failure · class TbCopyAttributesToEntityViewNode
create alarm
Create or Update Alarm
Details - JS function that creates JSON object based on incoming message. This object will be added into Alarm.details field.
Node output:
If alarm was not created, original message is returned. Otherwise new Message returned with type 'ALARM', Alarm object in 'msg' property and 'metadata' will contains one of those properties 'isNewAlarm/isExistingAlarm'. Message payload can be accessed via msg property. For example 'temperature = ' + msg.temperature ;. Message metadata can be accessed via metadata property. For example 'name = ' + metadata.customerName;.
Category Action · outputs Created, Updated, False · class TbCreateAlarmNode
create relation
Finds target entity specified in the configuration and creates a relation with the incoming message originator based on the configured direction and type.
Useful when you need to create relations between entities dynamically depending on incoming message payload, message originator type, name, etc.
Target entity configuration:
- Device - use a device with the specified name as the target entity to create a relation with. When selected, rule node allows us to use advanced mode to enable device creation if it doesn't exist. In advanced mode, device profile name should be specified.
- Asset - use an asset with the specified name as the target entity to create a relation with. When selected, rule node allows us to use advanced mode to enable device creation if it doesn't exist. In advanced mode, asset profile name should be specified.
- Entity View - use entity view with the specified name as the target entity to create a relation with.
- Tenant - use current tenant as target entity to create a relation with.
- Customer - use customer with the specified title as the target entity to create a relation with. When selected, rule node allows us to use advanced mode to enable customer creation if it doesn't exist.
- Dashboard - use a dashboard with the specified title as the target entity to create a relation with.
- User - use a user with the specified email as the target entity to create a relation with.
- Edge - use an edge with the specified name as the target entity to create a relation with.
- Remove current relations - removes current relations with originator of the incoming message based on direction and type. Useful in GPS tracking use cases where relation acts as a temporary indicator of a tracker presence in specific geofence.
- Change originator to target entity - useful when you need to process submitted message as a message from target entity.
Success - if the relation already exists or successfully created, otherwise Failure.Category Action · outputs Success, Failure · class TbCreateRelationNode
delay (deprecated)
Delays incoming message (deprecated)
Delays messages for a configurable period. Please note, this node acknowledges the message from the current queue (message will be removed from queue). Deprecated because the acknowledged message still stays in memory (to be delayed) and this does not guarantee that message will be processed even if the "retry failures and timeouts" processing strategy will be chosen.
Category Action · outputs Success, Failure · class TbMsgDelayNode
delete attributes
Delete attributes for Message Originator.
Attempt to remove attributes by selected keys. If msg originator doesn't have an attribute with a key selected in the configuration, it will be ignored. If delete operation is completed successfully, rule node will send the "Attributes Deleted" event to the root chain of the message originator and send the incoming message via Success chain, otherwise, Failure chain is used.
Category Action · outputs Success, Failure · class TbMsgDeleteAttributesNode
delete relation
Deletes relation with the incoming message originator based on the configured direction and type.
Useful when you need to remove relations between entities dynamically depending on incoming message payload, message originator type, name, etc.
If Delete relation with specific entity enabled, target entity to delete relation with should be specified. Otherwise, rule node will delete all relations with the message originator based on the configured direction and type.
Target entity configuration:
- Device - use a device with the specified name as the target entity to delete relation with.
- Asset - use an asset with the specified name as the target entity to delete relation with.
- Entity View - use entity view with the specified name as the target entity to delete relation with.
- Tenant - use current tenant as target entity to delete relation with.
- Customer - use customer with the specified title as the target entity to delete relation with.
- Dashboard - use a dashboard with the specified title as the target entity to delete relation with.
- User - use a user with the specified email as the target entity to delete relation with.
- Edge - use an edge with the specified name as the target entity to delete relation with.
Success - If the relation(s) successfully deleted, otherwise Failure.Category Action · outputs Success, Failure · class TbDeleteRelationNode
device profile (deprecated)
Process device messages based on device profile settings (deprecated)
Create and clear alarms based on alarm rules defined in device profile. The output relation type is either 'Alarm Created', 'Alarm Updated', 'Alarm Severity Updated' and 'Alarm Cleared' or simply 'Success' if no alarms were affected.
Category Action · outputs Alarm Created, Alarm Updated, Alarm Severity Updated, Alarm Cleared, Success, Failure · class TbDeviceProfileNode
device state
Triggers device connectivity events
If incoming message originator is a device, registers configured event for that device in the Device State Service, which sends appropriate message to the Rule Engine. If metadata ts property is present, it will be used as event timestamp. Otherwise, the message timestamp will be used. If originator entity type is not DEVICE or unexpected error happened during processing, then incoming message is forwarded using Failure chain. If rate of connectivity events for a given originator is too high, then incoming message is forwarded using Rate limited chain.
Supported device connectivity events are:
- Connect event
- Disconnect event
- Activity event
- Inactivity event
Category Action · outputs Success, Failure, Rate limited · class TbDeviceStateNode
generator
Periodically generates messages
Generates messages with configurable period. Javascript function used for message generation.
Category Action · outputs Success, Failure · class TbMsgGeneratorNode
gps geofencing events
Produces incoming messages using GPS based geofencing
Extracts latitude and longitude parameters from incoming message and returns different events based on configuration parameters.
If an object with coordinates extracted from incoming message enters the geofence, sends a message with the type Entered. If an object leaves the geofence, sends a message with the type Left. If the presence monitoring strategy "On first message" is selected, sends messages via rule node connection type Inside or Outside only the first time the geofencing and duration conditions are satisfied; otherwise sends messages via rule node connection type Success. If the presence monitoring strategy "On each message" is selected, sends messages via rule node connection type Inside or Outside every time the geofencing condition is satisfied.
Output connections: Entered, Left, Inside, Outside, Success
Category Action · outputs Success, Entered, Left, Inside, Outside · class TbGpsGeofencingActionNode
log
Log incoming messages using JS script for transformation Message into String
Transform incoming Message with configured JS function to String and log final value into Aniston Nexus log file. Message payload can be accessed via msg property. For example 'temperature = ' + msg.temperature ;. Message metadata can be accessed via metadata property. For example 'name = ' + metadata.customerName;.
Category Action · outputs Success, Failure · class TbLogNode
math function
Apply math function and save the result into the message and/or database
Supports math operations like: ADD, SUB, MULT, DIV, etc and functions: SIN, COS, TAN, SEC, etc. Use 'CUSTOM' operation to specify complex math expressions.
You may use constant, message field, metadata field, attribute, and latest time-series as an arguments values. The result of the function may be also stored to message field, metadata field, attribute or time-series value.
Primary use case for this rule node is to take one or more values from the database and modify them based on data from the message. For example, you may increase `totalWaterConsumption` based on the `deltaWaterConsumption` reported by device.
Alternative use case is the replacement of simple JS `script` nodes with more light-weight and performant implementation. For example, you may transform Fahrenheit to Celsius (C = (F - 32) / 1.8) using CUSTOM operation and expression: (x - 32) / 1.8).
The execution is synchronized in scope of message originator (e.g. device) and server node. If you have rule nodes in different rule chains, they will process messages from the same originator synchronously in the scope of the server node.
Category Action · outputs Success, Failure · class TbMathNode
message count
Count incoming messages
Count incoming messages for specified interval and produces POST_TELEMETRY_REQUEST msg with messages count
Category Action · outputs Success, Failure · class TbMsgCountNode
push to cloud
Pushes messages from edge to cloud
Push messages from edge to cloud. This node used only on edge to push messages from edge to cloud. Once message arrived into this node itâs going to be converted into cloud event and saved to the local database. Node doesn't push messages directly to cloud, but stores event(s) in the cloud queue. Supports next message types:POST_TELEMETRY_REQUESTPOST_ATTRIBUTES_REQUESTATTRIBUTES_UPDATEDATTRIBUTES_DELETEDALARM
Message will be routed via Failure route if node was not able to save cloud event to database or unsupported originator type/message type arrived. In case successful storage cloud event to database message will be routed via Success route.
Category Action · outputs Success, Failure · class TbMsgPushToCloudNode
push to edge
Push messages from cloud to edge
Push messages from cloud to edge. Message originator must be assigned to particular edge or message originator is EDGE entity itself. This node used only on cloud instances to push messages from cloud to edge. Once message arrived into this node itâs going to be converted into edge event and saved to the database. Node doesn't push messages directly to edge, but stores event(s) in the edge queue. Supports next message types:POST_TELEMETRY_REQUESTPOST_ATTRIBUTES_REQUESTATTRIBUTES_UPDATEDATTRIBUTES_DELETEDALARM
Message will be routed via Failure route if node was not able to save edge event to database or unsupported message type arrived. In case successful storage edge event to database message will be routed via Success route.
Category Action · outputs Success, Failure · class TbMsgPushToEdgeNode
rest call reply
Sends reply to REST API call to rule engine
Expects messages with any message type. Forwards incoming message as a reply to REST API call sent to rule engine.
Category Action · outputs Success, Failure · class TbSendRestApiCallReplyNode
rpc call reply
Sends reply to RPC call from device
Expects messages with any message type. Will forward message body to the device.
Category Action · outputs Success, Failure · class TbSendRPCReplyNode
rpc call request
Sends RPC call to device
Expects messages with "method" and "params". Will forward response from device to next nodes.If the RPC call request is originated by REST API call from user, will forward the response to user immediately.
Category Action · outputs Success, Failure · class TbSendRPCRequestNode
save attributes
Saves attribute data with a configurable scope and according to configured processing strategies.
Node performs three actions:
- Attributes: save attribute data to a database.
- WebSockets: notify WebSockets subscriptions about attribute data updates.
- Calculated fields: notify calculated fields about attribute data updates.
- On every message: perform the action for every message.
- Deduplicate: perform the action only for the first message from a particular originator within a configurable interval.
- Skip: never perform the action.
- Basic
- On every message: applies the
Category Action · outputs
Success,Failure· classTbMsgAttributesNode
- On every message: applies the
save time series
Saves time series data with a configurable TTL and according to configured processing strategies.
Node performs four actions:
- Time series: save time series data to a
ts_kvtable in a DB. - Latest values: save time series data to a
ts_kv_latesttable in a DB. - WebSockets: notify WebSockets subscriptions about time series data updates.
- Calculated fields: notify calculated fields about time series data updates.
- On every message: perform the action for every message.
- Deduplicate: perform the action only for the first message from a particular originator within a configurable interval.
- Skip: never perform the action.
- Basic
- On every message: applies the
Category Action · outputs
Success,Failure· classTbMsgTimeseriesNode
- On every message: applies the
save to custom table
Node stores data from incoming Message payload to the Cassandra database into the predefined custom table that should have <b>cs_tb_</b> prefix, to avoid the data insertion to the common TB tables.<br><b>Note:</b> rule node can be used only for Cassandra DB.
Administrator should set the custom table name without prefix: cs_tb_.
Administrator can configure the mapping between the Message field names and Table columns name.
Note:If the mapping key is $entity_id, that is identified by the Message Originator, then to the appropriate column name(mapping value) will be write the message originator id.
If specified message field does not exist or is not a JSON Primitive, the outbound message will be routed via failure chain, otherwise, the message will be routed via success chain.
Category Action · outputs Success, Failure · class TbSaveToCustomCassandraTableNode
synchronization end
This Node is now deprecated. Use "Checkpoint" instead.
Category Action · outputs Success, Failure · class TbSynchronizationEndNode
synchronization start
This Node is now deprecated. Use "Checkpoint" instead.
This node should be used together with "synchronization end" node. This node will put messages into queue based on message originator id. Subsequent messages will not be processed until the previous message processing is completed or timeout event occurs. Size of the queue per originator and timeout values are configurable on a system level
Category Action · outputs Success, Failure · class TbSynchronizationBeginNode
unassign from customer
Unassign message originator entity from customer
If the message originator is not assigned to any customer, rule node will do nothing.
If the incoming message originator is a dashboard, will try to search for the customer by title specified in the configuration. If customer doesn't exist, the exception will be thrown. Otherwise will unassign the dashboard from retrieved customer.
Other entities can be assigned only to one customer, so specified customer title in the configuration will be ignored if the originator isn't a dashboard.
Category Action · outputs Success, Failure · class TbUnassignFromCustomerNode
Enrichment nodes
calculate delta
Calculates delta and amount of time passed between previous timeseries key reading and current value for this key from the incoming message
Useful for metering use cases, when you need to calculate consumption based on pulse counter reading.
Output connections: Success, Other or Failure.
Category Enrichment · outputs Success, Failure, Other · class CalculateDeltaNode
customer attributes
Adds message originator customer attributes or latest telemetry into message or message metadata
Useful in multi-customer solutions where each customer has a different configuration or threshold set that is stored as customer attributes or telemetry data and used for dynamic message filtering, transformation, or actions such as alarm creation if the threshold is exceeded.
Output connections: Success, Failure.
Category Enrichment · outputs Success, Failure · class TbGetCustomerAttributeNode
customer details
Adds message originator customer details into message or message metadata
Useful in multi-customer solutions where we need dynamically use customer contact information such as email, phone, address, etc., for notifications via email, SMS, and other notification providers.
Output connections: Success, Failure.
Category Enrichment · outputs Success, Failure · class TbGetCustomerDetailsNode
fetch device credentials
Adds device credentials to the message or message metadata
if message originator type is Device and device credentials was successfully fetched, rule node enriches message or message metadata with credentialsType and credentials properties. Useful when you need to fetch device credentials and use them for further message processing. For example, use device credentials to interact with external systems.
Output connections: Success, Failure.
Category Enrichment · outputs Success, Failure · class TbFetchDeviceCredentialsNode
originator attributes
Adds attributes and/or latest timeseries data for the message originator to the message or message metadata
Useful when you need to retrieve some attributes or the latest telemetry readings from the message originator that are not included in the incoming message to use them for further message processing. For example to filter messages based on the threshold value stored in the attributes.
Output connections: Success, Failure.
Category Enrichment · outputs Success, Failure · class TbGetAttributesNode
originator fields
Adds message originator fields values into message or message metadata
Fetches fields values specified in the mapping. If specified field is not part of originator fields it will be ignored. Useful when you need to retrieve originator fields and use them for further message processing.
Output connections: Success, Failure.
Category Enrichment · outputs Success, Failure · class TbGetOriginatorFieldsNode
originator telemetry
Adds message originator telemetry for selected time range into message metadata
Useful when you need to get telemetry data set from the message originator for a specific time range instead of fetching just the latest telemetry or if you need to get the closest telemetry to the fetch interval start or end. Also, this node can be used for telemetry aggregation within configured fetch interval.
Output connections: Success, Failure.
Category Enrichment · outputs Success, Failure · class TbGetTelemetryNode
tenant attributes
Adds message originator tenant attributes or latest telemetry into message or message metadata
Useful when you need to retrieve some common configuration or threshold set that is stored as tenant attributes or telemetry data and use it for further message processing.
Output connections: Success, Failure.
Category Enrichment · outputs Success, Failure · class TbGetTenantAttributeNode
tenant details
Adds message originator tenant details into message or message metadata
Useful when we need to retrieve contact information from your tenant such as email, phone, address, etc., for notifications via email, SMS, and other notification providers.
Output connections: Success, Failure.
Category Enrichment · outputs Success, Failure · class TbGetTenantDetailsNode
External nodes
AI request
Sends a request to an AI model using system and user prompts. Supports JSON mode.
Interact with large language models (LLMs) by sending dynamic requests from your rule chain.
You can select a specific AI model and define its behavior using a system prompt (optional context or role) and a user prompt (the main task).
Both prompts can be populated with data and metadata from the incoming message using patterns.
For example, the $[*] and ${*} patterns allow you to access the all message body and all metadata, respectively.
After sending the request, the node waits for a response within a configured timeout.
You can specify the desired response format as Text, JSON, or provide a specific JSON Schema to structure the output.
The AI-generated content is forwarded as the body of the outgoing message; the originator, message type, and metadata from the incoming message remain unchanged.
Output connections: Success, Failure.
Category External · outputs Success, Failure · class TbAiNode
aws lambda
Publish message to the AWS Lambda
Publishes messages to AWS Lambda, a service that lets you run code without provisioning or managing servers. It sends messages using a RequestResponse invocation type. The node uses a pre-configured client and specified function to run.
Output connections: Success, Failure.
Category External · outputs Success, Failure · class TbAwsLambdaNode
aws sns
Publish message to the AWS SNS
Will publish message payload to the AWS SNS topic. Outbound message will contain response fields (messageId, requestId) in the Message Metadata from the AWS SNS. For example requestId field can be accessed with metadata.requestId.
Category External · outputs Success, Failure · class TbSnsNode
aws sqs
Publish messages to the AWS SQS
Will publish message payload and metadata attributes to the AWS SQS queue. Outbound message will contain response fields (messageId, requestId, messageBodyMd5, messageAttributesMd5, sequenceNumber) in the Message Metadata from the AWS SQS. For example requestId field can be accessed with metadata.requestId.
Category External · outputs Success, Failure · class TbSqsNode
azure iot hub
Publish messages to the Azure IoT Hub
Will publish message payload to the Azure IoT Hub with QoS AT_LEAST_ONCE.
Category External · outputs Success, Failure · class TbAzureIotHubNode
gcp pubsub
Publish message to the Google Cloud PubSub
Will publish message payload to the Google Cloud Platform PubSub topic. Outbound message will contain response fields (messageId in the Message Metadata from the GCP PubSub. messageId field can be accessed with metadata.messageId.
Category External · outputs Success, Failure · class TbPubSubNode
kafka
Publish messages to Kafka server
Will send record via Kafka producer to Kafka server. Outbound message will contain response fields (offset, partition, topic) from the Kafka in the Message Metadata. For example partition field can be accessed with metadata.partition. Authentication: none (security settings only from other properties), SASL PLAIN / SCRAM-SHA-256 / SCRAM-SHA-512 with username and password, or SASL OAUTHBEARER with an OAuth 2.0 client credentials token endpoint, over SASL_SSL or SASL_PLAINTEXT.
Category External · outputs Success, Failure · class TbKafkaNode
mqtt
Publish messages to the MQTT broker
Will publish message payload to the MQTT broker with QoS AT_LEAST_ONCE.
Category External · outputs Success, Failure · class TbMqttNode
rabbitmq
Publish messages to the RabbitMQ
Will publish message payload to RabbitMQ queue.
Category External · outputs Success, Failure · class TbRabbitMqNode
rest api call
Invoke REST API calls to external REST server
Will invoke REST API call GET | POST | PUT | DELETE to external REST server. Message payload added into Request body. Configured attributes can be added into Headers from Message Metadata. Outbound message will contain response fields (status, statusCode, statusReason and response headers) in the Message Metadata. Response body saved in outbound Message payload. For example statusCode field can be accessed with metadata.statusCode.
Note- if you use system proxy properties, the next system proxy properties should be added: "http.proxyHost" and "http.proxyPort" or "https.proxyHost" and "https.proxyPort" or "socksProxyHost" and "socksProxyPort",and if your proxy with auth, the next ones should be added: "tb.proxy.user" and "tb.proxy.password" to the nexus.conf file.
Category External · outputs Success, Failure · class TbRestApiCallNode
send email
Sends email message via SMTP server.
Expects messages with SEND_EMAIL type. Node works only with messages that where created using to Email transformation Node, please connect this Node with to Email Node using Successful chain.
Category External · outputs Success, Failure · class TbSendEmailNode
send notification
Sends notification to targets using the template
Will send notification to the specified targets using the template
Category External · outputs Success, Failure · class TbNotificationNode
send sms
Sends SMS message via SMS provider.
Will send SMS message by populating target phone numbers and sms message fields using values derived from message metadata.
Category External · outputs Success, Failure · class TbSendSmsNode
send to slack
Send message via Slack
Sends message to a Slack channel or user
Category External · outputs Success, Failure · class TbSlackNode
Filter nodes
alarm status filter
Checks alarm status.
Checks the alarm status to match one of the specified statuses.
Output connections: True, False, Failure.
Category Filter · outputs True, False · class TbCheckAlarmStatusNode
asset profile switch
Route incoming messages based on the name of the asset profile
Route incoming messages based on the name of the asset profile. The asset profile name is case-sensitive.
Output connections: Asset profile name or Failure
Category Filter · outputs default · class TbAssetTypeSwitchNode
check fields presence
Checks the presence of the specified fields in the message and/or metadata.
By default, the rule node checks that all specified fields are present. Uncheck the 'Check that all selected fields are present' if the presence of at least one field is sufficient.
Output connections: True, False, Failure
Category Filter · outputs True, False · class TbCheckMessageNode
check relation presence
Checks the presence of the relation between the originator of the message and other entities.
If 'check relation to specific entity' is selected, you should specify a related entity. Otherwise, the rule node checks the presence of a relation to any entity. In both cases, relation lookup is based on configured direction and type.
Output connections: True, False, Failure
Category Filter · outputs True, False · class TbCheckRelationNode
device profile switch
Route incoming messages based on the name of the device profile
Route incoming messages based on the name of the device profile. The device profile name is case-sensitive
Output connections: Device profile name or Failure
Category Filter · outputs default · class TbDeviceTypeSwitchNode
entity type filter
Filter incoming messages by the type of message originator entity
Checks that the entity type of the incoming message originator matches one of the values specified in the filter.
Output connections: True, False, Failure
Category Filter · outputs True, False · class TbOriginatorTypeFilterNode
entity type switch
Route incoming messages by Message Originator Type
Routes messages to chain according to the entity type ('Device', 'Asset', etc.).
Output connections: Message originator type or Failure
Category Filter · outputs Success, Failure · class TbOriginatorTypeSwitchNode
gps geofencing filter
Filter incoming messages by GPS based geofencing
Extracts latitude and longitude parameters from the incoming message and checks them according to configured perimeter. Configuration:
- Latitude key name - name of the message field that contains location latitude;
- Longitude key name - name of the message field that contains location longitude;
- Perimeter type - Polygon or Circle;
- Fetch perimeter from message metadata - checkbox to load perimeter from message metadata; Enable if your perimeter is specific to device/asset and you store it as device/asset attribute;
- Perimeter key name - name of the metadata key that stores perimeter information;
- For Polygon perimeter type:
- Polygon definition - string that contains array of coordinates in the following format: [[lat1, lon1],[lat2, lon2],[lat3, lon3], ... , [latN, lonN]]
- For Circle perimeter type:
- Center latitude - latitude of the circle perimeter center;
- Center longitude - longitude of the circle perimeter center;
- Range - value of the circle perimeter range, double-precision floating-point value;
- Range units - one of: Meter, Kilometer, Foot, Mile, Nautical Mile;
Output connections:
True, False, FailureCategory Filter · outputs True, False · class TbGpsGeofencingFilterNode
message type filter
Filter incoming messages by Message Type
If incoming message type is expected - send Message via True chain, otherwise False chain is used.
Output connections: True, False, Failure
Category Filter · outputs True, False · class TbMsgTypeFilterNode
message type switch
Route incoming messages by Message Type
Sends messages with message types "Post attributes", "Post telemetry", "RPC Request" etc. via corresponding chain, otherwise Other chain is used.
Output connections: Message type connection, Other - if message type is custom or Failure
Category Filter · outputs Success, Failure · class TbMsgTypeSwitchNode
script
Filter incoming messages using TBEL or JS script
Evaluates boolean function using incoming message. The function may be written using TBEL or plain JavaScript. Script function should return boolean value and accepts three parameters:
Message payload can be accessed via msg property. For example msg.temperature < 10;
Message metadata can be accessed via metadata property. For example metadata.customerName === 'John';
Message type can be accessed via msgType property.
Output connections: True, False, Failure
Category Filter · outputs True, False · class TbJsFilterNode
switch
Routes incoming message to one OR multiple output connections.
Node executes configured TBEL(recommended) or JavaScript function that returns array of strings (connection names). If Array is empty - message not routed to next Node. Message payload can be accessed via msg property. For example msg.temperature < 10;
Message metadata can be accessed via metadata property. For example metadata.customerName === 'John';
Message type can be accessed via msgType property.
Output connections: Custom connection(s) defined by switch node or Failure
Category Filter · outputs Success, Failure · class TbJsSwitchNode
Flow nodes
acknowledge
Acknowledges the incoming message
After acknowledgement, the message is pushed to related rule nodes. Useful if you don't care what happens to this message next.
Category Flow · outputs Success, Failure · class TbAckNode
checkpoint
transfers the message to another queue
After successful transfer incoming message is automatically acknowledged. Queue name is configurable.
Category Flow · outputs Success, Failure · class TbCheckpointNode
output
transfers the message to the caller rule chain
Produces output of the rule chain processing. The output is forwarded to the caller rule chain, as an output of the corresponding "input" rule node. The output rule node name corresponds to the relation type of the output message, and it is used to forward messages to other rule nodes in the caller rule chain.
Category Flow · outputs Success, Failure · class TbRuleChainOutputNode
rule chain
Transfers the message to another rule chain
The incoming message is forwarded to the input node of target rule chain. If 'Forward message to the originator's default rule chain' is enabled, then target rule chain might be resolved dynamically based on incoming message originator. In this case rule chain specified in the configuration will be used as fallback rule chain.
Output connections: Any connection(s) produced by output node(s) in the target rule chain.
Category Flow · outputs Success, Failure · class TbRuleChainInputNode
Transformation nodes
change originator
Change message originator to Tenant/Customer/Related Entity/Alarm Originator/Entity by name pattern.
Configuration:
- Customer - use customer of incoming message originator as new originator. Only for assigned to customer originators with one of the following type: 'User', 'Asset', 'Device'.
- Tenant - use current tenant as new originator.
- Related Entity - use related entity as new originator. Lookup based on configured relation query. If multiple related entities are found, only first entity is used as new originator, other entities are discarded.
- Alarm Originator - use alarm originator as new originator. Only if incoming message originator is alarm entity.
- Entity by name pattern - specify entity type and name pattern of new originator. Following entity types are supported: 'Device', 'Asset', 'Entity View', 'Edge' or 'User'.
Success, Failure.Category Transformation · outputs Success, Failure · class TbChangeOriginatorNode
copy key-value pairs
Copies key-value pairs from message to message metadata or vice-versa.
Copies key-value pairs from the message to message metadata, or vice-versa, according to the configured direction and keys. Regular expressions can be used to define which keys-value pairs to copy. Any configured key not found in the source will be ignored.
Output connections: Success, Failure.
Category Transformation · outputs Success, Failure · class TbCopyKeysNode
deduplication
Deduplicate messages within the same originator entity for a configurable period based on a specified deduplication strategy.
Deduplication strategies:
- FIRST - return first message that arrived during deduplication period.
- LAST - return last message that arrived during deduplication period.
- ALL - return all messages as a single JSON array message. Where each element represents object with msg and metadata inner properties.
Category Transformation · outputs Success, Failure · class TbMsgDeduplicationNode
delete key-value pairs
Deletes key-value pairs from message or message metadata.
Deletes key-value pairs from the message or message metadata according to the configured keys and/or regular expressions.
Output connections: Success, Failure.
Category Transformation · outputs Success, Failure · class TbDeleteKeysNode
json path
Transforms incoming message body using JSONPath expression.
JSONPath expression specifies a path to an element or a set of elements in a JSON structure.
Output connections: Success, Failure.
Category Transformation · outputs Success, Failure · class TbJsonPathNode
rename keys
Renames message or message metadata keys.
Renames keys in the message or message metadata according to the provided mapping. If key to rename doesn't exist in the specified source (message or message metadata) it will be ignored.
Output connections: Success, Failure.
Category Transformation · outputs Success, Failure · class TbRenameKeysNode
script
Change Message payload, Metadata or Message type using JavaScript
JavaScript function receive 3 input parameters
msg - is a message payload.metadata - is a message metadata.msgType - is a message type.
Should return the following structure:{ msg: <i style="color: #666;">new payload,
   metadata: <i style="color: #666;">new metadata,
   msgType: <i style="color: #666;">new msgType }
All fields in resulting object are optional and will be taken from original message if not specified.
Output connections: Success, Failure.
Category Transformation · outputs Success, Failure · class TbTransformMsgNode
split array msg
Split array message into several messages
Splits an array message into individual elements, with each element sent as a separate message. All outbound messages will have the same type and metadata as the original array message.
Output connections: Success, Failure.
Category Transformation · outputs Success, Failure · class TbSplitArrayMsgNode
to email
Transforms message to email message
Transforms message to email message. If transformation completed successfully output message type will be set to SEND_EMAIL.
Output connections: Success, Failure.
Category Transformation · outputs Success, Failure · class TbMsgToEmailNode