Get form for current task

I would like to get the form with its variables for the current task in Spring Boot with an embedded Camunda engine.

Currently I’m getting the task which an application is currently at through this code

Application application = applicationService.getApplicationById(applicationId);

Task task = taskService.createTaskQuery().processInstanceId(application.getWorkflowId()).active().singleResult();

But I would like to get the form with its variables from that current task.
This way I could send it back in the response and the frontend knows which fields need to be filled.

How can I do this?