{"record":{"id":"2391bd1e148dd9a8","repo":"flowable/flowable-engine","slug":"there-is-no-batch-part-with-the-id-batchpartid","errorCode":null,"errorMessage":"There is no batch part with the id ${batchPartId}","messagePattern":"There is no batch part with the id (.+?)","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/delete/BatchDeleteCaseConfig.java","lineNumber":89,"sourceCode":"    }\n\n    public boolean isSequentialExecution() {\n        return sequentialExecution;\n    }\n\n    public int getBatchSize() {\n        return batchSize;\n    }\n\n    public HistoricCaseInstanceQuery getQuery() {\n        return query;\n    }\n\n    public static BatchDeleteCaseConfig create(String batchPartId, CmmnEngineConfiguration engineConfiguration) {\n        BatchService batchService = engineConfiguration.getBatchServiceConfiguration().getBatchService();\n        BatchPart batchPart = batchService.getBatchPart(batchPartId);\n        if (batchPart == null) {\n            throw new FlowableIllegalArgumentException(\"There is no batch part with the id \" + batchPartId);\n        }\n\n        Batch batch = batchService.getBatch(batchPart.getBatchId());\n        JsonNode batchConfiguration = getBatchConfiguration(batch, engineConfiguration);\n        boolean sequentialExecution = batchConfiguration.path(\"sequential\").booleanValue(false);\n\n        JsonNode queryNode = batchConfiguration.path(\"query\");\n        if (queryNode.isMissingNode()) {\n            return new BatchDeleteCaseConfig(batch, batchPart,\n                    prepareFailedResultAsJsonString(\"Batch configuration has no query definition\", engineConfiguration), sequentialExecution);\n        }\n\n        JsonNode batchSizeNode = batchConfiguration.path(\"batchSize\");\n        if (batchSizeNode.isMissingNode()) {\n            return new BatchDeleteCaseConfig(batch, batchPart, prepareFailedResultAsJsonString(\"Batch configuration has no batch size\", engineConfiguration),\n                    sequentialExecution);\n        }\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/delete/BatchDeleteCaseConfig.java#L71-L107","documentation":"Thrown by BatchDeleteCaseConfig.create() when the batchService cannot find a BatchPart entity for the given batchPartId. The batch part is looked up to reconstruct the delete-case batch configuration; without it, deletion progress cannot be resumed. It is an argument-validation error on an identifier passed to the API.","triggerScenarios":"Calling BatchDeleteCaseConfig.create(batchPartId, engineConfiguration) with a batchPartId that does not exist, was already completed and purged, or belongs to a different engine/database.","commonSituations":"Stale batch part ids stored between restarts; passing a Batch id instead of a BatchPart id; typo in id; running against a clean database after a data purge.","solutions":["Verify the batchPartId against the ACT_RU_BATCH_PART table (or BatchService.createBatchPartQuery()) before calling create()","Confirm you are passing the BatchPart id, not the parent Batch id","Check you are connected to the same database/engine where the batch was created","If the batch already finished, skip deletion of historic case instances instead of resuming"],"exampleFix":"// before\nBatchDeleteCaseConfig.create(batchPartId, engineConfig); // throws if null\n// after\nBatchPart part = engineConfig.getBatchServiceConfiguration().getBatchService().getBatchPart(batchPartId);\nif (part != null) {\n    BatchDeleteCaseConfig.create(batchPartId, engineConfig);\n}","handlingStrategy":"validation","validationCode":"if (batchService.getBatchPart(batchPartId) == null) {\n    throw new IllegalStateException(\"Unknown batchPartId: \" + batchPartId);\n}\nBatchDeleteCaseConfig.create(batchPartId, engineConfiguration);","typeGuard":"boolean batchPartExists(String id, BatchService s) { return id != null && s.getBatchPart(id) != null; }","tryCatchPattern":null,"preventionTips":["Persist and reuse the exact BatchPart id returned when the batch was created","Query BatchService.createBatchPartQuery().batchPartId(id).singleResult() before resuming","Do not confuse Batch ids with BatchPart ids"],"tags":["flowable","cmmn","batch","identifier-not-found"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}