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

Hi,
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 )
.getProcesses();
List serviceTasks = new ArrayList<>();

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

all ServiceTasks available in this list - serviceTasks