{"record":{"id":"2bd3bb258e6ed382","repo":"flowable/flowable-engine","slug":"variablenamelike-is-null","errorCode":null,"errorMessage":"variableNameLike is null","messagePattern":"variableNameLike is null","errorType":"validation","errorClass":"org.flowable.common.engine.api.FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/HistoricVariableInstanceQueryImpl.java","lineNumber":245,"sourceCode":"    }\n\n    @Override\n    public HistoricVariableInstanceQuery variableValueLikeIgnoreCase(String variableName, String variableValue) {\n        if (variableName == null) {\n            throw new FlowableIllegalArgumentException(\"variableName is null\");\n        }\n        if (variableValue == null) {\n            throw new FlowableIllegalArgumentException(\"variableValue is null\");\n        }\n        this.variableName = variableName;\n        queryVariableValue = new QueryVariableValue(variableName, variableValue.toLowerCase(), QueryOperator.LIKE_IGNORE_CASE, true);\n        return this;\n    }\n\n    @Override\n    public HistoricVariableInstanceQuery variableNameLike(String variableNameLike) {\n        if (variableNameLike == null) {\n            throw new FlowableIllegalArgumentException(\"variableNameLike is null\");\n        }\n        this.variableNameLike = variableNameLike;\n        return this;\n    }\n    \n    @Override\n    public HistoricVariableInstanceQuery scopeId(String scopeId) {\n        this.scopeId = scopeId;\n        return this;\n    }\n    \n    @Override\n    public HistoricVariableInstanceQuery scopeIds(Collection<String> scopeIds) {\n        if (scopeIds == null || scopeIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"scopeIds is empty\");\n        }\n        this.scopeIds = scopeIds;\n        return this;","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/HistoricVariableInstanceQueryImpl.java#L227-L263","documentation":"HistoricVariableInstanceQuery.variableNameLike() throws FlowableIllegalArgumentException when the variableNameLike argument is null. Name-like filtering of historic variable instances requires a pattern string; a null pattern is treated as a programming/caller error and rejected immediately.","triggerScenarios":"Calling historicVariableInstanceQuery.variableNameLike(null), typically with a pattern built from user input or configuration that was never assigned.","commonSituations":"A search form's 'name contains' field left blank and passed straight through; string concatenation producing the pattern returned null from a helper; property/placeholder not resolved in the environment.","solutions":["Pass a non-null pattern string, using % wildcards as needed (e.g. \"%amount%\").","Only call variableNameLike when the pattern is non-null/empty; omit the filter otherwise.","If an exact name match is needed, use variableName(...) instead.","Trace where the pattern value originates and add validation at that boundary."],"exampleFix":"// before\nquery.variableNameLike(namePattern);\n\n// after\nif (namePattern != null && !namePattern.isEmpty()) {\n    query.variableNameLike(\"%\" + namePattern + \"%\");\n}","handlingStrategy":"validation","validationCode":"if (namePattern == null || namePattern.isEmpty()) {\n    throw new IllegalArgumentException(\"namePattern must be non-null before variableNameLike\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    query.variableNameLike(pattern);\n} catch (FlowableIllegalArgumentException e) {\n    // proceed without the name filter\n}","preventionTips":["Build like-patterns in one utility that guarantees non-null output or throws early.","Omit the name-like filter when the pattern input is blank.","Distinguish 'no filter' (skip the call) from 'filter for nothing' (null) in your builder API."],"tags":["flowable","query","null-argument","validation"],"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"}