MartinMoizard
MartinMoizard

Reputation: 6680

JBPM - Get the list of all the tasks

I'm trying to fetch the list of all the tasks within the JBPM database. I'm using the following code :

 List<Task> liste = taskService.createTaskQuery().list();

But it gives me a list of the first task of each workflow... How could I get the other tasks?

Regards,

Upvotes: 3

Views: 2966

Answers (1)

zawhtut
zawhtut

Reputation: 8551

To retrieve all task instances

    JbpmConfiguration conf = JbpmConfiguration.parseResource("jbpm.cfg.xml");
    JbpmContext context = conf.createJbpmContext();
    List<TaskInstance> taskList = context.getTaskList();

To retrieve task instances using actor

    JbpmConfiguration conf = JbpmConfiguration.parseResource("jbpm.cfg.xml");
    JbpmContext context = conf.createJbpmContext();
    List<TaskInstance> taskList = context.getTaskList("Head of Department");

Upvotes: 1

Related Questions