If a workflow triggers a sub operation, then the mapper is incorrectly reacting to command status changes and sending a cloud message to transition operation status.
For example, below shows the presence of the 501,c8y_Restart SmartREST 2.0 message which tries to transition a cloud operation from PENDING to EXECUTING, even though this operation does not exist and is associated to the firmware_update operation (e.g. the workflow that called the restart workflow).
A sub-workflow can be identified by the sub: prefix in the command id, e.g. in the above example the thin-edge.io command id is sub:firmware_update:c8y-mapper-192481.
To Reproduce
Add the following firmware_update workflow by executing the command below
Describe the bug
If a workflow triggers a sub operation, then the mapper is incorrectly reacting to command status changes and sending a cloud message to transition operation status.
For example, below shows the presence of the
501,c8y_Restart
SmartREST 2.0 message which tries to transition a cloud operation from PENDING to EXECUTING, even though this operation does not exist and is associated to the firmware_update operation (e.g. the workflow that called the restart workflow).A sub-workflow can be identified by the
sub:
prefix in the command id, e.g. in the above example the thin-edge.io command id issub:firmware_update:c8y-mapper-192481
.To Reproduce
Add the following
firmware_update
workflow by executing the command belowRegister support for the firmware_update command
Ensure the firmware_update cloud handling is enabled on the tedge-mapper-c8y by running the following command:
Start (or restart) the tedge-agent service
Subscribe to the mqtt messages
From Cumulocity IoT Device Management, create a firmware operation for the device
Verify that the
501,c8y_Restart
message is NOT sent (once the bug is fixed, it is expected that the message SHOULD NOT be sent)Expected behavior
Screenshots
Environment (please complete the following information):
All
All
All
1.2.0
Additional context