{"record":{"id":"a0fb873a3f324081","repo":"flowable/flowable-engine","slug":"name-is-null-a0fb87","errorCode":null,"errorMessage":"Name is null","messagePattern":"Name is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java","lineNumber":334,"sourceCode":"\n    @Override\n    public CaseInstanceQueryImpl caseInstanceIds(Set<String> caseInstanceIds) {\n        if (caseInstanceIds == null) {\n            throw new FlowableIllegalArgumentException(\"Case instance ids is null\");\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.caseInstanceIds = caseInstanceIds;\n        } else {\n            this.caseInstanceIds = caseInstanceIds;\n        }\n        return this;\n    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceName(String name) {\n        if (name == null) {\n            throw new FlowableIllegalArgumentException(\"Name is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.name = name;\n        } else {\n            this.name = name;\n        }\n        return this;\n    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new FlowableIllegalArgumentException(\"Name like is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.nameLike = nameLike;\n        } else {\n            this.nameLike = nameLike;","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java#L316-L352","documentation":"Flowable throws FlowableIllegalArgumentException from CaseInstanceQueryImpl.caseInstanceName(String) when the case instance name is null. As with all criteria methods, null is not a valid filter value and is rejected at query-build time. If the name filter is optional, conditionally apply it.","triggerScenarios":"Calling createCaseInstanceQuery().caseInstanceName(null) because an optional name search parameter, config value, or form field was null.","commonSituations":"Search forms submitted without a name; API clients sending JSON that omits the name field (deserialized as null); code paths migrated from empty-string defaults to null.","solutions":["Apply the criterion conditionally: if (name != null) query.caseInstanceName(name)","Use caseInstanceNameLike / caseInstanceNameLikeIgnoreCase (with a non-null pattern) for partial matching needs","Default absent input to a skip-flag in your filter mapping layer rather than null","Catch FlowableIllegalArgumentException to return a clear validation error to API consumers"],"exampleFix":"// before\nquery.caseInstanceName(filter.getName()); // null if not provided\n// after\nif (filter.getName() != null) {\n    query.caseInstanceName(filter.getName());\n}","handlingStrategy":"validation","validationCode":"if (name != null) { query.caseInstanceName(name); }","typeGuard":"boolean hasName = (n instanceof String s) && !s.isEmpty();","tryCatchPattern":"try { query.caseInstanceName(name); } catch (FlowableIllegalArgumentException e) { throw new BadRequestException(\"caseInstanceName must not be null\"); }","preventionTips":["Apply optional name filters conditionally only when present","Configure JSON deserialization to distinguish absent vs null fields and skip absent ones","Centralize query building to enforce null-skip rules"],"tags":["flowable","cmmn","query","null-argument"],"backgroundTag":"null-argument","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"}