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

  1. Log in to EnOS Management Console and click Routing Rule from the left navigation menu.
  2. Click New Routing Rule.
  3. 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.


../../_images/s2_rule.png

Rule Entry Node

Every routing rule must start with the Rule Entry node.

  1. Click the Rule Entry node.
  2. Select EnOS IoT from the Gateway Type drop-down.
  3. 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.


../../_images/s2_rule_rule_entry.png


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.

  1. Click the Message Type Switch node.
  2. Select Post Event from the Message Type drop-down.


../../_images/s2_rule_msg_type_switch.png


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.

  1. Select the country code and enter the mobile number.
  2. Select Notify DIS Event from the Template Name drop-down.
  3. Enter the event name and details in the subsequent fields.


../../_images/s2_rule_sms.png


For more information, see the SMS node.

Checkpoint

The Checkpoint node routes the rule to the EnOS_default rule.

  1. Click the Checkpoint node.
  2. Select Use Default Rule from the Action drop-down.


../../_images/s2_rule_checkpoint.png


For more information, see the Checkpoint node.