How to schedule An Epl

Hi,
i want to write an epl that listens to two different devices at every 15min interval.
and read the measurement data from both the devices and send a new calculated data to a third device.
provide me with reference code or document to achieve my requirement.

Hi,

you could take a look at Apama Timers: link to docs

You can also trigger listeners based on time. You can either trigger in a certain interval, for example, fire every 5 minutes (300 seconds). Or you can have a listener fire at certain times of the day, with similar functionality to Unix’s cron scheduler.

1 Like

@Korbinian_Butz tnx,

can you help me with one additional info.
i want to call measurement API in epl for particular device and particular series, can i get reference code for this.

note : not using subscription on all MeasurementFragment(),
other way to call measurements by hardcoding device id and series name.

The FindMeasurement example could help you here: EPL App - Querying Cumulocity IoT data

There’s also an example shown when you go to Streaming-Analytics → EPL Apps and select Samples, you can copy it from there:

Hi @Korbinian_Butz ,

After getting the response inorder to get the measurement value,
i am doing : com.apama.cumulocity.MeasurementValue valueObtained:=response.measurement.measurements[INPUT_FRAGMENT][series2];

but getting response as : com.apama.cumulocity.MeasurementValue(45,“”,{}) in valueObtained,

i want get the value “45”, how to do it.

valueObtained.value will give you a float representation of the value. See MeasurementValue (softwareag.com) for documentation around the MeasurementValue type.

For more information on using the EPL language, further information is available on EPL Apps - Cumulocity IoT documentation, Real-time processing - Cumulocity IoT documentation, and the various links present on those pages.