FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | FIELD | ACTION | DETAIL: IMPORT | CONSTANT | FIELD | ACTION |
MeasurementFragment("1001","c8y_LightMeasurement","12346081",1464359004.89,"c8y_LightMeasurement","e", 108.1, "lux",{})
MeasurementFragment("1002","c8y_DistanceMeasurement","12346082",1464359005.396,"c8y_DistanceMeasurement","distance",344.0,"mm",{})
send MeasurementFragment("","c8y_DistanceMeasurement","123",1464359005.396,"distance","distance",3.44,"mm",new dictionary<string, any>) to MeasurementFragment.SEND_CHANNEL;
Constant summary | |
---|---|
string | SEND_CHANNEL := "CumulocityIoTGenericChain" The channel to send a measurement fragment event to create a new measurement fragment object in Cumulocity. |
string | SUBSCRIBE_CHANNEL := "cumulocity.measurement.fragments" The channel to which MeasurementFragment events are sent from the transport. |
Field summary | |
---|---|
string | id Unique identifier for the measurement. |
string | type The type of the measurement. |
string | source The unique identifier of the source of the measurement. This should correspond to a managed object. |
float | time The time the measurement was taken, represented as the number of seconds since the epoch (1st January 1970). |
string | valueFragment Name of the fragment of the measurement fragment. |
string | valueSeries Name of the series of the measurement fragment. |
float | value Value from the sensor. |
string | unit Units the reading is in, for example mm, lux. |
dictionary<string, any> | params Any per-value extra fields. |
Action summary | |
---|---|
com.apama.cumulocity.ResponseWrapper |
withChannelResponse(integer reqId, dictionary<string, string> headers) Create a MeasurementFragment in Cumulocity and receive a response event confirming the change on MeasurementFragment.SUBSCRIBE_CHANNEL channel. |
com.apama.cumulocity.ResponseWrapper |
withResponse(integer reqId, dictionary<string, string> headers) Create a MeasurementFragment in Cumulocity and receive a response event on default channel, confirming the change.
|
Constant detail |
---|
string SEND_CHANNEL := "CumulocityIoTGenericChain"The channel to send a measurement fragment event to create a new measurement fragment object in Cumulocity.
string SUBSCRIBE_CHANNEL := "cumulocity.measurement.fragments"The channel to which MeasurementFragment events are sent from the transport.
Field detail |
---|
string idUnique identifier for the measurement.
dictionary<string, any> paramsAny per-value extra fields.
string sourceThe unique identifier of the source of the measurement. This should correspond to a managed object.
float timeThe time the measurement was taken, represented as the number of seconds since the epoch (1st January 1970).
string typeThe type of the measurement.
string unitUnits the reading is in, for example mm, lux.
float valueValue from the sensor.
string valueFragmentName of the fragment of the measurement fragment.
string valueSeriesName of the series of the measurement fragment.
Action detail |
---|
com.apama.cumulocity.ResponseWrapper withChannelResponse(integer reqId, dictionary<string, string> headers)Create a MeasurementFragment in Cumulocity and receive a response event confirming the change on MeasurementFragment.SUBSCRIBE_CHANNEL channel.
monitor.subscribe(MeasurementFragment.SUBSCRIBE_CHANNEL);
MeasurementFragment m := new MeasurementFragment;
// set fields in m
integer reqId := com.apama.cumulocity.Util.generateReqId();
on ObjectCommitted(reqId=reqId) as commit and not ObjectCommitFailed(reqId=reqId) {
// do something
}
on ObjectCommitFailed(reqId=reqId) as failure and not ObjectCommitted(reqId=reqId) {
// do something
}
send m.withChannelResponse(reqId, { "X-Cumulocity-Processing-Mode": "TRANSIENT" }) to MeasurementFragment.SEND_CHANNEL;
com.apama.cumulocity.ResponseWrapper withResponse(integer reqId, dictionary<string, string> headers)
MeasurementFragment m := new MeasurementFragment;
// set fields in m
integer reqId := com.apama.cumulocity.Util.generateReqId();
on ObjectCommitted(reqId=reqId) as commit and not ObjectCommitFailed(reqId=reqId) {
// do something
}
on ObjectCommitFailed(reqId=reqId) as failure and not ObjectCommitted(reqId=reqId) {
// do something
}
send m.withResponse(reqId, { "X-Cumulocity-Processing-Mode": "TRANSIENT" }) to MeasurementFragment.SEND_CHANNEL;
FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | FIELD | ACTION | DETAIL: IMPORT | CONSTANT | FIELD | ACTION |