Bosch IoT Device Management - will be discontinued by mid 2024

Task monitoring

Task execution status

A task usually involves more than one device, up to potentially millions of devices. The execution results reported for each device within the task (device task execution statuses) serve as a basis of the overall task result (task execution status).

In other words, the device task execution statuses of all devices participating in a task are summarized to form the execution status of the whole task - the task execution status.

images/confluence/download/attachments/2417267730/Task-execution-status.png

A task's execution status can be RUNNING, FINISHED, or FAILED TO LAUNCH.

The following rules apply:

  • If at least one device within the task scope is still executing the task, the overall task execution status is reported as RUNNING.

  • If all devices within the task scope have finished executing the task, the overall task execution status is reported as FINISHED.
    This includes all varieties of FINISHED, i.e. finished successfully or with error, warning or canceled.

  • If a task's launching was unsuccessful, it is reported as FAILED TO LAUNCH.

The system reports statistics for the overall number of devices executing the task, as well as for the number of devices for which the execution is still running or has finished with a particular result.

Device execution status within a task

The system reports the following monitoring attributes for each device in the context of a mass management task:

  • Device ID – identifying the device executing the task

  • Device task execution status – the overall execution status of the device in the context of the task, formed on the basis of specific rules of precedence, explained in detail in the Partial execution states section below.
    The device task execution status may be:

    • RUNNING

    • FINISHED_CANCELED

    • FINISHED_ERROR

    • FINISHED_WARNING

    • FINISHED_SUCCESS

images/confluence/download/thumbnails/2417267730/Device-task-execution-status---device-1.png

Task Monitoring Attributes

Below is the complete list of attributes with which a task can be monitored:

  • Task name / Display name – the name defined by the operator when creating the task, or automatically assigned by the rule in the cases where the task is launched by a rule

  • Task ID – the task ID assigned by the system

  • Start time – the time when the task was launched

  • End time – the time when the task finished

  • Origin – indicates whether the task was launched manually by the operator or automatically by a rule, and if so - also the rule trigger type

  • Scope, action and execution options – the task's launch properties defined when it was created

  • State – the task's execution status reported on the basis of the execution statuses of the devices in its scope. It can be one of the following:

    • RUNNING – indicates a task which has been launched but the execution of its action is still running for some of the devices in its scope

    • FINISHED – indicates a task in which all devices in its scope have finished the action execution, regardless of whether successfully or with some error, warning, or canceling

    • FAILED_TO_LAUNCH – indicates a task whose launching was unsuccessful, for instance because its scope or execution options could not be evaluated or there was а system error

  • State description – provides additional information about the execution status. This attribute is optional and may be provided by the Mass Management Engine, if needed. It may indicate the reason for the FAILED_TO_LAUNCH status, or how a task has been canceled, or some extra explanation from the system about the current statе of the task

  • Next timed activation – this attribute is reported when the time constraint execution option is applied. If a task is currently inactive because the current moment does not fall within the allowed time schedule, this attribute will indicate when the task will start to execute again

  • Next timed deactivation – a counterpart to the above, this attribute shows when a currently active task will be deactivated due to the time-constraint restriction

  • Number of involved devices – the number of devices executing the task. This attribute is reported for tasks with device scope

  • Number of successfully finished – the number of involved devices for which the task execution has been successful

  • Number of finished with error – the number of involved devices for which the task execution has returned errors

  • Number of finished with warning – the number of involved devices for which the task execution has returned warnings

  • Number of canceled devices – the number of devices for which the task execution has been canceled

  • Number of running devices – the number of devices for which the task execution is still running

  • List of devices with device task execution status – a complete list of execution statuses for each involved device. This allows detailed executions per device to be monitored separately.


For tasks with system scope the value of the monitoring attributes 'number of involved devices', 'number of successfully finished', etc. is always set to 0 as the task action is executed outside the context of any particular device. In the monitoring attribute 'list of devices with device task execution status', there will be reported one device task execution status, representing the system. From there it is also possible to monitor the partial executions of the action script.

Partial execution states

For detailed information on what a partial execution is, please read here.

As a brief reminder, the action script of a task or rule is defined in the Groovy scripting language and includes one or several methods of our Groovy APIs.

You can monitor the current progress of the action script's execution, as the system reports results for:

  • the sending of the script to the device,

  • the execution of specific methods in the action script

  • the execution of the closure (if any).

Each step, i.e. each partial execution, can have one of the following execution states:

  • RUNNING

    • RUNNING_PENDING_EXECUTION

    • RUNNING_WAIT_CONFIRMATION

    • RUNNING_SCHEDULED_FOR_FUTURE

    • RUNNING_WAIT_CONCURRENCY

    • RUNNING_NOT_READY_TO_EXECUTE

  • FINISHED

    • FINISHED_SUCCESS

    • FINISHED_WARNING

    • FINISHED_ERROR

    • FINISHED_CANCELED

The system applies the following rules to determine the device task execution status on the basis of the partial execution states:

  1. If at least one partial execution state for the particular device is RUNNING_*, the overall status of this device within the task is RUNNING

  2. Otherwise, if at least one partial execution state for the particular device is FINISHED_CANCELED, the overall status of this device within the task is FINISHED_CANCELED

  3. Otherwise, if at least one partial execution state for the particular device is FINISHED_ERROR, the overall status of this device within the task is FINISHED_ERROR (i.e. when there is no running or finished_canceled)

  4. Otherwise, if at least one partial execution state for the particular device is FINISHED_WARNING, the overall status of this device within the task is FINISHED_WARNING (i.e. when there is no running or finished_canceled/error)

  5. Otherwise, if all partial execution states for the particular device are FINISHED_SUCCESS, the overall status of this device within the task is FINISHED_SUCCESS (i.e. when there is no running or finished_canceled/error/warning)