REST API: Message Intermediate Catch with variablesInResultEnabled

Hello guys,

I have a Camunda process with a message intermediate catch event in the middle. I use the REST API to start the process and to correlate the message for the intermediate catch. The correlation works perfectly, but I have a Problem with returning the varaibles from the intermediate REST call.

The documentation (Camunda Platform REST API) specifies that the parameters resultEnabled: true and variablesInResultEnabled: true should return the process variables in the JSON Response. But I can’t get them.

My start Requests looks like this:

{  
   "messageName":"Msg_ReceiveContract",
   "resultEnabled":true,
   "processVariables":{  
      "contractId":{  
         "value":"C11808bc-97fd-4f4c-8ccd-ce4f892f7669",
         "type":"String"
      }
   }
}

The second Request:

{  
   "messageName":"Msg_ReceiveDocuments",
   "all":true,
   "resultEnabled":true,
   "variablesInResultEnabled":true,
   "correlationKeys":{  
      "contractId":{  
         "value":"C11808bc-97fd-4f4c-8ccd-ce4f892f7669",
         "type":"String"
      }
   },
   "processVariables":{  
      "contractId":{  
         "value":"C11808bc-97fd-4f4c-8ccd-ce4f892f7669",
         "type":"String"
      }
   }
}

And the Response from the second Request:

[{
   "resultType": "Execution",
   "execution":    {
      "id": "731bfc67-9737-11e9-846b-024245f666c9",
      "processInstanceId": "731bd552-9737-11e9-846b-024245f666c9",
      "ended": true,
      "tenantId": null
   },
   "processInstance": null
}]

My demo process looks like this:
ContractValidation.bpmn (4.7 KB)

Am I doing something wrong here or does anyone have tips how get the process variables in the response?

Best regards and thank you
Patrick

Hi Patrick,

Which Camunda version do you use?

I tried with your process and received

[
    {
        "resultType": "Execution",
        "execution": {
            "id": "c74b809f-9751-11e9-8ebb-e4a7a094a9d6",
            "processInstanceId": "c74b598a-9751-11e9-8ebb-e4a7a094a9d6",
            "ended": true,
            "tenantId": null
        },
        "processInstance": null,
        "variables": {
            "contractId": {
                "type": "String",
                "value": "C11808bc-97fd-4f4c-8ccd-ce4f892f7669",
                "valueInfo": {}
            }
        }
    }
]

Keep in mind that variablesInResultEnabled was introduced in 7.11.0

1 Like

Hi Yana,

thank you for your answer! The version we are using was the problem. We upgraded from 7.10 to 7.11 and now we get the variables in the response.

Best regards,
Patrick

1 Like