cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti : Last completed task

madhusudanjoshi
Champ on-the-rise
Champ on-the-rise
<b>Problem</b>

I want to get the last task completed for the process instance. I am able to get the last completed human task, but not a Service task.

<b>What i have tried</b>

I have written a SQL query, i am using MySQL, to find out what is last task that is completed. Here it goes :
<blockcode>
SELECT * FROM act_hi_taskinst
where PROC_INST_ID_= '1234' and END_TIME_ IS  NOT NULL
order by END_TIME_ desc;
</blockcode>

act_hi_taskinst is the table that gets updated as and when the process instance progresses.

The process flow goes something like this :

A human Task (Leave request) -> Service task( Check availability of leave) -> service task(Check feasibility) -> A human task(Manager task)

When the task comes to Manager Task the last completed is Check feasibility, but its not reflecting in database.

Can you please help

Does activiti provide any such API to get the last completed service task? Can you suggest some SQL query to solve the problem.
1 REPLY 1

trademak
Star Contributor
Star Contributor
You can look in the historic activity table via the HistoryService. That gives an overview of the full execution path.

Best regards,