Correlate Message Async (POST)

Correlates a message asynchronously to executions that are waiting for this message. Messages will not be correlated to process definition-level start message events to start process instances.

Method

POST /process-instance/message-async

Parameters

Request Body

A JSON object with the following properties:

Name Description
messageName The name of the message to correlate. Corresponds to the 'name' element of the message defined in BPMN 2.0 XML. Can be null to correlate by other criteria only.
processInstanceIds A list of process instance ids that define a group of process instances to which the operation will correlate a message.
processInstanceQuery A process instance query like the request body for the Get Instances (POST) method to select process instances the operation will correlate a message to.
historicProcessInstanceQuery A historic process instance query like the request body for the Get Instances (POST) method to select process instances the operation will correlate a message to.
variables A JSON object containing variable key-value pairs the operation will set in the root scope of the process instances the message is correlated to. Each key is a variable name and each value a JSON variable value object.

Name Description
value The variable's value. For variables of type Object, the serialized value has to be submitted as a String value.

For variables of type File the value has to be submitted as Base64 encoded string.

type The value type of the variable.
valueInfo A JSON object containing additional, value-type-dependent properties.

For serialized variables of type Object, the following properties can be provided:

  • objectTypeName: A string representation of the object's type name.
  • serializationDataFormat: The serialization format used to store the variable.

For serialized variables of type File, the following properties can be provided:

  • filename: The name of the file. This is not the variable name but the name that will be used when downloading the file again.
  • mimetype: The MIME type of the file that is being uploaded.
  • encoding: The encoding of the file that is being uploaded.

Please note that if processInstanceIds, processInstanceQuery and historicProcessInstanceQuery are defined, the resulting operation will be performed on the union of these sets.

Response Body

A JSON object corresponding to the Batch interface in the engine. Its properties are as follows:

Name Type Description
id String The id of the batch.
type String The type of the batch. See the User Guide for more information about batch types.
totalJobs Number The total jobs of a batch is the number of batch execution jobs required to complete the batch.
jobsCreated Number The number of batch execution jobs already created by the seed job.
batchJobsPerSeed Number The number of batch execution jobs created per seed job invocation. The batch seed job is invoked until it has created all batch execution jobs required by the batch (see totalJobs property).
invocationsPerBatchJob Number Every batch execution job invokes the command executed by the batch invocationsPerBatchJob times. E.g., for a process instance migration batch this specifies the number of process instances which are migrated per batch execution job.
seedJobDefinitionId String The job definition id for the seed jobs of this batch.
monitorJobDefinitionId String The job definition id for the monitor jobs of this batch.
batchJobDefinitionId String The job definition id for the batch execution jobs of this batch.
suspended Boolean Indicates whether this batch is suspended or not.
tenantId String The tenant id of the batch.
createUserId String The id of the user that created the batch.
startTime String The time the batch was started. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ.
* For further information, please see the documentation.

Response Codes

Code Media type Description
200 application/json Request successful.
400 application/json
  • If none of processInstanceIds, processInstanceQuery and historicProcessInstanceQuery is given
  • If no process instance ids where found
See the Introduction for the error response format.

Example

Request

POST /process-instance/message-async

Request Body:

{
  "messageName" : "a-message-name",
  "processInstanceIds" : [
    "b4d2ad98-7240-11e9-98b7-be5e0f7575b7"
  ],
  "processInstanceQuery": {
    "processDefinitionKey": "my-process-definition-key"
  },
  "variables" : {
    "myVariableName": {
      "value": "myStringValue"
    }
  }
}

Response

Status 200 OK

{
  "id": "120b568d-724a-11e9-98b7-be5e0f7575b7",
  "type": "correlate-message",
  "totalJobs": 12,
  "batchJobsPerSeed": 100,
  "invocationsPerBatchJob": 1,
  "seedJobDefinitionId": "120b5690-724a-11e9-98b7-be5e0f7575b7",
  "monitorJobDefinitionId": "120b568f-724a-11e9-98b7-be5e0f7575b7",
  "batchJobDefinitionId": "120b568e-724a-11e9-98b7-be5e0f7575b7",
  "tenantId": "accounting",
  "suspended": false,
  "createUserId": null
}

On this Page: