Skip to main content

Class: UpdateResponse

coresdk.workflow_commands.UpdateResponse

A reply to a DoUpdate job - lang must run the update's validator if told to, and then immediately run the handler, if the update was accepted.

There must always be an accepted or rejected response immediately, in the same activation as this job, to indicate the result of the validator. Accepted for ran and accepted or skipped, or rejected for rejected.

Then, in the same or any subsequent activation, after the update handler has completed, respond with completed or rejected as appropriate for the result of the handler.

Properties​

accepted​

• Optional accepted: null | $Properties

Must be sent if the update's validator has passed (or lang was not asked to run it, and thus should be considered already-accepted, allowing lang to always send the same sequence on replay).


completed​

• Optional completed: null | $Properties

Must be sent once the update handler completes successfully.


protocolInstanceId​

• protocolInstanceId: string

The protocol message instance ID


rejected​

• Optional rejected: null | $Properties

Must be sent if the update's validator does not pass, or after acceptance if the update handler fails.


response​

• Optional response: "completed" | "accepted" | "rejected"

UpdateResponse response.

Methods​

toJSON​

▸ toJSON(): Object

Converts this UpdateResponse to JSON.

Returns​

Object

JSON object


create​

▸ create(properties?): UpdateResponse & $Shape

Creates a new UpdateResponse instance using the specified properties.

Parameters​

NameTypeDescription
properties?$ShapeProperties to set

Returns​

UpdateResponse & $Shape

UpdateResponse instance

▸ create(properties?): UpdateResponse

Parameters​

NameType
properties?$Properties

Returns​

UpdateResponse


decode​

▸ decode(reader, length?): UpdateResponse & $Shape

Decodes an UpdateResponse message from the specified reader or buffer.

Parameters​

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns​

UpdateResponse & $Shape

UpdateResponse

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited​

▸ decodeDelimited(reader): UpdateResponse & $Shape

Decodes an UpdateResponse message from the specified reader or buffer, length delimited.

Parameters​

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns​

UpdateResponse & $Shape

UpdateResponse

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


encode​

▸ encode(message, writer?): Writer

Encodes the specified UpdateResponse message. Does not implicitly coresdk.workflow_commands.UpdateResponse.verify|verify messages.

Parameters​

NameTypeDescription
message$PropertiesUpdateResponse message or plain object to encode
writer?WriterWriter to encode to

Returns​

Writer

Writer


encodeDelimited​

▸ encodeDelimited(message, writer?): Writer

Encodes the specified UpdateResponse message, length delimited. Does not implicitly coresdk.workflow_commands.UpdateResponse.verify|verify messages.

Parameters​

NameTypeDescription
message$PropertiesUpdateResponse message or plain object to encode
writer?WriterWriter to encode to

Returns​

Writer

Writer


fromObject​

▸ fromObject(object): UpdateResponse

Creates an UpdateResponse message from a plain object. Also converts values to their respective internal types.

Parameters​

NameTypeDescription
objectObjectPlain object

Returns​

UpdateResponse

UpdateResponse


toObject​

▸ toObject(message, options?): Object

Creates a plain object from an UpdateResponse message. Also converts values to other types if specified.

Parameters​

NameTypeDescription
messageUpdateResponseUpdateResponse
options?IConversionOptionsConversion options

Returns​

Object

Plain object