Set Removal Time for already completed Process Instances synchronously

Hi, Is it possible to set removal time of already completed process instances synchronously?

I am using camunda v7 in spring boot application. The camunda batches are executed correctly in my local machine. But When I deploy the application jar to PCF then it does not work i.e the batch waits at 0% progress forever. I increased the PCF allocated memory but still the Job executor does not pickup batches in PCF. The normal process instances work fine but only batches do not work.

So I want to do this synchronously but I only see executeAsync() method in Java code:
historyService.setRemovalTimeToHistoricProcessInstances() .absoluteRemovalTime(Date()) .byQuery(query) .hierarchical() .executeAsync()

Hi @firstpostcommenter,

If your batch didn’t start, maybe the Job executor is busy with jobs that didn’t finish? I’ve seen a case at a customer where the Rest request sent out by a delegate did never times out. After 13 jobs, no other job gets acquired and completed. This blog post may be useful: The Job Executor: What Is Going on in My Process Engine? - Camunda

Another way to set the removal time could be an update in the database direcly with a SQL statement.

There is no way to set the removal time synchrounously as the history is assumed to be immutable by the API.

Hope this helps, Ingo

Hi, The Job executor is not busy. The application does not have any users except me as this is a test environment.
The page mentions act_ru_job but batches are in act_ru_batch right?

In the meantime API to recalculate the removal time exists. See e.g. Setting Up History Cleanup in Camunda - DZone