Skip to main content

Intro

Connhex Rules Engine is a service that allows you to create and apply rules of different nature to the data sent by devices in Connhex Cloud.

There are three main components:

  • Rules: define the conditions that must be met for the rule to be executed, and the actions to be taken when the conditions are met. Additional details on rules can be found in the rules section
  • Conditions: define the conditions that must be met for the rule to be executed. They are coupled with actuations to define the actions to be taken when the conditions are met. Additional details on conditions can be found in the conditions section
  • Events: represent the execution of a rule, and are used for historicization purposes. Additional details on events can be found in the events section

Use cases

Connhex Rules Engine can be used to implement a wide range of functionalities. What all of these have in common is that they are based on the data sent by devices in Connhex Cloud.

You should think of using Connhex Rules Engine when:

  • some actions need to be taken when certain conditions on the data are met
  • you need to perform some kind of data processing at regular intervals
  • you want to keep track at how certain conditions have been met over time (historicization, once again, is a common theme across Connhex services)

Data structure

Typescript

The following sections use Typescript to describe the structure of the data. This is done to facilitate the understanding of the data structure, but there's obviously no requirement to use Typescript in any of your code. For the complete API reference, please refer to the API documentation.

The data structure of each rule, condition and event is defined in the respective section. Two enums are used thoughout the documentation:

export enum CptActivityStatus {
Active = 'active',
Inactive = 'inactive',
}

export enum CptNotificationPolicy {
Trigger = 'trigger',
Reentry = 'reentry',
}