Standalone Camunda using REST

Hi, I am using standalone Camunda and I try to get data from my backend application.
For example I want to get all tasks.
I have following java code and I am able to receive JSON with all of the tasks:

RestTemplate restTemplate = new RestTemplate();
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.APPLICATION_JSON);

        HttpEntity<String> entity = new HttpEntity<>("parameters", headers);

        ResponseEntity<String> result = restTemplate.exchange("http://localhost:8080/engine-rest/task", HttpMethod.GET, entity, String.class);
        System.out.println(result.getBody());

But now I want to convert it to java objects and work with Camunda classes. I’m trying to use Jackson:

ObjectMapper objectMapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        List<TaskDto> tasks = objectMapper.readValue(result.getBody(), new TypeReference<List<TaskDto>>() {});

But I can’t parse incoming JSON, I can skip "Unrecognized field “lastUpdated” with option FAIL_ON_UNKNOWN_PROPERTIES. But then I’m stuck on “Cannot construct instance of org.camunda.bpm.engine.form.CamundaFormRef”.

What is the proper way of communicating with standalone Camunda via REST?

Thank You!

Camunda 7.17, Java 17, Jackson 2.13.4

Hi @OndrejH,

Below Java Client is an excellent fit for your case

1 Like

Thank you. I will use it this way.

1 Like