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()


Instead of opening a new topic, I ask my question here.

How is the proposed solution different than:

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

Doesn’t the second option bring the active task of a given name of a given process instance?
My goal is to find whether a given task (i.e., specific task name/definition) is active in a specific process instance.


1 Like