FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | FIELD | ACTION | DETAIL: IMPORT | CONSTANT | FIELD | ACTION |
Operation("12345","deviceId",STATUS_PENDING,{"c8y_Message":{"text":"Hello Cumulocity device"}})
Operation("12345","deviceId",STATUS_EXECUTING, {})
// Create an operation:
send Operation("","deviceId",STATUS_PENDING, {"c8y_Message":<any>{<any>"text":<any>"Hello Cumulocity device"}}) to Operation.SEND_CHANNEL;
// Update the status field:
send Operation("12345","deviceId",STATUS_EXECUTING, new dictionary<string, any>) to Operation.SEND_CHANNEL;
Constant summary | |
---|---|
string | CHANNEL := "CumulocityIoTGenericChain" Channel to send the 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" Channel for sending Operations. |
string | STATUS_EXECUTING := "EXECUTING" Status value when an operation is EXECUTING. |
string | STATUS_FAILED := "FAILED" Status value when an operation is FAILED. |
string | STATUS_PENDING := "PENDING" Status value when an operation is PENDING. |
string | STATUS_SUCCESSFUL := "SUCCESSFUL" Status value when an operation is SUCCESSFUL. |
string | SUBSCRIBE_CHANNEL := "cumulocity.measurements" Channel for receiving Operation notifications. |
Field summary | |
---|---|
string | id Unique identifier for this Operation. |
string | source Identifier of the ManagedObject to send the operation to. |
string | status The status of the operation as defined by the STATUS_* constants: SUCCESSFUL, FAILED, EXECUTING or PENDING. |
dictionary<string, any> | params Any extra parameters available on the Operation. Note: This dictionary cannot be manipulated to delete fragments in the Operation. |
Action summary | |
---|---|
boolean |
isCreate() Check if this Operation instance was as a result of an operation being created in Cumulocity. |
boolean |
isUpdate() Check if this Operation instance was as a result of an operation being updated in Cumulocity. |
com.apama.cumulocity.ResponseWrapper |
withChannelResponse(integer reqId, dictionary<string, string> headers) Create or update an Operation in Cumulocity and receive a response event confirming the change on Operation.SUBSCRIBE_CHANNEL channel. |
com.apama.cumulocity.ResponseWrapper |
withResponse(integer reqId, dictionary<string, string> headers) Create or update an Operation 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"Channel for sending Operations.
string STATUS_EXECUTING := "EXECUTING"Status value when an operation is EXECUTING.
string STATUS_FAILED := "FAILED"Status value when an operation is FAILED.
string STATUS_PENDING := "PENDING"Status value when an operation is PENDING.
string STATUS_SUCCESSFUL := "SUCCESSFUL"Status value when an operation is SUCCESSFUL.
string SUBSCRIBE_CHANNEL := "cumulocity.measurements"Channel for receiving Operation notifications.
Field detail |
---|
string idUnique identifier for this Operation.
dictionary<string, any> paramsAny extra parameters available on the Operation. Note: This dictionary cannot be manipulated to delete fragments in the Operation.
string sourceIdentifier of the ManagedObject to send the operation to.
string statusThe status of the operation as defined by the STATUS_* constants: SUCCESSFUL, FAILED, EXECUTING or PENDING.
Action detail |
---|
boolean isCreate()Check if this Operation instance was as a result of an operation being created in Cumulocity.
boolean isUpdate()Check if this Operation instance was as a result of an operation being updated in Cumulocity.
com.apama.cumulocity.ResponseWrapper withChannelResponse(integer reqId, dictionary<string, string> headers)Create or update an Operation in Cumulocity and receive a response event confirming the change on Operation.SUBSCRIBE_CHANNEL channel.
monitor.subscribe(Operation.SUBSCRIBE_CHANNEL);
Operation o := new Operation;
// set fields in o
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 o.withChannelResponse(reqId, {"X-Cumulocity-Processing-Mode": "PERSISTENT"}) to Operation.SEND_CHANNEL;
com.apama.cumulocity.ResponseWrapper withResponse(integer reqId, dictionary<string, string> headers)
Operation o := new Operation;
// set fields in o
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 o.withResponse(reqId, {"X-Cumulocity-Processing-Mode": "PERSISTENT"}) to Operation.SEND_CHANNEL;
FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | FIELD | ACTION | DETAIL: IMPORT | CONSTANT | FIELD | ACTION |