AnsweredAssumed Answered

Could I restart a process instance from a previously completed task ?

Question asked by ygu on Oct 25, 2016
Latest reply on Nov 4, 2016 by ygu

Here is what I would like to do: given a process, I would like to be able to go back to a previously completed task, just as if I was canceling everything that has been done after it, and do it again, just as the first time.

I know this may seem weird, but I do not want the process to include a decision node and a loop to that task since I would like to be able to do it for any task of the process.

As far as I could see, this is not provided in the public API of activiti, am I right ?

So what I decided to do is to execute some custom SQL queries to obtain what I want. I used the following queries :
- insert a new execution for the activity of the task in ACT_RU_EXECUTION
- insert a new task for this task in ACT_RU_TASK
- insert a new task instance for this task in ACT_HI_TASKINST

The result was almost ok: the task is active again, but, once I complete the task again, I would expect the children task to be activated, however, the process just resume from the previous state (the one before I executed the SQL queries).

Can anyone help me on this ? Do not hesitate to tell me if it is not clear.

Thanks a lot