{"record":{"id":"8eb1530178094296","repo":"flowable/flowable-engine","slug":"variable-value-is-missing-for-variable-8eb153","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-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java","lineNumber":440,"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":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java#L422-L458","documentation":"addProcessVariables throws this when the variable operation requires a value (anything other than EXISTS or NOT_EXISTS) but variable.getValue() is null. Operations like equals or greaterThan need a concrete value to compare against; existence checks do not.","triggerScenarios":"GET /history/historic-task-instances?processVariable=equals==status with empty value, or a POST body QueryVariable with variableOperation=equals and value omitted/null.","commonSituations":"Client template rendering leaves the value blank; intent was actually an exists check; null value used to mean 'match null' which the REST layer rejects — encode with equalsString/no-value semantics instead.","solutions":["Provide the value in the variable parameter or JSON body.","If you only want tasks that have/don't have the variable, use operation exists or notExists instead of a value operation.","URL-encode the value; an empty string can be dropped during serialization, triggering this error."],"exampleFix":"// before\n{\"name\":\"status\",\"variableOperation\":\"equals\"}\n// after\n{\"name\":\"status\",\"variableOperation\":\"equals\",\"value\":\"active\"}","handlingStrategy":"validation","validationCode":"const NO_VALUE_OPS = ['exists','notExists'];\nvars.forEach(v => { if (!NO_VALUE_OPS.includes(v.variableOperation) && (v.value === undefined || v.value === null)) throw new Error('Value required for op ' + v.variableOperation); });","typeGuard":"function valueRequired(v) { return v.variableOperation !== 'exists' && v.variableOperation !== 'notExists' && v.value != null; }","tryCatchPattern":"try { query(vars) } catch (e) { if (String(e.message).startsWith('Variable value is missing')) { /* supply value or switch to exists */ } else throw e }","preventionTips":["Use exists/notExists when no comparison value is intended","URL-encode values so empty values do not silently vanish"],"tags":["rest-api","query-variable","missing-field","history-query"],"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-14T11:17:12.474Z"}