I need to cancel ( may be abort is better word here) a running process and I do not need to do any compensation for it but I also want to keep the historical data of the process i.e. if it has already performed steps 1, 2 and 3 and while on 4th step it gets aborted/cancelled I need to have the historical data of what it has done.
the Delete API also deletes the history as I understand so that’s not useful here.
In this post Does DELETE /history/process-instance/ Delete all Associated Data? I see the selected answer says that history will be deleted as well with the option you’ve mentioned so I’ve not tried that yet and looking for option which may be little explicit to not delete history, something like keepHistory = true on such endpoint.
Thanks Niall, I’ve more follow up Q on the DELETE /process-instance/{id},
If it’s executing a step that has a REST call outside Camunda and before response comes back, we delete the process instance, what will happen to the thread waiting for the response? will there be any errors?
Also when I set skipSubprocesses=false, it is going to delete all the process hierarchy that this process created? e.g. P1 --> P2 --> P3 and I delete P1 with this option then P2 and P3 will also be deleted?
Only one tread can be active on any single process instance, so deleting the process wont interrupt any threads, it would have to wait for all threads to finish first.
if process has parallel paths then there are multiple tokens so multiple threads right, so multiple threads can be active on the process right? and if so, the delete api will wait for all of them to finish? of course if I’ve a timer or message receiving task waiting it would still kill it I assume?
Even when there are tokens created in parallel gateways, they are executed as they move through the model one at a time - in memory - when all tokens have moved the sate is commited to the database. So from the database’s perspective they’ve happened at the same time but while running only a single thread at a time moved a token.
The docs has this pretty good page about how transactions work, it’s worth reading for additional information.