Get usertask id based on process instanceid

Hi All,

I want to ask how to get usertask id based on process instance id. But in Java Code not use rest api?

my bpmn diagram is like this
id-eclaim.bpmn (4.4 KB)

I want to get usertaskid of create-action-id user task use java code. Can anyone show me sample code for do that?



@dimasrij , you can get specific taskId by passing process instance id and taskdefinitionKey as you mentioned above.

public class RuntimeTaskSericeImpl implements RuntimeTaskService {

	private TaskService taskService;

	public String getTaskId(String processInstanceId, String taskDefinitionkey) {
		Task task = taskService.createTaskQuery().processInstanceId(processInstanceId)
		return task.getId();

Here taskDefinitionkey is the create-action-id which configured for the user task.

thanks @aravindhrs