{"record":{"id":"872751a0c24571fe","repo":"flowable/flowable-engine","slug":"unsupported-variable-query-operation-operation","errorCode":null,"errorMessage":"Unsupported variable query operation: ${operation}","messagePattern":"Unsupported variable query operation: (.+?)","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":409,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/planitem/PlanItemInstanceBaseResource.java","lineNumber":216,"sourceCode":"                    planItemInstanceQuery.caseVariableValueNotEquals(variable.getName(), actualValue);\n                } else {\n                    planItemInstanceQuery.variableValueNotEquals(variable.getName(), actualValue);\n                }\n                break;\n\n            case NOT_EQUALS_IGNORE_CASE:\n                if (actualValue instanceof String) {\n                    if (isCase) {\n                        planItemInstanceQuery.caseVariableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);\n                    } else {\n                        planItemInstanceQuery.variableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);\n                    }\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported when ignoring casing, but was: \" + actualValue.getClass().getName());\n                }\n                break;\n            default:\n                throw new FlowableIllegalArgumentException(\"Unsupported variable query operation: \" + variable.getVariableOperation());\n            }\n        }\n    }\n\n    protected PlanItemInstance getPlanItemInstanceFromRequest(String planItemInstanceId) {\n        PlanItemInstance planItemInstance = runtimeService.createPlanItemInstanceQuery().planItemInstanceId(planItemInstanceId).includeEnded().singleResult();\n        if (planItemInstance == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find an plan item instance with id '\" + planItemInstanceId + \"'.\", PlanItemInstance.class);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessPlanItemInstanceInfoById(planItemInstance);\n        }\n        \n        return planItemInstance;\n    }\n\n    protected Map<String, Object> getVariablesToSet(List<RestVariable> restVariables) {","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/planitem/PlanItemInstanceBaseResource.java#L198-L234","documentation":"The switch over QueryVariableOperation has no case for the given operation, so it falls into the default branch and throws FlowableIllegalArgumentException. This occurs when the REST layer receives an operation value that the plan-item-instance query builder does not handle, typically an unrecognized/unsupported enum value.","triggerScenarios":"Sending variableOperation values not handled by the switch (e.g. EXISTS / NOT_EXISTS which are supported on the task query but not here, or any misspelled/unknown operation string).","commonSituations":"Reusing task-query request payloads against the plan-item-instance endpoint; typos in the operation name; client SDK versions newer than the server (operation exists client-side but unsupported server-side).","solutions":["Use one of the supported operations: EQUALS, NOT_EQUALS, EQUALS_IGNORECASE, NOT_EQUALS_IGNORECASE, GREATER_THAN, GREATER_THAN_OR_EQUALS, LESS_THAN, LESS_THAN_OR_EQUALS, LIKE (as handled by the switch).","Remove EXISTS/NOT_EXISTS filters on this endpoint or switch to the task query endpoint that supports them.","Verify the server version supports the operation you send.","Catch the 400 response and print the unsupported operation from the message body."],"exampleFix":"// before\n{\"name\":\"assignee\",\"variableOperation\":\"exists\",\"value\":\"x\"}\n// after\n{\"name\":\"assignee\",\"variableOperation\":\"equals\",\"value\":\"x\"}","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['equals','notEquals','equalsIgnoreCase','notEqualsIgnoreCase','greaterThan','greaterThanOrEquals','lessThan','lessThanOrEquals','like'];\nif (!filters.every(f => SUPPORTED.includes(f.variableOperation))) throw new Error('Unsupported variable operation for plan item instance query');","typeGuard":"const isSupportedOp = (op) => ['equals','notEquals','equalsIgnoreCase','notEqualsIgnoreCase','greaterThan','greaterThanOrEquals','lessThan','lessThanOrEquals','like'].includes(op);","tryCatchPattern":"try { await query(body); } catch (e) { if (e.status === 400 && /Unsupported variable query operation/.test(e.message)) { /* report allowed ops */ } else { throw e; } }","preventionTips":["Keep client operation enums in sync with server version","Avoid EXISTS/NOT_EXISTS on plan-item-instance queries","Reference RestQueryVariableOperation constants instead of raw strings"],"tags":["rest-api","unsupported-operation","query-parameters"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}