{"record":{"id":"3eb67d57b6f8db1d","repo":"flowable/flowable-engine","slug":"there-is-no-batch-part-with-the-id-configuration-3eb67d","errorCode":null,"errorMessage":"There is no batch part with the id ${configuration}","messagePattern":"There is no batch part with the id (.+?)","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/DeleteHistoricProcessInstanceIdsJobHandler.java","lineNumber":59,"sourceCode":" * @author Filip Hrisafov\n */\npublic class DeleteHistoricProcessInstanceIdsJobHandler implements JobHandler {\n\n    public static final String TYPE = \"delete-historic-process-ids\";\n\n    @Override\n    public String getType() {\n        return TYPE;\n    }\n\n    @Override\n    public void execute(JobEntity job, String configuration, VariableScope variableScope, CommandContext commandContext) {\n        ProcessEngineConfigurationImpl engineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n        BatchService batchService = engineConfiguration.getBatchServiceConfiguration().getBatchService();\n\n        BatchPart batchPart = batchService.getBatchPart(configuration);\n        if (batchPart == null) {\n            throw new FlowableIllegalArgumentException(\"There is no batch part with the id \" + configuration);\n        }\n\n        Batch batch = batchService.getBatch(batchPart.getBatchId());\n        if (DeleteProcessInstanceBatchConstants.STATUS_STOPPED.equals(batch.getStatus())) {\n            batchService.completeBatchPart(batchPart.getId(), DeleteProcessInstanceBatchConstants.STATUS_STOPPED, null);\n            return;\n        }\n\n        ManagementService managementService = engineConfiguration.getManagementService();\n\n        BatchPart computeBatchPart = managementService.createBatchPartQuery()\n                .id(batchPart.getSearchKey())\n                .singleResult();\n\n        JsonNode computeBatchPartResult = getBatchPartResult(computeBatchPart, engineConfiguration);\n        JsonNode idsToDelete = computeBatchPartResult.path(\"processInstanceIdsToDelete\");\n        Set<String> processInstanceIdsToDelete = new HashSet<>();\n","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/DeleteHistoricProcessInstanceIdsJobHandler.java#L41-L77","documentation":"DeleteHistoricProcessInstanceIdsJobHandler.execute looks up a BatchPart by the job's configuration id via batchService.getBatchPart(configuration). If no batch part exists with that id it throws FlowableIllegalArgumentException. The job is then orphaned: it references a batch-part row that is gone.","triggerScenarios":"A delete-historic-process-instance-ids batch part job executes with a configuration (batch part id) that batchService.getBatchPart cannot resolve — the ACT_RU_BATCH_PART row was deleted or never committed.","commonSituations":"Direct SQL cleanup of batch part rows; transaction rollback after batch part creation while jobs persisted; purge/migration scripts that removed batch parts but kept jobs.","solutions":["Verify the batch part id exists (ACT_RU_BATCH_PART) and re-create the batch part if it was lost.","Delete the orphaned job whose configuration points at the missing batch part.","Cancel/recreate the whole batch through the BatchService instead of manual table manipulation."],"exampleFix":"// before\n// manual row deletion\nDELETE FROM ACT_RU_BATCH_PART WHERE ID_ = 'partId';\n// after\nbatchService.deleteBatchPartById(partId); // cleans related jobs consistently","handlingStrategy":"validation","validationCode":"BatchPart part = batchService.getBatchPart(partId);\nif (part == null) {\n    // part missing; remove the orphaned job or recreate the batch part\n}","typeGuard":null,"tryCatchPattern":"try {\n    // execute job handler\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"There is no batch part with the id\")) {\n        // mark job as done/dead, do not retry\n    } else {\n        throw e;\n    }\n}","preventionTips":["Use BatchService APIs to delete batch parts so dependent jobs are cleaned up.","Audit runtime tables after purge/migration scripts for orphaned batch part jobs."],"tags":["resource-not-found","batch-part","job-handler","flowable"],"backgroundTag":"record-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}