Apama 10.2 | Apama Documentation | Connecting Apama Applications to External Components | Standard Connectivity Plug-ins | The Cumulocity IoT Transport Connectivity Plug-in | Sample EPL
 
Sample EPL
The sample EPL below describes how to subscribe and receive device measurements, device events and device information.
package com.apama.cumulocity.sample;
 
monitor SampleApplication {
 
action onload() {
 
// Subscribe to receive all the devices from Cumulocity IoT
monitor.subscribe(com.apama.cumulocity.ManagedObject.CHANNEL);
 
// Consume all the devices from Cumulocity IoT
on all com.apama.cumulocity.ManagedObject() as d {
log d.toString() at INFO;
}
 
// Subscribe to receive all the measurements 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;
}
 
// Consume all the alarms from Cumulocity IoT
on all com.apama.cumulocity.Alarm() as alarm {
log alarm.toString() at INFO;
}
 
}
 
}

Copyright © 2013-2018 | 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