Deliver a Message

Deliver a message to the process engine to either trigger a message start event or an intermediate message catching event. Internally this maps to the engine’s message correlation builder methods MessageCorrelationBuilder#correlate() and MessageCorrelationBuilder#correlateAll(). For more information about the correlation behavior, see the Message Events section of the BPMN 2.0 Implementation Reference.

Method

POST /message

Parameters

Request Body

A JSON object with the following properties:

Name Description
messageName The name of the message to deliver.
businessKey Used for correlation of process instances that wait for incoming messages. Will only correlate to executions that belong to a process instance with the provided business key.
correlationKeys Used for correlation of process instances that wait for incoming messages. Has to be a JSON object containing key-value pairs that are matched against process instance variables during correlation. Each key is a variable name and each value a JSON variable value object with the following properties.
Name Description
value The variable's value.
type The value type of the variable. Valid types are String, Integer, Short, Long, Double and Date.

Note: Process instance variables are the global variables of a process instance. Local variables of child executions (such as in subprocesses) are not considered!

processVariables A map of variables that is injected into the triggered execution or process instance after the message has been delivered. Each key is a variable name and each value a JSON variable value object with the following properties.

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.

all A Boolean value that indicates whether the message should be correlated to exactly one entity or multiple entities. If the value is set to false the message will be correlated to exactly one entity (execution or process definition). If the value is set to true the message will be correlated to multiple executions and a process definition that can be instantiated by this message in one go.

Result

This method returns no content.

Response Codes

Code Media type Description
204 Request successful.
400 application/json No messageName was supplied or the message has not been correlated to exactly one entity (execution or process definition), or the variable value or type is invalid, for example if the value could not be parsed to an Integer value or the passed variable type is not supported. See the Introduction for the error response format.

Example

Request

POST /message

Request Body:

{"messageName" : "aMessage",
"businessKey" : "aBusinessKey",
"correlationKeys" : {
    "aVariable" : {"value" : "aValue", "type": "String"}
},
"processVariables" : {
    "aVariable" : {"value" : "aNewValue", "type": "String"},
    "anotherVariable" : {"value" : true, "type": "Boolean"}
}
}

Response

Status 204. No content.

On this Page: