Java api to reterive formdata

I am submitting formData like below. How to retrieve the data back from history after the task is completed? I tried like this

“TaskFormData formData = camunda.getFormService().getTaskFormData(task.getId());”

and it didn’t work

Submitting formData

public void submitForm(String taskId, UserRequest userRequest) {
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> stringStringMap = objectMapper.convertValue(userRequest, new TypeReference<Map<String, Object>>() {
});
FormService formService = camunda.getFormService();
formService.submitTaskForm(taskId, stringStringMap);
}

Is there a way to premanently store some data ? even after the process is completed I want the data

1 Like