I want to update you about a problem that looked like the good old "missing house keeping" type of stuff, but it turned out that this was different.
Using Process Admin Console (PAC) we saw 582584 tasks that still existed after using the “Cleanup” button.
I found that these tasks mostly did not belong to any process instance and were in state “received”
select count(*) from lsw_task where bpd_instance_id is null;
Most of the tasks had the following subject:
Error: Re-execute limit reached after executing UCA: "Terminate EWCO Process" ( EM Task: <em_taskId> )
It turned out that, due to an error in the process application that got fixed already, there was a loop causing these many EM tasks and there were corresponding entries in LSW_EM_TASK too.
These were so called OnHold tasks. After confirming that these tasks were not needed anymore, we used the BPMDeleteOnHoldEMTasks command (available since 8.5.7 CF2017.03) to delete Event Manager tasks that are on hold:
and used the all parameter with the command:
BPMDeleteOnHoldEMTasks [-all] [-ids task_id_list]
[5/16/19 17:09:16:485 SAST] 0000017b Log I PAL: The BPMDeleteOnHoldEMTasks command started to delete all on hold Event Manager tasks.
[5/16/19 18:58:13:353 SAST] 0000017b CommandServic I PALAdminCommands deleteOnHoldEMTasks Exiting with 582031 results.
As you can see the command took a while to delete so many entries (~2 hours), but running it out of business hours did the trick!
And if this does not help, take two of these and call me in the morning.
Your Dr. Debug