Apama Connectivity For Cumulocity IoT  10.1 | Apama Connectivity For Cumulocity IoT Documentation 10.1 | Interacting with Cumulocity IoT Platform | Sample EPL
 
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;
}

}
}

Copyright © 2013-2017 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release