| FRAMES NO FRAMES | |||||||
| |||||||
| SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION | ||||||
Operation("12345","deviceId","PENDING",{"c8y_Message":{"text":"Hello Cumulocity device"}})
Operation("12345","deviceId", "EXECUTING", {}) // Create an operation:
send Operation("","deviceId", "PENDING", {"c8y_Message":<any>{<any>"text":<any>"Hello Cumulocity device"}}) to Operation.SEND_CHANNEL;
// Update the status field:
send Operation("12345","deviceId", "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 | SUBSCRIBE_CHANNEL := "cumulocity.measurements"Channel for receiving Operation notifications. |
| Member summary | |
|---|---|
string | idUnique identifier for this Operation. |
string | sourceIdentifier of the ManagedObject to send the operation to. |
string | statusStatus of the operation : one of SUCCESSFUL, FAILED, EXECUTING or PENDING. |
dictionary<string, any> | paramsAny extra parameters available on 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 SUBSCRIBE_CHANNEL := "cumulocity.measurements"Channel for receiving Operation notifications.
| Member detail |
|---|
string idUnique identifier for this Operation.
dictionary<string, any> paramsAny extra parameters available on the Operation.
string sourceIdentifier of the ManagedObject to send the operation to.
string statusStatus of the operation : one of 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 | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION | ||||||