Getting the current task


So far I’ve been able to get the list of active task. Is there a query to get the current task which is supposed to be ‘CustomerOrderTask’(usertask) to complete it without getting all the active task of the instance.

ProcessInstance instance = runtimeService.createProcessInstanceByKey("processOne")

List<Task> tasks = processEngine.getTaskService().createTaskQuery().active()
for(Task task : tasks){
    //maybe compare task name before triggering complete


How is active task different from “current task”?

How about:

Task task = processEngine.getTaskService().createTaskQuery()