Getting reference to first human task of a process

Hi,

I’m absolutely new to flowable and need some help.
When one kick-starts a new process instance with code like:

ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(
“ProcessName”, new HashMap<>());

how does one then get a reference/handle to the first task of the process (which happens to be a manual task in my process)?

Any help would be greatly appreciated.

Thanks.

  • Adrian.

A manual task is ‘automatic’ for the engine, the engine will simply pass through it.
Change it to a user task (a task that needs input from a user), and then do a task query like: taskService.createTaskQuery().processInstanceId(processInstance.getId()).list(); to retrieve the current uncompleted tasks for the started process instance.

Hi Joram,

Thanks for your answer - it solved my issue.

Thanks.

  • Adrian.