Hi everyone.
I’m developing a microservice in Spring Boot who uses the Camunda API Rest from my centralized engine. The problem is I don’t want to write all posible data estructures like TaskDto, ProcessInstanceDto, etc…
I tried Camunda Spring Boot Starter, and I saw all this Dtos and even methods to use rest api, but this starter runs a camunda process engine into my Spring Boot application, and my Camunda deployment is on another server, and I don’t want the engine.
In RestClient you can mention type as String.class, so all the responses will be recieved as JSON String. You can use OkHttpClient(lightweight RestClient) which will return JSON String as response. In this case no need of having any DTO’s. Later you can parse the json string as per your need.
But my question is about parse this string into Task object, or ProcessInstance object or whatever response I got.
I can use Jackson to map this response as Map strings, but I prefer to use java Objects.
In Camunda Rest API docs, it was mentioned the JSON response for each API, you can check the fields in the response, and according to that you can create your own DTO and map fields according to json using GSON or Jackson
If you want to use the classes from the Rest API but not have it deployed in the Spring Boot application, couldn’t you just use the org.camunda.bpm:camunda-engine-rest-jaxrs2 dependency instead of the Spring Boot Starter?