Hi Nele
Yes I did, it shows an error has occurred, I have attached the model below.
The way I’m throwing the BpmnError is inside the logic, so will make a webclient call if that throws an exception, I’ll catch it and subsequently trigger the BpmnError. I use postman as I have created an endpoint that initiate the process and thereon delegate and service layer handle the logic.
Delegate Logic:
public void create(DelegateExecution execution) {
oneService.create(execution);
}
Service Logic:
public void create(DelegateExecution execution) throws Exception {
this.microserviceDiscovery.setServiceId(ID);
this.microserviceDiscovery.setEndpoint(ENDPOINT);
this.webClient.mutate().baseUrl(BASE_URL);
try {
FinalClassDTO responseEntity = webClient
.post()
.uri(microserviceDiscovery.getUrl())
.attributes(oauth2AuthorizedClient())
.accept(MediaType.APPLICATION_JSON)
.contentType(MediaType.APPLICATION_JSON)
.body(BodyInserters.fromValue(CamundaVariableHandler.getObjectDTO(execution)))
.retrieve()
.bodyToMono(FinalClassDTO.class)
.block();
CamundaVariableHandler.setFinalClassDTO(execution, responseEntity);
} catch (RuntimeException e) {
throw new BpmnError("errorOne");
}
}
Thanks
P.S. Postman returns 500 with Internal Service Error as a message when a BpmnError or RuntimeException is thrown.
diagram.bpmn (7.4 KB)