Someone wrote a BPMN with a boundary event that re-occurs every minute, and then an external task following that had no service handling it. And left a few instances of this uncompleted for 6 months. We had over a million external tasks in the queue, performance was pretty bad, and the external task interface was having heap errors when asked for tasks in priority order.
The obvious solution is to batch delete the problematic process instances. This fails from the UI.
So the admin gave me back end DB access. We discussed it and truncated act_ru_ext_task. This… well it got rid of the heap errors, but we’re still getting a lot of timeouts, and there’s still some sort of token on the process instances. So I dove deeper, the is still some sort of token record with hundreds of thousands of instances showing on the task instance view in cockpit.
I’d like to just do a cascade delete of the problematic process definition, but I got constraint violations instead of a cascade delete.
This is my script so far, any other suggestions?
DELETE FROM public.act_ru_incident
WHERE proc_def_id_ = ‘Process_eCRF:1:407f3c84-2dee-11ed-8196-622ef417b056’;
Delete From public.act_ru_variable
WHERE proc_def_id_ = ‘Process_eCRF:1:407f3c84-2dee-11ed-8196-622ef417b056’;
DELETE FROM public.act_ru_task
WHERE proc_def_id_ = ‘Process_eCRF:1:407f3c84-2dee-11ed-8196-622ef417b056’;
DELETE FROM public.act_ru_execution
WHERE proc_def_id_ = ‘Process_eCRF:1:407f3c84-2dee-11ed-8196-622ef417b056’;
DELETE FROM public.act_hi_procinst
WHERE proc_def_id_ = ‘Process_eCRF:1:407f3c84-2dee-11ed-8196-622ef417b056’;
DELETE FROM public.act_hi_taskinst
WHERE proc_def_id_ = ‘Process_eCRF:1:407f3c84-2dee-11ed-8196-622ef417b056’;
DELETE FROM public.act_hi_varinst
WHERE proc_def_id_ = ‘Process_eCRF:1:407f3c84-2dee-11ed-8196-622ef417b056’;
DELETE FROM public.act_hi_incident
WHERE proc_def_id_ = ‘Process_eCRF:1:407f3c84-2dee-11ed-8196-622ef417b056’;