Rule Logic - Comparison
This page describes the comparison rule logic in more detail
The Comparison Logic Block consists of two sections:
- Data sources
The data source section is used to specify which topic of a data sample triggers the logic block and which property of that data sample is further used in the condition section. At least one data source is required, more can be added if the logic requires.
One device can be assigned to multiple data sources, depending on how many keys of the sample should be evaluated in the conditions.
If a device type schema is present, the data source selection allows choosing data points from the device type schema. If no schema is present, the topic and data key have to be entered on the comparison logic block.
The topic and the data key of a data sample can be also viewed within Message Logs on the Device Detail Page of a device. To match all topics,
*can be used.
Topic and data key in message logs
In the condition section, the data source alongside a comparison operator is used to compare the value of a data sample, to a constant number or the latest sample of another data source. Nested conditions can be configured using the plus button which adds another comparison block in the condition.
The modifiers for
is notcan be changed by clicking on the blue text. When adding additional conditions, they are not linked to one another. Each condition (if it evaluates to true) will trigger the assigned output.
This setup allows for quite complex logic to be applied to newly received samples without having to write any code.