FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |
Create an operation, send Operation("","deviceId", "PENDING", {"c8y_Message":{ "text": "Hello Cumulocity device"}}) to Operation.SEND_CHANNEL;
You can update the status field. send Operation("12345","deviceId", "EXECUTING", {}}) 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 a new object. |
string | NOTIFICATION_UPDATED := "UPDATED"
Value of PARAM_NOTIFICATION that indicates this 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 Operations. |
Member summary | |
---|---|
string | id
Unique identifier for this Operation. |
string | source
Identifier of the ManagedObject to send the operation to. |
string | status
Status of the operation : one of SUCCESSFUL, FAILED, EXECUTING or PENDING. |
dictionary<string, any> | params
Any extra parameters available on the Operation. |
Action summary | |
---|---|
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 a new object.
string NOTIFICATION_UPDATED := "UPDATED"Value of PARAM_NOTIFICATION that indicates this 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 Operations.
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 |
---|
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.
Operation o := new Operation;
monitor.subscribe(Operation.SUBSCRIBE_CHANNEL);
// set fields in o
integer reqId := com.apama.cumulocity.Util.generateReqId();
send o.withChannelResponse(reqId, {"X-Cumulocity-Processing-Mode": "PERSISTENT"}) to Operation.SEND_CHANNEL;
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
}
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();
send o.withResponse(reqId, {"X-Cumulocity-Processing-Mode": "PERSISTENT"}) to Operation.SEND_CHANNEL;
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
}
FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |