To get the candidates defined in the process definition, the easiest way is to use to getBpmnModel method on the RepositoryService interface. It will give back a Java POJO model of the process definition and you can lookup the user task and assignment definition.
Best regards,