camunda-bpm-platform icon indicating copy to clipboard operation
camunda-bpm-platform copied to clipboard

Introduce `restartedByBatch(batchId)` filter criteria for historic process instance query

Open yanavasileva opened this issue 11 months ago • 1 comments

Acceptance Criteria (Required on creation)

  • [ ] Extend the historic process instance query (HistoricProcessInstanceQuery) with #restartedByBatch(String batchId) filter criteria
    • filter historic process instances that has an old process instance which is related to job log related to the restart batch
  • [ ] Expose changes in REST API
    • [ ] document in OpenAPI

Hints

  • query idea: SELECT from ACT_HI_PROCINST RES join ACT_HI_JOB_LOG JL where JL.batchId = param.batchId and RES.restarted_proc_inst_id =JL.PROCESS_INSTANCE_ID_ - there will be more than one job log use the “exists” structure
  • Code:
    • org.camunda.bpm.engine.history.HistoricProcessInstanceQuery
    • engine\src\main\resources\org\camunda\bpm\engine\impl\mapping\entity\HistoricProcessInstance.xml
    • org.camunda.bpm.engine.rest.dto.history.HistoricProcessInstanceQueryDto
  • ❓ HPI supports OR queries, can/do we want the filter be supported for both AND and OR queries?
  • Add to javadoc hint for: If there’s a performance issue, the user needs to clean up their history tables.

Links

Breakdown

### Pull Requests

yanavasileva avatar Mar 22 '24 15:03 yanavasileva

I am working on this one

punitdarira avatar May 23 '24 05:05 punitdarira