Hi All,
I have created an EPL application below is snippet code
/** Basic event definitions */
using com.apama.cumulocity.ManagedObject;
using com.apama.cumulocity.FindManagedObject;
using com.apama.cumulocity.FindManagedObjectResponse;
using com.apama.cumulocity.FindManagedObjectResponseAck;
using com.apama.correlator.timeformat.TimeFormat;
using com.apama.cumulocity.Measurement;
using com.apama.cumulocity.MeasurementValue;
using com.apama.cumulocity.MeasurementFragment;
using com.apama.cumulocity.FindMeasurement;
using com.apama.cumulocity.FindMeasurementResponse;
using com.apama.cumulocity.FindMeasurementResponseAck;
using com.apama.cumulocity.Alarm;
using com.apama.cumulocity.FindAlarm;
using com.apama.cumulocity.FindAlarmResponse;
using com.apama.cumulocity.FindAlarmResponseAck;
using com.apama.cumulocity.Event;
using com.apama.cumulocity.FindEvent;
using com.apama.cumulocity.FindEventResponse;
using com.apama.cumulocity.FindEventResponseAck;
using com.apama.cumulocity.Operation;
using com.apama.cumulocity.FindOperation;
using com.apama.cumulocity.FindOperationResponse;
using com.apama.cumulocity.FindOperationResponseAck;
using com.apama.cumulocity.ObjectCommitted;
using com.apama.cumulocity.ObjectCommitFailed;
/** Miscellaneous utilities */
using com.apama.cumulocity.Util;
using com.apama.util.AnyExtractor;
using com.apama.cumulocity.GenericRequest;
using com.apama.cumulocity.GenericResponse;
using com.apama.cumulocity.GenericResponseComplete;
using com.apama.exceptions.Exception;
monitor DigiTankMonitor {
/** Initialize the application */
action onload() {
createVolumeCompute();
}
action createVolumeCompute() {
monitor.subscribe(MeasurementFragment.SUBSCRIBE_CHANNEL);
//listen on all measurements of a specific type/fragment,series/
//on all at(*/10, *, *, *, *)
on all MeasurementFragment() as mf {
log "TESTING mf.value : " + mf.value.toString() +mf.source at INFO;
TimeFormat timeFormat := new TimeFormat;
if(mf.value >= 0.0){
send Measurement("", "newType", mf.source,timeFormat.getSystemTime(), {
newFragment:{
newSeries: MeasurementValue(mf.value, "newUnit2", new dictionary<string,any>)
}
}, new dictionary<string,any>) to Measurement.SEND_CHANNEL;
}
}
}
}
here I am getting below details
“time”: “2023-11-16T12:21:00.698+01:00”,
“Test”: {
“Test”: {
“unit”: “newUnit2”,
“value”: 28.88875
}
}
but I want time format as “yyyy-MM-dd’T’HH:mm:ss.SSS’Z’”
ex. 2023-11-16T11:22:00.000Z
can anyone help me on this?