{"record":{"id":"a971350c78744605","repo":"flowable/flowable-engine","slug":"variable-operation-is-missing-for-variable-vari-a97135","errorCode":null,"errorMessage":"Variable operation is missing for variable: ${variable.getName()}","messagePattern":"Variable operation 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":304,"sourceCode":"    }\n\n    /**\n     * Returns the {@link CaseInstance} that is requested without calling the access interceptor\n     * 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","sourceCodeStart":286,"sourceCodeEnd":322,"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#L286-L322","documentation":"When querying case instances with variable filters, each QueryVariable must declare a variableOperation (equals, notEquals, like, etc.). addVariables validates this and throws FlowableIllegalArgumentException when the operation is missing, since the engine cannot translate the filter into a query predicate.","triggerScenarios":"POST/PUT query requests to /cmmn-query/runtime/case-instances (via getQueryResponse) whose body contains a variables array entry without the required 'operation' field, e.g. {\"name\":\"state\",\"value\":\"active\"}.","commonSituations":"Hand-written JSON queries omitting the operation key, client DTOs that don't map the operation field, API version differences where the field name changed, or null operation after enum parsing of an unknown operation string.","solutions":["Add the operation field to each variable filter, e.g. {\"name\":\"state\",\"value\":\"active\",\"operation\":\"EQUALS\"}.","Use a supported QueryVariableOperation value (EQUALS, NOT_EQUALS, EQUALS_IGNORE_CASE, LIKE, GREATER_THAN, LESS_THAN, EXISTS, NOT_EXISTS, ...).","Validate variable filter objects client-side before sending the query.","Check that your client serializer includes the operation field (nulls may be dropped)."],"exampleFix":"// before\n{\"variables\": [{\"name\": \"state\", \"value\": \"active\"}]}\n\n// after\n{\"variables\": [{\"name\": \"state\", \"value\": \"active\", \"operation\": \"EQUALS\"}]}","handlingStrategy":"validation","validationCode":"vars.forEach(v => { if (!v.operation) throw new Error(`Missing operation for variable ${v.name}`); });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include operation in every variables[] entry of query bodies.","Use only documented QueryVariableOperation values.","Validate filter objects before serialization."],"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"}