cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle completed Tasks

rohitagrawal
Champ on-the-rise
Champ on-the-rise
Hi,

All completed tasks move from ACT_RU_TASK to ACT_HI_TASKINST on completion. Also task local variables are moving to history table.
Is there anyway to prevent this and my task stay as runtime data only.

-Rohit
3 REPLIES 3

trademak
Star Contributor
Star Contributor
Hi,

Activiti uses runtime and history tables. When a task is completed, it's done, so the information is only available in the history tables. Note, that the history tables also contain information about running process instances and tasks not only completed ones.
Why would you want to prevent this default behaviour? What's your use case?

Best regards,

abhip
Champ in-the-making
Champ in-the-making
I also want to ask the same question.
For me use case is ..I want to retrieve all the tasks 
If i invoke using createTaskQuery API, i can get only tasks which are not completed. As once i complete the tasks, it goes to history tables.
and i need history service to get completed tasks. Also from it if i am not wrong i cant get all the taskLocalVariables.

If i disable this removal of task from ACT_RU_TASK on completion, in a single query i can get all the tasks.

jbarrez
Star Contributor
Star Contributor
Then you would need only a query to the history.

Do mind, this will be a slower query vs the runtime one.