{"record":{"id":"30fb35c37baca0d5","repo":"flowable/flowable-engine","slug":"variable-value-is-missing-for-variable","errorCode":null,"errorMessage":"Variable value is missing for variable: ","messagePattern":"Variable value is missing for variable: ","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/task/HistoricTaskInstanceBaseResource.java","lineNumber":421,"sourceCode":"\n            case NOT_EXISTS:\n                taskInstanceQuery.taskVariableNotExists(variable.getName());\n                break;\n\n            default:\n                throw new FlowableIllegalArgumentException(\"Unsupported variable query operation: \" + variable.getVariableOperation());\n            }\n        }\n    }\n\n    protected void addProcessVariables(HistoricTaskInstanceQuery taskInstanceQuery, List<QueryVariable> variables) {\n        for (QueryVariable variable : variables) {\n            if (variable.getVariableOperation() == null) {\n                throw new FlowableIllegalArgumentException(\"Variable operation is missing for variable: \" + variable.getName());\n            }\n            if (variable.getVariableOperation() != QueryVariableOperation.EXISTS && variable.getVariableOperation() != QueryVariableOperation.NOT_EXISTS) {\n                if (variable.getValue() == null) {\n                    throw new FlowableIllegalArgumentException(\"Variable value is missing for variable: \" + variable.getName());\n                }\n            }\n\n            boolean nameLess = variable.getName() == null;\n\n            Object actualValue = restResponseFactory.getVariableValue(variable);\n\n            // A value-only query is only possible using equals-operator\n            if (nameLess) {\n                throw new FlowableIllegalArgumentException(\"Value-only query (without a variable-name) is not supported.\");\n            }\n\n            switch (variable.getVariableOperation()) {\n\n            case EQUALS:\n                taskInstanceQuery.processVariableValueEquals(variable.getName(), actualValue);\n                break;\n","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/task/HistoricTaskInstanceBaseResource.java#L403-L439","documentation":"In HistoricTaskInstanceBaseResource.addProcessVariables, any operation other than EXISTS or NOT_EXISTS requires a non-null variable value. A null value with, e.g., EQUALS cannot be turned into a meaningful process-variable predicate, so FlowableIllegalArgumentException is thrown naming the variable.","triggerScenarios":"GET /cmmn-history/historic-task-instances with a processVariable filter like {\"name\": \"amount\", \"variableOperation\": \"EQUALS\"} (no value), or value explicitly null, with an operation other than EXISTS/NOT_EXISTS.","commonSituations":"Trying to find tasks where a variable is unset by sending value:null with EQUALS; templated query builders leaving value blank; JSON bodies where null fields are preserved instead of dropped.","solutions":["Provide the variable value for comparison operations.","Use variableOperation EXISTS or NOT_EXISTS when you intend to test variable presence (these explicitly allow a null value).","Validate value non-null for non-existence operations before sending the request.","Catch FlowableIllegalArgumentException and report the offending variable name."],"exampleFix":"// before\n{\"name\": \"amount\", \"variableOperation\": \"EQUALS\", \"value\": null}\n// after\n{\"name\": \"amount\", \"variableOperation\": \"EXISTS\"}","handlingStrategy":"validation","validationCode":"if (v.getVariableOperation() != EXISTS && v.getVariableOperation() != NOT_EXISTS && v.getValue() == null)\n    throw new IllegalArgumentException(\"value required for operation \" + v.getVariableOperation() + \" on variable: \" + v.getName());","typeGuard":null,"tryCatchPattern":"try { return queryResponse(query); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().startsWith(\"Variable value is missing\")) { /* switch to EXISTS or supply value */ } throw e; }","preventionTips":["Use EXISTS/NOT_EXISTS for presence checks instead of value:null.","Require non-null values for comparison operations in client code.","Reject filter DTOs with null values at construction time."],"tags":["rest-api","query","variables","validation","null-value"],"backgroundTag":"missing-required-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"}