How do I retrieve variables of a case task?

I am able to get the process variables of a task. Similarly, I wan to retrieve case variables for a given task.

Assuming you are using the java api, you can use the similar methods on the CmmnRuntimeService, like getVariables().