{"record":{"id":"3b5d403939f67178","repo":"flowable/flowable-engine","slug":"variable-value-is-missing-for-variable-variab-3b5d40","errorCode":null,"errorMessage":"Variable value is missing for variable: \" + variable.getName()","messagePattern":"Variable value is missing for variable: \" \\+ variable\\.getName\\(\\)","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java","lineNumber":348,"sourceCode":"     * Throws the right exceptions when bad request was made or instance was not found.\n     */\n    protected HistoricTaskInstance getHistoricTaskInstanceFromRequestWithoutAccessCheck(String taskId) {\n        HistoricTaskInstance taskInstance = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();\n        if (taskInstance == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a task instance with id '\" + taskId + \"'.\", HistoricTaskInstance.class);\n        }\n        \n        return taskInstance;\n    }\n\n    protected void addTaskVariables(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.taskVariableValueEquals(variable.getName(), actualValue);\n                break;\n","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java#L330-L366","documentation":"For historic task variable query filters, every operation other than EXISTS/NOT_EXISTS requires a value. If the value is null Flowable throws FlowableIllegalArgumentException because equals/greaterThan/like style comparisons are meaningless without a value.","triggerScenarios":"POST /query/historic-tasks with a taskVariables entry using e.g. operation 'equals' but no 'value' property, reaching addTaskVariables with variable.getValue()==null.","commonSituations":"Client omits the value field; JSON null value serialized for the filter; client tries to query 'variable is set' but uses equals instead of the exists operation.","solutions":["Provide a value for the filter: {\"name\":\"x\",\"operation\":\"equals\",\"value\":\"y\"}","If you only want to test variable presence, use operation 'exists' (or 'notExists') which legally has no value","Fix client serialization so the value is not dropped when it is a zero/empty value"],"exampleFix":"// before\n{\"taskVariables\":[{\"name\":\"status\",\"operation\":\"equals\"}]}\n// after\n{\"taskVariables\":[{\"name\":\"status\",\"operation\":\"exists\"}]}\n// or provide the value:\n{\"taskVariables\":[{\"name\":\"status\",\"operation\":\"equals\",\"value\":\"done\"}]}","handlingStrategy":"validation","validationCode":"for (QueryVariable v : variables) {\n    if (v.getVariableOperation() != QueryVariableOperation.EXISTS\n        && v.getVariableOperation() != QueryVariableOperation.NOT_EXISTS\n        && v.getValue() == null)\n        throw new IllegalArgumentException(\"value required for variable \" + v.getName());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use exists/notExists for presence checks instead of value comparisons","Never serialize null values into variable filters","Build filters via typed helpers rather than raw maps"],"tags":["rest-api","validation","query-variables","flowable"],"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-14T16:17:12.679Z"}