{"record":{"id":"a13b0681dc29d528","repo":"flowable/flowable-engine","slug":"variable-operation-is-missing-for-variable","errorCode":null,"errorMessage":"Variable operation is missing for variable: ","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/history/task/HistoricTaskInstanceBaseResource.java","lineNumber":417,"sourceCode":"\n            case EXISTS:\n                taskInstanceQuery.taskVariableExists(variable.getName());\n                break;\n\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","sourceCodeStart":399,"sourceCodeEnd":435,"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#L399-L435","documentation":"HistoricTaskInstanceBaseResource.addProcessVariables validates every query variable before building the query. If a process-variable filter arrives without a variableOperation, there is no way to know how to compare the value, so FlowableIllegalArgumentException is thrown naming the variable.","triggerScenarios":"GET /cmmn-history/historic-task-instances with a processVariable filter entry that has a name (and possibly value) but no variableOperation field, e.g. {\"name\": \"region\", \"value\": \"EU\"} with no operation.","commonSituations":"Omitting the operation when hand-crafting query URLs/JSON; a client serialization layer dropping fields named like reserved words; older API clients predating the required-operation contract.","solutions":["Add variableOperation to every process variable filter entry.","Use EXISTS/NOT_EXISTS if you only need presence, which also exempts you from providing a value.","Add client-side validation requiring variableOperation before issuing the query.","Catch FlowableIllegalArgumentException and surface which variable name was missing its operation."],"exampleFix":"// before\n{\"name\": \"region\", \"value\": \"EU\"}\n// after\n{\"name\": \"region\", \"value\": \"EU\", \"variableOperation\": \"EQUALS\"}","handlingStrategy":"validation","validationCode":"for (QueryVariable v : variables) {\n    if (v.getVariableOperation() == null)\n        throw new IllegalArgumentException(\"variableOperation required for variable: \" + v.getName());\n}","typeGuard":null,"tryCatchPattern":"try { return historyService.query(query); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().startsWith(\"Variable operation is missing\")) { /* inspect payload for null operation */ } throw e; }","preventionTips":["Make variableOperation a required field in your client DTO.","Run schema validation on query payloads before sending.","Use EXISTS/NOT_EXISTS when only presence matters."],"tags":["rest-api","query","variables","validation","missing-field"],"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"}