Getting the open task for a particular object

Flow Gurus,

If I have multiple process instances running, for example Loans with primary key 1, 2, 3, etc. How do I get the open task(s) for Loan with primary key n? Let’s assume I am the process variable “Loan” that has the loan data.

Regards
Booshan

Hi Booshan,

You can use :
TaskService taskService;
taskService.createTaskQuery().processInstanceId(“123”).active().list();

You can use taskId also to find tasks. You can see all the methods in createTaskQuery() and use it as per your use case.

Thank you,
Arpit Agrawal

1 Like

Great - thanks Arpit.