cancel
Showing results for 
Search instead for 
Did you mean: 

HistoryService only shows historic user tasks, not other tasks. Is this a bug?

jesper1
Champ in-the-making
Champ in-the-making
Hello,

I am doing a query for tasks on the HistoryService. I have a simple test process that contains a user task and a service task (implemented in Java code, using a class that implements JavaDelegate).

When I query the tasks for a process, like this:

List<HistoricTaskInstance> taskInstances = historyService.createHistoricTaskInstanceQuery()
        .processInstanceId(processInstanceId).orderByTaskCreateTime().asc().list();
then I only get the user task and not the service task.

Is this what is to be expected, or is this a bug in Activiti? I expected it to return all tasks, not just user tasks.
2 REPLIES 2

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Jesper,

use

  /** Creates a new programmatic query to search for {@link HistoricActivityInstance}s. */
  HistoricActivityInstanceQuery createHistoricActivityInstanceQuery();

Regards
Martin

jesper1
Champ in-the-making
Champ in-the-making
Hi Martin,

Thanks. Activiti uses many different terms such as: tasks, activities, events etc. and it's not always immediately clear which is exactly what.

I see that "task" in this case means a user task, and "activity" is any node in a BPMN graph, including the start- and end-events, user tasks, Java service tasks etc.

Jesper