AnsweredAssumed Answered

Activiti : Last completed task

Question asked by madhusudanjoshi on Oct 3, 2013
Latest reply on Oct 5, 2013 by nicholascurren
<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.

<b>Can you please help</b>

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

Outcomes