{"record":{"id":"d37096a907e9d42c","repo":"flowable/flowable-engine","slug":"provided-categorylike-is-null-d37096","errorCode":null,"errorMessage":"Provided categoryLike is null","messagePattern":"Provided categoryLike is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/TimerJobQueryImpl.java","lineNumber":186,"sourceCode":"    }\n\n    @Override\n    public TimerJobQueryImpl category(String category) {\n        if (category == null) {\n            throw new FlowableIllegalArgumentException(\"Provided category is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.category = category;\n        } else {\n            this.category = category;\n        }\n        return this;\n    }\n\n    @Override\n    public TimerJobQueryImpl categoryLike(String categoryLike) {\n        if (categoryLike == null) {\n            throw new FlowableIllegalArgumentException(\"Provided categoryLike is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.categoryLike = categoryLike;\n        } else {\n            this.categoryLike = categoryLike;\n        }\n        return this;\n    }\n\n    @Override\n    public TimerJobQueryImpl elementId(String elementId) {\n        if (elementId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided element id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.elementId = elementId;\n        } else {\n            this.elementId = elementId;","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/TimerJobQueryImpl.java#L168-L204","documentation":"Flowable's TimerJobQueryImpl.categoryLike(String) throws FlowableIllegalArgumentException when the categoryLike pattern is null. categoryLike performs SQL LIKE-style matching and requires an actual pattern string; null is rejected at query construction. An empty pattern is accepted, though it rarely matches anything useful.","triggerScenarios":"Calling createTimerJobQuery().categoryLike(null), typically when the pattern is built from an optional search input or an expression that evaluated to null.","commonSituations":"REST/GraphQL search endpoints where the user left the category filter blank; templated query builders that pass through null; mistaken assumption that null means 'no filter'.","solutions":["Skip the categoryLike call when the pattern is null/blank instead of passing null","Sanitize and default the pattern (e.g. \"%\" + input + \"%\") only when input is present","Null-check in your query-builder wrapper before delegating to the Flowable query","Catch FlowableIllegalArgumentException and treat as invalid search criteria"],"exampleFix":"// before\nquery.categoryLike(\"%\" + searchInput + \"%\");\n// after\nif (searchInput != null && !searchInput.isEmpty()) {\n    query.categoryLike(\"%\" + searchInput + \"%\");\n}","handlingStrategy":"validation","validationCode":"if (categoryPattern != null && !categoryPattern.isEmpty()) { query.categoryLike(\"%\" + categoryPattern + \"%\"); }","typeGuard":"boolean hasLikePattern(String p) { return p != null && !p.isEmpty(); }","tryCatchPattern":"try { query.categoryLike(pattern); } catch (FlowableIllegalArgumentException e) { log.warn(\"Null categoryLike pattern\", e); }","preventionTips":["Default blank search inputs to no-filter rather than null patterns","Sanitize LIKE wildcards from user input","Centralize query-building so null filters are skipped consistently","Document that null never means 'match all' in Flowable queries"],"tags":["flowable","null-check","query-api","like-clause"],"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"}