Activating camunda start with payload in spring webclient

Hi
i a working on camunda run time standalone with external tasks and i want to call the start flow rest in my spring boot application with with a payload that i can get the payload in the variables - i am trying do it with spring webclient but with no success
the following just for the test
//build payload
JSONObject camundaValueJson = new JSONObject();
camundaValueJson.put(“value”,“aStringValue”);
camundaValueJson.put(“type”,“String”);
JSONObject camundaParameterJson = new JSONObject();
camundaParameterJson.put(“aVariable”,camundaValueJson);
JSONObject camundaRequest = new JSONObject();
camundaRequest.put(“variables”,camundaParameterJson);
String s = camundaRequest.toString();

//call start
webClient.post().uri(“/process-definition/key/{key}/start”,“PaymentProcessTestId”) .bodyValue(s)
.retrieve()
.bodyToMono(String.class)
.block();

but i get an error no 415 UNSUPPORTED_MEDIA_TYPE
when i am trying to pass a josn object

webClient.post().uri(“/process-definition/key/{key}/start”,“PaymentProcessTestId”) …body(BodyInserters.fromValue(camundaRequest))
.retrieve()
.bodyToMono(String.class)
.block();

It calls the camunda external task but i dont get the payload in the variable list of the externalTask

what is the correct way of sending it in spring boot webClinet

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.