cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve Historic Task

jrmich44
Champ in-the-making
Champ in-the-making
Hello,

Is there a way to return the most previously completed task generically? I know that you can use the HistoricTaskService to search for a historic task but I am not quite sure what to search on. You cannot use the previous task ID because the task has already been completed and therefore you have no way of retrieving the completed task ID. I also would not like to use the task name in case in the future the name of the task changes.  An example would be if both tasks A and B transition to task C when they are completed, is there a way to know once you are in task C if you got there from task A or task B?
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

could you try:

    historyService.createHistoricTaskInstanceQuery().orderByHistoricTaskInstanceEndTime().desc().listPage(0,1);

Regards
Martin