Using managed objects
During application initialization (onApplicationInitialized), if requestAllDevices is enabled (true by default), the adapter sends all device/asset related information using the com.apama.cumulocity.ManagedObject event on the com.apama.cumulocity.ManagedObject.CHANNEL (same as cumulocity.devices) channel.
After all devices/assets have been sent, the adapter sends a com.apama.cumulocity.RequestAllDevicesComplete(-1) event.
Example of a device event:
com.apama.cumulocity.ManagedObject("44578836","","Device_1",
["c8y_Restart","c8y_Meassage","c8y_Relay"],
["c8y_TemperatureMeasurement","c8y_LightMeasurement"],
[],[],[],[],{},
{"c8y_IsDevice":any(dictionary<any,any>,{}),
"owner":any(string,"Cumulocity_User")})
If subscribeToDevices is enabled (true by default), any devices added to Cumulocity IoT after application initialization will be sent to the com.apama.cumulocity.ManagedObject.CHANNEL channel.
See the com.apama.cumulocity.RequestAllDevices event for refreshing the list of devices. Note that the com.apama.cumulocity.RequestAllDevices event is sent to the channel defined by the CHANNEL constant on the RequestAllDevices event. The device events are sent to the channel specified in the RequestAllDevices event and followed by a com.apama.cumulocity.RequestAllDevicesComplete event with the requestId sent in the RequestAllDevices event.