{"record":{"id":"e06444031ea4152c","repo":"flowable/flowable-engine","slug":"keylike-is-null-e06444","errorCode":null,"errorMessage":"keyLike is null","messagePattern":"keyLike is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/DecisionQueryImpl.java","lineNumber":169,"sourceCode":"            throw new FlowableIllegalArgumentException(\"parentDeploymentId is null\");\n        }\n        this.parentDeploymentId = parentDeploymentId;\n        return this;\n    }\n\n    @Override\n    public DecisionQueryImpl decisionKey(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 DecisionQueryImpl decisionKeyLike(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 DecisionQueryImpl decisionResourceName(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 DecisionQueryImpl decisionResourceNameLike(String resourceNameLike) {\n        if (resourceNameLike == null) {\n            throw new FlowableIllegalArgumentException(\"resourceNameLike is null\");","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/DecisionQueryImpl.java#L151-L187","documentation":"DecisionQueryImpl.decisionKeyLike(String) throws FlowableIllegalArgumentException when keyLike is null. LIKE-based filters require a pattern string; null cannot be turned into a SQL LIKE condition, so the builder rejects it at call time instead of producing a broken query.","triggerScenarios":"Calling decisionKeyLike(null) — typically a variable holding a user-supplied pattern (e.g. 'order-%') that was never populated, or code forwarding an optional parameter unconditionally.","commonSituations":"Search screens where the user left the 'key contains' field blank and the code passes null instead of skipping the filter; typo between a config property name and the variable read into it.","solutions":["Only call decisionKeyLike when the pattern is non-null; omit the filter otherwise.","Default the pattern to a non-null value such as \"%\" if you truly want all keys.","Trim/normalize user input before passing it, and treat empty string as 'no filter'."],"exampleFix":"// before\nquery.decisionKeyLike(searchPattern);\n// after\nif (searchPattern != null && !searchPattern.isEmpty()) {\n    query.decisionKeyLike(searchPattern);\n}","handlingStrategy":"validation","validationCode":"if (keyLike != null && !keyLike.isEmpty()) {\n    query.decisionKeyLike(keyLike);\n}","typeGuard":"boolean hasPattern(String p) { return p != null && !p.isEmpty(); }","tryCatchPattern":"try {\n    query.decisionKeyLike(keyLike);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"keyLike\")) {\n        keyLike = \"%\"; // fall back to match-all pattern\n        query.decisionKeyLike(keyLike);\n    } else { throw e; }\n}","preventionTips":["Normalize empty user input to null and skip the filter","Default wildcard patterns to \"%\" rather than null","Unit-test query builders with null optional parameters"],"tags":["java","flowable","dmn","null-check","query-builder"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}