{"record":{"id":"232b252514143020","repo":"flowable/flowable-engine","slug":"error-method-invalid-232b25","errorCode":null,"errorMessage":"error.method.invalid","messagePattern":"error\\.method\\.invalid","errorType":"exception","errorClass":"ELException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/tree/impl/ast/AstRightValue.java","lineNumber":68,"sourceCode":"\t\treturn true;\n\t}\n\n\t/**\n\t * non-lvalues are always readonly, so throw an exception\n\t */\n\t@Override\n\tpublic final void setValue(Bindings bindings, ELContext context, Object value) {\n\t\tthrow new ELException(LocalMessages.get(\"error.value.set.rvalue\", getStructuralId(bindings)));\n\t}\n\n\t@Override\n\tpublic final MethodInfo getMethodInfo(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes) {\n\t\treturn null;\n\t}\n\n\t@Override\n\tpublic final Object invoke(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes, Object[] paramValues) {\n\t\tthrow new ELException(LocalMessages.get(\"error.method.invalid\", getStructuralId(bindings)));\n\t}\n\n\t@Override\n\tpublic final boolean isLeftValue() {\n\t\treturn false;\n\t}\n\t\n\t@Override\n\tpublic boolean isMethodInvocation() {\n\t\treturn false;\n\t}\n\t\n\t@Override\n\tpublic final ValueReference getValueReference(Bindings bindings, ELContext context) {\n\t\treturn null;\n\t}\n}\n","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/tree/impl/ast/AstRightValue.java#L50-L86","documentation":"AstRightValue nodes cannot invoke methods; invoke() is final and unconditionally throws ELException. Method invocation is only valid on AST nodes that resolve to an object or method binding (e.g. AstMethod, AstIdentifier resolving to a bean). This is the EL engine's way of saying the expression does not denote a callable.","triggerScenarios":"Calling invoke()/MethodExpression.invoke (or getMethodInfo path) on an expression whose parsed AST root is an rvalue, e.g. invoking MethodExpression created from a literal or operator expression like '${1 + 1}' or '${a.b}' used where a method expression was expected.","commonSituations":"Passing a value expression string where a method expression is required (missing parentheses/arguments, e.g. '${myBean.doWork}' instead of '${myBean.doWork()}'); wiring Flowable expression attributes with non-callable expressions.","solutions":["Make the expression a proper method call: add parentheses and arguments, e.g. '${myBean.doWork()}' or '${myBean.doWork(param)}'.","Confirm the expression evaluates to an object with an invocable method; check the root node type before calling invoke.","If you only need the value, call getValue on the ValueExpression instead of invoke on a MethodExpression."],"exampleFix":"// before\nString expr = \"${myBean.doWork}\"; // invoked -> ELException error.method.invalid\n// after\nString expr = \"${myBean.doWork()}\";","handlingStrategy":"validation","validationCode":"if (!exprString.matches(\".*\\\\)\\\\s*$\")) { throw new IllegalArgumentException(\"Expression is not a method call: \" + exprString); }","typeGuard":"boolean isMethodExpression(String expr) { return expr.contains(\"(\") && expr.trim().endsWith(\")\"); }","tryCatchPattern":"try { methodExpression.invoke(ctx, params); } catch (ELException e) { log.error(\"Not invokable: {}\", e.getMessage()); }","preventionTips":["Include () in method expressions used with MethodExpression","Use ValueExpression.getValue for value-only needs","Unit-test expressions with the EL factory before deploying the process"],"tags":["el","expression","method-invocation"],"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"}