Get list of Service Tasks (completed or in progress) for a given process

I need to get list of all the service tasks that have been created by a process.
How can I get this list ?

may be you can try as below,

List processes = repositoryService.getBpmnModel(processDefinitionId )
List serviceTasks = new ArrayList<>();

	for (Process p : processes) {
		serviceTasks .addAll(p.findFlowElementsOfType(ServiceTask.class));

all ServiceTasks available in this list - serviceTasks