FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | FIELD | ACTION | DETAIL: IMPORT | CONSTANT | FIELD | ACTION |
Event("21","c8y_EntranceEvent","12346082",1464364483.396,"Entrance event triggered.",{"distance":any(float,317.0)})
Event("22","com_cumulocity_events_TamperEvent","12345",1464364483.396,"Tamper sensor triggered",{"history":{}})
// Create an Event:
send Event("","c8y_EntranceEvent","12346082",1464364483.396,"Entrance event triggered.",{"distance":any(float,317.0)}) to Event.SEND_CHANNEL;
// Update the text field:
send Event("22","c8y_EntranceEvent","12346082",1492676483.396,"Tamper sensor triggered",new dictionary<string, any>) to Event.SEND_CHANNEL;
Constant summary | |
---|---|
string | CHANNEL := "CumulocityIoTGenericChain" The channel for sending updates/ new Events to.
|
string | NOTIFICATION_CREATED := "CREATED" Value of PARAM_NOTIFICATION that indicates this is a new object. |
string | NOTIFICATION_UPDATED := "UPDATED" Value of PARAM_NOTIFICATION that indicates this is an update to an existing object. |
string | PARAM_NOTIFICATION := ".apama_notificationType" Entry in params that identifies if this is a new object or an update to an existing object. Entry will have a value matching either NOTIFICATION_CREATED or NOTIFICATION_UPDATED. |
string | SEND_CHANNEL := "CumulocityIoTGenericChain" The channel for sending Events. |
string | SUBSCRIBE_CHANNEL := "cumulocity.measurements" The channel for receiving Event notifications. |
Field summary | |
---|---|
string | id Unique identifier for this Event. |
string | type The type of the Cumulocity event. |
string | source Identifier of the managed object which is the source of the event. |
float | time Timestamp of the event. |
string | text Text or message of the Event. |
dictionary<string, any> | params Any other properties available on the Event. Note: This dictionary cannot be manipulated to delete fragments in the Event. |
Action summary | |
---|---|
boolean |
isCreate() Check if this Event instance was as a result of an event being created in Cumulocity. |
boolean |
isUpdate() Check if this Event instance was as a result of an Event being updated in Cumulocity. |
com.apama.cumulocity.ResponseWrapper |
withChannelResponse(integer reqId, dictionary<string, string> headers) Create or update an Event in Cumulocity and receive a response event confirming the change on Event.SUBSCRIBE_CHANNEL. |
com.apama.cumulocity.ResponseWrapper |
withResponse(integer reqId, dictionary<string, string> headers) Create or update an Event in Cumulocity and receive a response event on default channel, confirming the change.
|
Constant detail |
---|
string CHANNEL := "CumulocityIoTGenericChain"
string NOTIFICATION_CREATED := "CREATED"Value of PARAM_NOTIFICATION that indicates this is a new object.
string NOTIFICATION_UPDATED := "UPDATED"Value of PARAM_NOTIFICATION that indicates this is an update to an existing object.
string PARAM_NOTIFICATION := ".apama_notificationType"Entry in params that identifies if this is a new object or an update to an existing object. Entry will have a value matching either NOTIFICATION_CREATED or NOTIFICATION_UPDATED.
string SEND_CHANNEL := "CumulocityIoTGenericChain"The channel for sending Events.
string SUBSCRIBE_CHANNEL := "cumulocity.measurements"The channel for receiving Event notifications.
Field detail |
---|
string idUnique identifier for this Event.
dictionary<string, any> paramsAny other properties available on the Event. Note: This dictionary cannot be manipulated to delete fragments in the Event.
string sourceIdentifier of the managed object which is the source of the event.
string textText or message of the Event.
float timeTimestamp of the event.
string typeThe type of the Cumulocity event.
Action detail |
---|
boolean isCreate()Check if this Event instance was as a result of an event being created in Cumulocity.
boolean isUpdate()Check if this Event instance was as a result of an Event being updated in Cumulocity.
com.apama.cumulocity.ResponseWrapper withChannelResponse(integer reqId, dictionary<string, string> headers)Create or update an Event in Cumulocity and receive a response event confirming the change on Event.SUBSCRIBE_CHANNEL.
monitor.subscribe(Event.SUBSCRIBE_CHANNEL);
Event e := new Event;
// set fields in e
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 e.withChannelResponse(reqId, { "X-Cumulocity-Processing-Mode": "TRANSIENT" }) to Event.SEND_CHANNEL;
com.apama.cumulocity.ResponseWrapper withResponse(integer reqId, dictionary<string, string> headers)
Event e := new Event;
// set fields in e
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 e.withResponse(reqId, { "X-Cumulocity-Processing-Mode": "TRANSIENT" }) to Event.SEND_CHANNEL;
FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | FIELD | ACTION | DETAIL: IMPORT | CONSTANT | FIELD | ACTION |