cancel
Showing results for 
Search instead for 
Did you mean: 

Current task of process.

werdn
Champ in-the-making
Champ in-the-making
Hello,
How I can get current task of process(usertask or other) ?
4 REPLIES 4

micha1
Champ on-the-rise
Champ on-the-rise
Hello,
How I can get current task of process(usertask or other) ?

To get informations from the activiti system you have to use the querries you can find in the API documentation.
Every context has it's own query objects. In case of the tasks it is the TaskQuery.
To find all tasks belonging to a process instance pi1 you could do something like that….
        List<Task> taskListe = Engine…  …getTaskService().createTaskQuery()
                .processInstanceId(pi1.getProcessInstanceId()).list();

werdn
Champ in-the-making
Champ in-the-making
Hello,
How I can get current task of process(usertask or other) ?

To get informations from the activiti system you have to use the querries you can find in the API documentation.
Every context has it's own query objects. In case of the tasks it is the TaskQuery.
To find all tasks belonging to a process instance pi1 you could do something like that….
        List<Task> taskListe = Engine…  …getTaskService().createTaskQuery()
                .processInstanceId(pi1.getProcessInstanceId()).list();

This is all tasks but not current task of process instance, I cannot find in API docs how get current task of current process.

micha1
Champ on-the-rise
Champ on-the-rise
Hi werdn,

the list() methode gives you only the task or tasks that are currently active,
concerning to other filter criteria you use in the query. It doesn't give you all tasks
defined in the process definition!

Best regards,
Micha

werdn
Champ in-the-making
Champ in-the-making
Hi werdn,

the list() methode gives you only the task or tasks that are currently active,
concerning to other filter criteria you use in the query. It doesn't give you all tasks
defined in the process definition!

Best regards,
Micha

Thank you, Micha!