I have the following doubt with respect to process instance restart.
- Can a running process instance can be restarted?
- If restarted, does the process instance id change?
- What happens to the existing variables of the process instance after restarted?
- What happens to the active and historic task of the process instance after restarted?
Yes/No depending on what you mean by restart
It will have the last known values of the processes.
It depends on how you do it - but you would kill all running tokens and create a new one at the start event.
@Niall, Thanks for your response.
I want to restart a process instance again from the beginning. In this case does process instance id change?
Is there a way we can delete the existing process variables while restarting?
Sure, that isn’t a problem - you would just need to use theprocesses modification feature of the engine to remove the active tokens and create a new ones. Then you can remove the variables and you’re good to go.
Although why is it important to keep the processes instance id?
That’s only if you’re restarting a completed process… if the processes is not yet finished you can “restart” it and keep the same id. Which is why i suggested the modification API instead of the restart instance api.
thanks for the clarification . Also is it better to restart through some event ( Like using Conditional Start Event) rather than using an API . That way i can visually see that the process can be initialized and restarted if needed .
If beginning from the start is usual behavior then i’d certainly suggest modeling it, there are lots of possible ways of doing that. If it is not an expect or frequent occurrence then modeling it might be a little over the top.