Hi,
I’ve a process with task as multi-instance of type sequential. I started process (ex: process instanceId = 100), then task is assigned to first user of assignee list, ex: taskId=1to user1. Now I’ve approved this task, task with id=2 is assigned to user 2.
now I queried for HistoricTaskInstance using taskId=2
HistoricTaskInstanceQuery historicTaskInstanceQuery = engine.getHistoryService().createHistoricTaskInstanceQuery();
HistoricTaskInstance historicTaskInstance = historicTaskInstanceQuery.taskId(taskId).singleResult();
I tried
if(historicTaskInstance!=null){
String processInstanceId = historicTaskInstance.getProcessInstanceId();
` List<HistoricTaskInstance> historicTaskInstances = historicTaskInstanceQuery.processInstanceId(processInstanceId).list();`
}
I was expecting size of the list to be two i.e. 1 HistoricTaskInstance with Id=1 and another HistoricTaskInstance with id=2, but it is one.
when I query DB
select * from ACT_HI_TASKINST where PROC_INST_ID_ = '100'
I see 2 rows with ID_=1 and ID_=2
Am I missing something?
How can I fetch tasks from history for a give process instance Id.
Thanks,
Suhas Madap.