flowable/flowable-engine · error · UnsupportedOperationException

Function has more than one local name

Error message

Function has more than one local name

What it means

Like prefix(), the singular localName() accessor is only valid when the function is registered under exactly one local name. AbstractFlowableVariableExpressionFunction subclasses may declare multiple name options (functionNamesOptions, e.g. vars:get / vars:getArray). Calling localName() in the multi-name case throws UnsupportedOperationException by design; use localNames().

Solutions

  1. Use localNames() and iterate the returned collection.
  2. Construct the function with a single name option if a singular localName is needed.
  3. Update consumer code to support multiple local names per function.

Example fix

// before
String name = function.localName();

// after
for (String name : function.localNames()) { register(function.prefixes(), name, ...); }
Defensive patterns

Strategy: type-guard

Validate before calling

if (function.localNames().size() != 1) {
    // must use localNames()
}

Type guard

String safeLocalName(AbstractFlowableVariableExpressionFunction f) {
    return f.localNames().size() == 1 ? f.localNames().iterator().next() : null;
}

Try / catch

try {
    String n = function.localName();
} catch (UnsupportedOperationException e) {
    // multi-name function: iterate function.localNames() instead
}

Prevention

When it happens

Trigger: Calling localName() on a function subclass that was constructed with more than one function name option; generic tooling that resolves an EL function's name via the singular accessor.

Common situations: Custom function registration or documentation tooling iterating Flowable functions and reading localName(); a subclass updated to accept multiple aliases while callers still call localName().

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/el/function/AbstractFlowableVariableExpressionFunction.java:82

                return method;
            }
        }
        throw new FlowableException("Programmatic error: could not find method " + functionName + " on class " + this.getClass());
    }

    @Override
    public String prefix() {
        throw new UnsupportedOperationException("Function has more than one prefix");
    }

    @Override
    public Collection<String> prefixes() {
        return FUNCTION_PREFIXES;
    }

    @Override
    public String localName() {
        throw new UnsupportedOperationException("Function has more than one local name");
    }

    @Override
    public Collection<String> localNames() {
        return functionNamesOptions;
    }

    @Override
    public Method functionMethod() {
        if (method != null) {
            return method;
        }

        method = findMethod(functionName);
        return method;
    }

    // Helper methods

View on GitHub (pinned to d6d39ce1c6)