{"record":{"id":"04de84c70e174351","repo":"flowable/flowable-engine","slug":"unsupported-variable-query-operation-04de84","errorCode":null,"errorMessage":"Unsupported variable query operation: ","messagePattern":"Unsupported variable query operation: ","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricVariableInstanceBaseResource.java","lineNumber":124,"sourceCode":"            }\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                variableInstanceQuery.variableValueEquals(variable.getName(), actualValue);\n                break;\n\n            default:\n                throw new FlowableIllegalArgumentException(\"Unsupported variable query operation: \" + variable.getVariableOperation());\n            }\n        }\n    }\n}\n","sourceCodeStart":106,"sourceCodeEnd":129,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricVariableInstanceBaseResource.java#L106-L129","documentation":"FlowableIllegalArgumentException thrown when a QueryVariable's operation is not EQUALS — the default branch of the switch in addVariables. This historic-variable-instances REST endpoint only supports the EQUALS operation for variable clauses in this version, so any other operation (GREATER_THAN, LIKE, etc.) is rejected as unsupported.","triggerScenarios":"GET/POST /history/historic-variable-instances with variables=[{\"name\":\"amount\",\"value\":\"100\",\"operation\":\"GREATER_THAN\"}] — any operation string other than EQUALS that still deserializes into a valid QueryVariableOperation enum value reaches the default branch and throws.","commonSituations":"Clients reusing runtime-variable query filters (which support more operations) against the historic endpoint; UIs offering full operator dropdowns for history search; upgrading code from a fork or newer Flowable version where additional operations exist.","solutions":["Use operation EQUALS only for variables clauses on this endpoint; apply additional filtering (range, like) client-side over the returned pages","Use dedicated scalar query parameters where available instead of the variables array (check the endpoint's documented parameter list)","Upgrade Flowable or patch HistoricVariableInstanceBaseResource to add the needed switch cases if range queries are essential","Validate operation strings against the supported set before sending the request"],"exampleFix":"// before\n{\"variables\":[{\"name\":\"amount\",\"value\":\"100\",\"operation\":\"GREATER_THAN\"}]}\n// after\nconst list = await fetch('/history/historic-variable-instances?variables=' + encodeURIComponent(JSON.stringify([{name:'amount', value:'100', operation:'EQUALS'}]))).then(r => r.json());\n// client-side refinement\nconst result = list.data.filter(v => Number(v.value) > 100);","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['EQUALS'];\nclauses.forEach(c => { if (!SUPPORTED.includes(c.operation)) throw new Error(`unsupported operation ${c.operation} for historic variable query`); });","typeGuard":"function isSupportedOperation(op) { return op === 'EQUALS'; }","tryCatchPattern":"try { return await queryHistoricVariables(clauses); } catch (e) { if (String(e.message).includes('Unsupported variable query operation')) return queryHistoricVariables(clauses.map(c => ({...c, operation:'EQUALS'}))); throw e; }","preventionTips":["Only expose EQUALS in UIs targeting the historic-variable-instances endpoint","Do not reuse runtime-variable filter builders for history queries","Check Flowable release notes before relying on extra operations"],"tags":["rest","flowable","query","unsupported-operation","bad-request"],"backgroundTag":"unsupported-enum-value","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"}