Callback to BPMN via Rest


#1

Hi,

I am trying to use a message task to halt the bpmn process while I wait for a callback. I read the documentation and forums to see that I need to use a messageName, businessKey, and process variables. I saw the sample payload would look something like this…

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

  1. I believe the messageName is the name in the messageTask on the bpmn flow.
  2. Where do I get the businessKey from?
  3. If I set a processVariable will I be able to get it from execution.getVariable(“variableName”) in the code?
  4. What is the URL i would send this POST request to?

#2
  1. http://hostname:port/message i think

#3

Hi,

  1. yes
  2. it is an optional property, you can find info for businessKey here - https://blog.camunda.com/post/2018/10/business-key/
  3. correct, also processVariable it is an optional property
  4. yep POST http:/hostname:port/message

for reference https://docs.camunda.org/manual/7.9/reference/rest/message/post-message/


#4

Depending on the application server you’ve using, you’ll also need to add the end point.
http://hostname:port/engine-rest/message
or
http://hostname:port/rest/message