Unit 3: Building the Routing Rule¶
A routing rule is made up of a series of rule nodes that process the incoming messages from devices.
Step 1: Creating A Rule¶
Log in to EnOS Management Console and click Routing Rule from the left navigation menu.
Click New Routing Rule.
Enter the rule name Human Sensor Rule and description, and click OK.
Step 2: Designing the Rule¶
You will enter a design canvas page with the Rule Entry node.
Design and connect the rule with the following nodes in the order shown below.
Rule Entry Node¶
Every routing rule must start with the Rule Entry node.
Click the Rule Entry node.
Select EnOS IoT from the Gateway Type drop-down.
Select Human Sensor Product from the list so that all incoming data from devices under this product will come to this rule to be processed.
For more information, see the Rule Entry node.
Message Type Switch Node¶
The Message Type Switch node routes the incoming message when the devices under the Human Sensor Product post an event.
Click the Message Type Switch node.
Select Post Event from the Message Type drop-down.
For more information, see the Message Type Switch node.
Multicast Node¶
The Multicast node forwards the input to multiple nodes to be processed in different ways. In this tutorial, the input is processed in 2 ways: sends an sms to the specified mobile number when human movement is detected, and routes the rule to the EnOS_default rule which will send the event to a Kafka topic.
For more information, see the Multicast node.
SMS Node¶
The SMS node sends an SMS to the specified mobile number.
Select the country code and enter the mobile number.
Select Notify DIS Event from the Template Name drop-down.
Enter the event name and details in the subsequent fields.
For more information, see the SMS node.
Checkpoint¶
The Checkpoint node routes the rule to the EnOS_default rule.
Click the Checkpoint node.
Select Use Default Rule from the Action drop-down.
For more information, see the Checkpoint node.