flowable/flowable-engine · error · FlowableException

Unknown method used in expression:

Error message

Unknown method used in expression: 

What it means

JuelExpression.getValue wraps MethodNotFoundException in FlowableException('Unknown method used in expression: <expr> with <variableContainer>'). The expression invoked a method that does not exist on the resolved target or with non-matching argument types, so Flowable rethrows it as an engine FlowableException including the expression text.

Source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/el/JuelExpression.java:56

    public JuelExpression(ExpressionManager expressionManager, ValueExpression valueExpression, String expressionText) {
        this.valueExpression = valueExpression;
        this.expressionText = expressionText;
        this.expressionManager = expressionManager;
    }
    
    @Override
    public Object getValue(VariableContainer variableContainer) {
        ELContext elContext = expressionManager.getElContext(variableContainer);
        Object originalVariableContainer = elContext.getContext(VariableContainer.class);
        elContext.putContext(VariableContainer.class, variableContainer);
        Object originalValueContext = elContext.getContext(EvaluationState.class);
        elContext.putContext(EvaluationState.class, EvaluationState.READ);
        try {
            return resolveGetValueExpression(elContext);
        } catch (PropertyNotFoundException pnfe) {
            throw new FlowableException("Unknown property used in expression: " + expressionText + " with " + variableContainer, pnfe);
        } catch (MethodNotFoundException mnfe) {
            throw new FlowableException("Unknown method used in expression: " + expressionText + " with " + variableContainer, mnfe);
        } catch (FlowableException ex) {
            throw ex;
        } catch (Exception e) {
            throw new FlowableException("Error while evaluating expression: " + expressionText + " with " + variableContainer, e);
        } finally {
            elContext.putContext(EvaluationState.class, originalValueContext);
            elContext.putContext(VariableContainer.class, originalVariableContainer);
        }
    }

    protected Object resolveGetValueExpression(ELContext elContext) {
        return valueExpression.getValue(elContext);
    }

    @Override
    public void setValue(Object value, VariableContainer variableContainer) {
        ELContext elContext = expressionManager.getElContext(variableContainer);
        Object originalVariableContainer = elContext.getContext(VariableContainer.class);

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Compare the method name and argument list in the expression with the actual bean class signature
  2. Ensure the bean (Spring bean or Flowable beans map entry) is registered and in scope for the evaluation
  3. Match parameter types exactly — EL does no implicit conversion beyond basic coercion, so e.g. a String won't bind to an int parameter

Example fix

// before
${orderService.caldculate(order)}
// after
${orderService.calculate(order)}
Defensive patterns

Strategy: try-catch

Validate before calling

// verify before evaluating ${bean.method(x)}
boolean methodExists = bean != null && java.util.Arrays.stream(bean.getClass().getMethods()).anyMatch(m -> m.getName().equals("method"));

Try / catch

try { value = expr.getValue(ctx); } catch (FlowableException e) { if (e.getCause() instanceof MethodNotFoundException) { throw new IllegalStateException("Expression calls a method that does not exist on the target bean", e); } throw e; }

Prevention

When it happens

Trigger: Expressions like ${myBean.doThing(order)} where the method name is wrong, the method signature/arity doesn't match, or the target object doesn't expose the method.

Common situations: Renaming or overloading a bean method without updating process definitions; wrong number/type of arguments in the expression; bean not registered so the resolver cannot find any matching method.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/abbe7d4baf68e243. Report an issue: GitHub.