{"record":{"id":"46ac8b9cf317b9d5","repo":"flowable/flowable-engine","slug":"keylike-is-null-46ac8b","errorCode":null,"errorMessage":"keyLike is null","messagePattern":"keyLike is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CaseDefinitionQueryImpl.java","lineNumber":188,"sourceCode":"            throw new FlowableIllegalArgumentException(\"parentDeploymentId is null\");\n        }\n        this.parentDeploymentId = parentDeploymentId;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionKey(String key) {\n        if (key == null) {\n            throw new FlowableIllegalArgumentException(\"key is null\");\n        }\n        this.key = key;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionKeyLike(String keyLike) {\n        if (keyLike == null) {\n            throw new FlowableIllegalArgumentException(\"keyLike is null\");\n        }\n        this.keyLike = keyLike;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionResourceName(String resourceName) {\n        if (resourceName == null) {\n            throw new FlowableIllegalArgumentException(\"resourceName is null\");\n        }\n        this.resourceName = resourceName;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionResourceNameLike(String resourceNameLike) {\n        if (resourceNameLike == null) {\n            throw new FlowableIllegalArgumentException(\"resourceNameLike is null\");","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CaseDefinitionQueryImpl.java#L170-L206","documentation":"FlowableIllegalArgumentException thrown by CaseDefinitionQueryImpl.caseDefinitionKeyLike(String) when the key like-pattern is null. Like filters require an actual pattern with optional SQL wildcards; null is rejected eagerly. Omit the setter to match all case definitions.","triggerScenarios":"Calling caseDefinitionQuery.caseDefinitionKeyLike(null) from an uninitialized pattern variable or an absent search input.","commonSituations":"Search screens and batch selectors that build key patterns dynamically; the pattern variable stayed null when the input was empty or the config value missing.","solutions":["Pass a non-null pattern, e.g. caseDefinitionKeyLike(\"invoice-%\").","Guard: only call caseDefinitionKeyLike when the pattern is non-null (and non-empty if desired).","Default the pattern upstream if a wildcard match-all is actually intended."],"exampleFix":"// before\nquery.caseDefinitionKeyLike(keyPattern); // may be null\n\n// after\nif (keyPattern != null && !keyPattern.isEmpty()) {\n    query.caseDefinitionKeyLike(keyPattern);\n}","handlingStrategy":"validation","validationCode":"if (keyLike != null && !keyLike.isEmpty()) {\n    query.caseDefinitionKeyLike(keyLike);\n}","typeGuard":"boolean hasPattern = keyLike != null && !keyLike.isEmpty();","tryCatchPattern":"try {\n    query.caseDefinitionKeyLike(keyLike);\n} catch (FlowableIllegalArgumentException e) {\n    // null pattern — fall back to unfiltered query\n}","preventionTips":["Build patterns defensively (prefix + user fragment + '%') only when the fragment is non-null.","Centralize optional-filter application in a helper to avoid repeating null checks."],"tags":["flowable","cmmn","query","like-pattern","null-check"],"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"}