{"record":{"id":"55dd3206f5e0c7a7","repo":"flowable/flowable-engine","slug":"could-not-find-a-batch-part-with-id-batchpartid","errorCode":null,"errorMessage":"Could not find a batch part with id '${batchPartId}'.","messagePattern":"Could not find a batch part with id '(.+?)'\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/BatchPartBaseResource.java","lineNumber":38,"sourceCode":"import org.springframework.beans.factory.annotation.Autowired;\n\npublic class BatchPartBaseResource {\n\n    @Autowired\n    protected ManagementService managementService;\n    \n    @Autowired(required=false)\n    protected BpmnRestApiInterceptor restApiInterceptor;\n\n    protected BatchPart getBatchPartById(String batchPartId) {\n        BatchPart batchPart = managementService.getBatchPart(batchPartId);\n        validateBatchPart(batchPart, batchPartId);\n        return batchPart;\n    }\n    \n    protected void validateBatchPart(BatchPart batchPart, String batchPartId) {\n        if (batchPart == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a batch part with id '\" + batchPartId + \"'.\", BatchPart.class);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessBatchPartInfoById(batchPart);\n        }\n    }\n}\n","sourceCodeStart":20,"sourceCodeEnd":46,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/BatchPartBaseResource.java#L20-L46","documentation":"Lookup failure in BatchPartBaseResource.validateBatchPart: ManagementService.getBatchPart returned null for the given batchPartId, so no such batch part exists; typically surfaced as 404.","triggerScenarios":"Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/BatchPartBaseResource.java:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the batch part id via managementService.getBatchPart","List batch parts of the parent batch","Handle 404 as 'part finished or unknown id'"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}