Bosch IoT Device Management - will be discontinued by mid 2024

Rule monitoring

Rule state

A rule can be in one of the following states:

  • DEFINED - the rule has just been created or modified but is still not active and is not ready to be fired

  • ENABLED - the rule has been activated by the operator and is ready to be fired by the relevant trigger(s)

  • DISABLED - the rule has been deactivated and cannot be fired by any trigger

  • FAILED TO ENABLE - the rule could not be enabled, for instance when its scope or execution options could not be evaluated or there was a system error

Rules do not have a summarized execution status.

Instead, you can monitor the execution statuses of the tasks launched by this rule (task execution statuses), or the execution statuses of the devices in the rule scope (device rule execution statuses).

Device execution status within a rule

The standard way to monitor the rule execution is through its involved devices - whether they have finished executing the script, whether there is an error, etc.

For each device, this is reported as device rule execution status.

Consider the following diagram and the explanations and example below.

images/confluence/download/attachments/2417267796/device-rule-execution-status.png

The device rule execution status of a particular device includes and is formed by the device task execution statuses of this device from all tasks (launched by the rule) in which it has been involved. However, its most recent device task execution status prevails.

This is because the latest rule execution by each device is considered as the most important one for monitoring purposes - as it would reflect the current information about the respective device within the rule.

Therefore, the device task execution status in the latest task (launched by the rule) in which the device has been involved determines the overall device rule execution status for the particular device.

For example, on the illustration above, there is a rule which was triggered three times and launched three tasks. The device was involved in all of these three tasks. The device task execution status within the latest task, in this case task 3, will become the device rule execution status. If the device is still executing the action script in the context of task 3, the overall device rule execution status of this device will be reported as RUNNING. If the device has finished executing task 3 with an error, the overall device rule execution status of this device will be reported as FINISHED_ERROR.


Here is a list of the attributes by which you can monitor a device within a rule:

  • Device ID – identifying the device executing the rule

  • A list of device task execution statuses - a list showing all previous executions of the rule by the particular device - the tasks launched by the rule in which the device was involved.

  • Device rule execution status – an overall execution status for the device within the rule, taken from the latest task launched by the rule in which the device was involved. It could be:

    • RUNNING

    • FINISHED_CANCELED

    • FINISHED_ERROR

    • FINISHED_WARNING

    • FINISHED_SUCCESS

Rule Monitoring Attributes

Here is the complete list of attributes reported for rules:

  • Rule name / Display name – the rule name assigned by the operator when creating the rule

  • Rule ID – the ID of the rule assigned by the system

  • Trigger, scope, action, and execution options – the rule's properties defined when it was created or modified

  • State – a rule is always in one of the following states:

    • DEFINED – the state of a rule which has just been created or modified but is still not active and is not ready to be fired

    • ENABLED – the state of a rule which has been activated by the operator and is ready to be fired by the relevant trigger(s)

    • DISABLED – the state of a rule which has been deactivated and cannot be fired by any trigger

    • FAILED_TO_ENABLE – the state of a rule which could not be enabled, for instance when its scope or execution options could not be evaluated or there was a system error

  • State description – provides additional information about the actual rule state, for example the reason for a FAILED_TO_ENABLE state or any other relevant explanation

  • Triggers count – indicates how many times the rule has been triggered so far. This number corresponds to the number of tasks launched by the rule

  • List of launched tasks – provides a list of all tasks launched as a result of the triggering of this rule and allows their monitoring with the same attributes as reported for manually launched tasks

  • Number of involved devices – indicates the number of devices involved in the rule, i.e. in all tasks launched by the rule

  • Number of successfully finished – indicates the number of devices for which the last task launched by the rule has finished successfully

  • Number of finished with error – indicates the number of devices for which the last task launched by the rule has finished with errors

  • Number of finished with warning – indicates the number of devices for which the last task launched by the rule has finished with warnings

  • Number of canceled devices – indicates the number of devices for which the last task launched by the rule has been canceled

  • Number of running devices – indicates the number of devices for which the last task launched by the rule is still running

  • List of devices with device rule execution status – shows all devices included in the rule scope with their summarized and detailed execution statuses - for the whole rule and for each task launched by the rule in which the particular device was involved.

Rule state vs task execution status

Please, pay attention that:

  • a rule's state can be defined, enabled, disabled or failed to enable

  • a task's execution status can be either running or finished, with the respective varieties (finished canceled, finished error, finished warning, finished success)