{"record":{"id":"e0db08a2130689a2","repo":"flowable/flowable-engine","slug":"status-is-null","errorCode":null,"errorMessage":"status is null","messagePattern":"status 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":74,"sourceCode":"        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\n    public BatchPartBuilder status(String status) {\n        if (status == null) {\n            throw new FlowableIllegalArgumentException(\"status is null\");\n        }\n        this.status = status;\n        return this;\n    }\n\n    @Override\n    public BatchPartBuilder scopeId(String scopeId) {\n        if (scopeId == null) {\n            throw new FlowableIllegalArgumentException(\"scopeId is null\");\n        }\n        this.scopeId = scopeId;\n        return this;\n    }\n\n    @Override\n    public BatchPartBuilder subScopeId(String subScopeId) {\n        if (subScopeId == null) {\n            throw new FlowableIllegalArgumentException(\"subScopeId is null\");","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-batch-service/src/main/java/org/flowable/batch/service/BatchPartBuilderImpl.java#L56-L92","documentation":"BatchPartBuilderImpl.status(String) throws FlowableIllegalArgumentException when status is null. Status (e.g. pending/completed/failed) is a required field for a batch part and is validated eagerly at setter time.","triggerScenarios":"Calling .status(null) on a BatchPartBuilder, typically when the status is computed from job state that is not yet resolved.","commonSituations":"Async handlers writing a batch part before the status is known; state-machine lookups returning null for unmapped states.","solutions":["Pass a concrete status string (e.g. \"pending\", \"failed\") to status(...)","Default to an initial status constant instead of null when state is undetermined","Enumerate/map all possible states so no path yields null"],"exampleFix":"// before\nbuilder.status(currentStatus);\n// after\nbuilder.status(currentStatus != null ? currentStatus : \"pending\");","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(status, \"batch part status must not be null\");\nbuilder.status(status);","typeGuard":"boolean hasStatus = status instanceof String s && !s.isEmpty();","tryCatchPattern":"try {\n    builder.status(status);\n} catch (FlowableIllegalArgumentException e) {\n    builder.status(\"pending\"); // safe initial status\n}","preventionTips":["Use an enum for statuses and map to string, never null","Initialize status to a well-known start value","Cover all state transitions in unit tests"],"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"}