Adding to Map process variables with Non Interrupting Boundary Messages via REST

I have a user task for document collection.
The business requirement is:

  • The back office needs to be able to scan and upload documents while also having the customer documents which are emailed in automatically attached to the process.
  • There are several predefined (signed forms, etc) types of documents and perhaps some adhoc ones (utility bill, etc).
  • An email may have several documents attached
  • There may be several emails over time.

The third party system (VP in the diagram) that is receiving emails, stripping the attachments and calling Camunda REST. What I am trying to achieve is to pass a reference via the REST messages API of the document which then gets retrieved from the third party and stored in Camunda.

There could be variable amount of these documents (PDF files) and I would like to store them as a collection in a process variable of type Map.

I am using these references:

This is a part diagram of my process:

I need several things:

  • How can the REST messages API pass a temporary reference/id to Camunda which can then be added to a map/list variable.
  • Is not possible to store a File type variable as a value part of a Map type process variable?
  • Is there a better way to do this?

Thank you

Hi @SlappyAUS,

the normal way is to deliver message with a payload containing one or more process variables.

You would not put the payload into variables afterwards, but add variables as payload. These variables will be stored in the process instance directly.

In Java you can write:

  .setVariable("customerId", 15)
  .setVariable("myList", List.of("hannes", "valerian"))

This is a rest call to deliver a message: Correlate a Message |

Hope this helps, Ingo

Hey Ingo, thanks for the help. I have some further questions.

  • In your example you use the process variable “myList” and set it. Is there a way for the message to pass a unique temporary parameter. Reason I ask is for concurrency. Should two messages arrive at the same time both using the same process variable name then one will be lost before the next step task can process it. In other words is it possible to paramaterize the message and not necessarily use a variable global to the process instance.
  • Are you aware of any documentation on the JSON representation of the process variables for all the variant types? (Preferably examples) The following is cited, but is not exhaustive and doesn’t cover my use case.
"processVariables" : {
    "aVariable" : {"value" : "aNewValue", "type": "String",
                    "valueInfo" : { "transient" : true }
    "anotherVariable" : {"value" : true, "type": "Boolean"}

Further reading suggests I am looking for how to set transient variables with the REST Message API call.

Hi @SlappyAUS,

are you referring to the message correlation? To identify the process instance that should receive the message, you have to add a correlationKey.

To identify a local scope of a process instance, correlationKeys can be local variables. Correlate a Message |

It’s here: Variables in the REST API |

Hope this helps, Ingo

Further reading suggests I am looking for how to set transient variables with the REST Message API call.