Sample EPL
Below sample EPL describes how to subscribe and receive device measurements, device events and device information.
package com.apama.cumulocity.sample;
monitor SampleApplication {
com.apama.cumulocity.Measurement m;
com.apama.cumulocity.Event e;
com.apama.cumulocity.Device d;
action onload() {
// Subscribe to receive all the devices from Cumulocity IoT
monitor.subscribe(com.apama.cumulocity.Device.CHANNEL);
// Consume all the devices from Cumulocity IoT
on all com.apama.cumulocity.Device() as d {
log d.toString() at INFO;
}
// Subscribe to receive all the measurement published from
// Cumulocity IoT
monitor.subscribe(com.apama.cumulocity.Measurement.CHANNEL);
// Consume all the measurements from Cumulocity IoT
on all com.apama.cumulocity.Measurement() as m {
log m.toString() at INFO;
}
// Consume all the events from Cumulocity IoT
on all com.apama.cumulocity.Event() as e {
log e.toString() at INFO;
}
}
}