How can we help?


0 results found

Rules Endpoints

Rules define the conditions that trigger actions in Axonize. For example, a Rule can define that an email is sent to a specific person with a specific message when the temperature of a specific refrigerator goes over 20° and the water sprinkling system can be automatically turned on.

The definition of a rule comprises the following –

  • Entities – Specify the Application(s), Product(s) or Device(s) to which the Rule applies.
  • Schedule – Specify the schedule during which the Rule conditions are active.
  • Conditions – Specify the conditions that trigger the Rule, such as when a Device reading is within a specific value range, over a specific threshold, entering/exiting a geo-fence and so on.
  • Scheduled (CRON) Rules Rules can also be triggered according to a CRON-defined schedule. For example, to report the status of a Device every half-hour. When a CRON schedule is defined for a Rule, then no other conditions in this Rule are relevant, including the schedule
  • AND Logic – Inside a Rule To define that multiple Conditions must be met at the same time in order to trigger the Rule (AND), define multiple Conditions inside the same Rule.
  • OR Logic – Between Rules Rules run at the same time. Therefore, you can define multiple Rules, each with their own Condition. If the Condition of two Rules exists for a specific Device, then both Rules are triggered when their conditions are matched.
  • Actions – Specify the operations that are activated when the conditions of the Rule are matched, such as sending an SMS/email, making a call, sending information to an ERP/CRM or activating a command on the Device (such as opening a light or closing a lock). You can also specify that an AlarmInstance is created when the Rule is triggered. Various fields of information from the Rule itself and/or from the Event that triggered the Rule and/or from the related Application can be used by the Action that is triggered by this Rule.

Axonize provides a variety of endpoints for handling Rules, as follows –

Instantaneous Rules, Conditions and Events

An instantaneous rule is a rule in which, one of the rule’s conditions is defined as an instantaneous condition (set in the condtitions/type) on an event with an instantaneous eventType code. Pressing a button is an example of an instantaneous event.

Instantaneous Rules differ from other Rules in the following ways –

  • An instantaneous Rule triggers every time that the instantaneous event occurs, and does not wait for a restore to be triggered another time.
  • A Rule that contains an instantaneous condition and an AND relationship within that Rule employs the following logic –

When the instantaneous event occurs, the Rule then checks the other conditions in that Rule to see whether they are true. If all the Rule’s other conditions are true, then the Rule is triggered. This means that the Rule is only triggered when the instantaneous event occurs AND all other conditions of the Rule are true. Note that the converse of this does not trigger the Rule.

For example, let’s say that you have a button-press event, which is an instantaneous event, and a door-open event, which is not an instantaneous event. If the button is pressed, then the Rule checks whether the door is open and if it is, triggers the Rule. However, the opposite does not trigger the rule. If the door is open, the Rule is not triggered, regardless of when the instantaneous event (button press) last occurred.


Multiple Conditions

Multiple conditions can be defined for a Rule and an AND relationship exists between them. However, when multiple conditions are defined, they must apply to a specific (single) Device. This means that a single Device ID must be specified, and the Rule cannot apply to a Product ID, App ID or multiple Device IDs.

Multiple instantaneous conditions cannot be defined for a Rule with an AND relationship between conditions.

Duration Conditions

A Duration condition (conditions/durationInMinutes) can only be used on a specific Device. When a duration condition is used, it must be the only condition, meaning that no additional conditions can be defined on that Rule.

An instantaneous event cannot have a duration condition.