{"record":{"id":"72ddf9b463a768d0","repo":"flowable/flowable-engine","slug":"type-is-null","errorCode":null,"errorMessage":"type is null","messagePattern":"type is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-batch-service/src/main/java/org/flowable/batch/service/BatchPartBuilderImpl.java","lineNumber":53,"sourceCode":"    protected String status;\n    protected String scopeId;\n    protected String subScopeId;\n    protected String scopeType;\n\n    public BatchPartBuilderImpl(Batch batch, BatchServiceConfiguration batchServiceConfiguration) {\n        this(batch, batchServiceConfiguration, null);\n    }\n\n    public BatchPartBuilderImpl(Batch batch, BatchServiceConfiguration batchServiceConfiguration, CommandExecutor commandExecutor) {\n        this.batch = batch;\n        this.commandExecutor = commandExecutor;\n        this.batchServiceConfiguration = batchServiceConfiguration;\n    }\n\n    @Override\n    public BatchPartBuilder type(String type) {\n        if (type == null) {\n            throw new FlowableIllegalArgumentException(\"type is null\");\n        }\n        this.type = type;\n        return this;\n    }\n\n    @Override\n    public BatchPartBuilder searchKey(String searchKey) {\n        this.searchKey = searchKey;\n        return this;\n    }\n\n    @Override\n    public BatchPartBuilder searchKey2(String searchKey2) {\n        this.searchKey2 = searchKey2;\n        return this;\n    }\n\n    @Override","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-batch-service/src/main/java/org/flowable/batch/service/BatchPartBuilderImpl.java#L35-L71","documentation":"BatchPartBuilderImpl.type(String) throws FlowableIllegalArgumentException when the batch part type is null. The type classifies the batch part (e.g. a batch-part category used by the batch service when persisting) and is mandatory, so it is validated at setter time.","triggerScenarios":"Calling batchService.createBatchPartBuilder().type(null) or passing a variable/config-derived type value that is null.","commonSituations":"Custom batch jobs where the type constant was refactored away; dynamic type selection returning null for unknown cases.","solutions":["Pass a non-null, meaningful batch part type string to type(...)","Default the type to a constant when the dynamic lookup yields null","Validate the source of the type value before building the batch part"],"exampleFix":"// before\nBatchPartBuilder b = batchService.createBatchPartBuilder().type(batchType);\n// after\nBatchPartBuilder b = batchService.createBatchPartBuilder()\n    .type(batchType != null ? batchType : \"DEFAULT\");","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(batchType, \"batch part type must not be null\");\nbuilder.type(batchType);","typeGuard":"boolean hasType = batchType instanceof String s && !s.isEmpty();","tryCatchPattern":"try {\n    builder.type(batchType);\n} catch (FlowableIllegalArgumentException e) {\n    throw new IllegalArgumentException(\"Batch part type missing — check type resolution\", e);\n}","preventionTips":["Keep batch part type constants in a shared class","Default unknown dynamic types to a documented fallback constant","Fail fast when type resolution yields null, with a clear message"],"tags":["null-argument","batch","flowable"],"backgroundTag":"null-argument","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"}