{"record":{"id":"5ae6d13b138cb475","repo":"flowable/flowable-engine","slug":"categorylike-is-null-5ae6d1","errorCode":null,"errorMessage":"categoryLike is null","messagePattern":"categoryLike is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessDefinitionQueryImpl.java","lineNumber":112,"sourceCode":"    @Override\n    public ProcessDefinitionQuery processDefinitionIds(Set<String> processDefinitionIds) {\n        this.ids = processDefinitionIds;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionCategory(String category) {\n        if (category == null) {\n            throw new FlowableIllegalArgumentException(\"category is null\");\n        }\n        this.category = category;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionCategoryLike(String categoryLike) {\n        if (categoryLike == null) {\n            throw new FlowableIllegalArgumentException(\"categoryLike is null\");\n        }\n        this.categoryLike = categoryLike;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionCategoryNotEquals(String categoryNotEquals) {\n        if (categoryNotEquals == null) {\n            throw new FlowableIllegalArgumentException(\"categoryNotEquals is null\");\n        }\n        this.categoryNotEquals = categoryNotEquals;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionName(String name) {\n        if (name == null) {\n            throw new FlowableIllegalArgumentException(\"name is null\");","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessDefinitionQueryImpl.java#L94-L130","documentation":"ProcessDefinitionQueryImpl.processDefinitionCategoryLike() filters definitions whose category matches a LIKE pattern, and the pattern must be non-null. Null cannot produce a valid SQL LIKE clause, so the query builder throws FlowableIllegalArgumentException immediately. The pattern itself (e.g. 'http-%') is the caller's responsibility.","triggerScenarios":"Calling processDefinitionCategoryLike(null), typically when the pattern is assembled from a null base value (request param, config key) or the wildcard-building helper returns null for empty input.","commonSituations":"Search UIs forwarding an empty/absent categoryLike parameter; building '%'+value+'%' where value is null; environment-specific config where the categoryLike filter key is unset.","solutions":["Build the LIKE pattern from a validated non-null value before calling the method.","Guard: if (categoryLike != null) query.processDefinitionCategoryLike(categoryLike);","Treat empty input as 'no filter' and skip the call.","Default the pattern in configuration (e.g. '%') when filtering is optional."],"exampleFix":"// before\nProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionCategoryLike(params.get(\"categoryLike\"));\n\n// after\nProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();\nString categoryLike = params.get(\"categoryLike\");\nif (categoryLike != null && !categoryLike.isEmpty()) {\n    query.processDefinitionCategoryLike(categoryLike);\n}","handlingStrategy":"validation","validationCode":"if (categoryLike != null && !categoryLike.isEmpty()) {\n    query = repositoryService.createProcessDefinitionQuery().processDefinitionCategoryLike(categoryLike);\n} else {\n    query = repositoryService.createProcessDefinitionQuery();\n}","typeGuard":"boolean isValidLikePattern(String p) {\n    return p != null && !p.trim().isEmpty();\n}","tryCatchPattern":"try {\n    return repositoryService.createProcessDefinitionQuery().processDefinitionCategoryLike(pattern).list();\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Null categoryLike pattern: {}\", e.getMessage());\n    throw new BadRequestException(\"categoryLike must not be null\");\n}","preventionTips":["Guard string-concatenated patterns ('%'+v+'%') for null inputs.","Map empty request parameters to 'no filter' instead of null setters.","Document expected LIKE syntax (uses SQL wildcards _ and %) for API consumers.","Cover pattern-building helpers with null-input unit tests."],"tags":["flowable","query-builder","null-check","like-pattern"],"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"}