{"record":{"id":"230bc1105865a510","repo":"flowable/flowable-engine","slug":"variable-value-is-missing-for-variable-variable-230bc1","errorCode":null,"errorMessage":"Variable value is missing for variable: ${variable.getName()}","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/runtime/caze/BaseCaseInstanceResource.java","lineNumber":308,"sourceCode":"     * Throws the right exceptions when bad request was made or instance was not found.\n     */\n    protected CaseInstance getCaseInstanceFromRequestWithoutAccessCheck(String caseInstanceId) {\n        CaseInstance caseInstance = runtimeService.createCaseInstanceQuery().caseInstanceId(caseInstanceId).singleResult();\n        if (caseInstance == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a case instance with id '\" + caseInstanceId + \"'.\");\n        }\n\n        return caseInstance;\n    }\n\n    protected void addVariables(CaseInstanceQuery caseInstanceQuery, 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 && variable.getVariableOperation() != QueryVariableOperation.EQUALS) {\n                throw new FlowableIllegalArgumentException(\"Value-only query (without a variable-name) is only supported when using 'equals' operation.\");\n            }\n\n            switch (variable.getVariableOperation()) {\n\n            case EQUALS:\n                if (nameLess) {\n                    caseInstanceQuery.variableValueEquals(actualValue);\n                } else {","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/BaseCaseInstanceResource.java#L290-L326","documentation":"For variable query filters whose operation is not EXISTS/NOT_EXISTS, a value is mandatory because the engine compares against it. addVariables throws FlowableIllegalArgumentException when the operation requires a value but variable.getValue() is null.","triggerScenarios":"Query body variables entry like {\"name\":\"amount\",\"operation\":\"GREATER_THAN\"} (no value), or value explicitly null, on /cmmn-query/runtime/case-instances queries.","commonSituations":"Building dynamic filters where optional values are dropped, serializers omitting null fields, confusing EXISTS (which needs no value) with comparison operators, or empty-string values converted to null upstream.","solutions":["Provide a value for every comparison operation, e.g. {\"name\":\"amount\",\"value\":100,\"operation\":\"GREATER_THAN\"}.","Use operation EXISTS or NOT_EXISTS when you only want to test variable presence without a value.","Client-side: validate that each non-EXISTS filter has a non-null value before submitting.","Ensure your JSON payload actually serializes the value field."],"exampleFix":"// before\n{\"name\":\"amount\",\"operation\":\"GREATER_THAN\"}\n\n// after\n{\"name\":\"amount\",\"value\":100,\"operation\":\"GREATER_THAN\"}","handlingStrategy":"validation","validationCode":"vars.forEach(v => {\n  if (!['EXISTS','NOT_EXISTS'].includes(v.operation) && v.value == null)\n    throw new Error(`Missing value for variable ${v.name}`);\n});","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provide value for all comparison operations.","Use EXISTS/NOT_EXISTS when no value comparison is needed.","Check serializer settings so null/false-y values are still sent."],"tags":["rest-api","query","validation","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-14T05:17:10.506Z"}