REST call /history/historic-process-instances/delete doesn't seem to work?

I could use some help getting the ‘bulk historic instances delete’ working via the REST API.
From the swagger this operation should work:
https://documentation.flowable.com/latest/assets/core-swagger/bpmn.html#/Manage%20History%20Process%20Instances/bulkDeleteHistoricProcessInstances

“process-api/history/historic-process-instances/delete”

POST-ing to this endpoint with ie. this JSON:

{
“action”: “delete”,
“instanceIds”: [
“00059f42-149e-11ed-ba27-02094a0361fb”
],
“deleteReason”: “Maintenance, process finished more than 14 days ago”
}

Always returns this:
{
“message”: “Internal server error”,
“exception”: “Request method ‘POST’ not supported”
}

Changing the operation to DELETE (makes sense right?) always returns the following:
{
“message”: “Not found”,
“exception”: “Could not find a process instance with id ‘delete’.”
}

For the record I did check whether this instanceId exists before (and after) this POST.

Does anyone have some pointers? Or a working example?
We are running 6.7.2.

Hey @CElbersen

DELETE with bulk requests is some nasty topic. Some http clients do not support sending DELETE operations with bodies. also RFC allows to reject DELETE requests with payload. That’s why we decided to use the POST for bulk dlete requests.

Your DELETE request is handled by the HistoricProcessInstanceResource
with @DeleteMapping(“history/historic-process-instances/{processInstanceId}”)
your “delete” is used as the processInstanceId. The engine tries to delete the instance if id “delete” but can not find it.

see:
https://documentation.flowable.com/latest/assets/core-swagger/bpmn.html#/History%20Process/deleteHistoricProcessInstance

Also looking at the testcase, the POST should work.

I believe your POST request also get’s handled by the HistoricProcessInstanceResource instead of the HistoricProcessInstanceCollectionResource.

Greetings

Christopher

1 Like

Sorry for the late response, we are in the process of switching from 6.7.2 to 6.8.
The bulk delete works perfect in 6.8 :slight_smile: