flowable/flowable-engine · error · UnsupportedOperationException

Function Delegate has more than one function method

Error message

Function Delegate has more than one function method

What it means

FlowableMultiFunctionDelegate.functionMethod() is a default interface method that deliberately throws UnsupportedOperationException("Function Delegate has more than one function method") because a multi-function delegate exposes multiple function methods selected by prefix and local name. Callers must use functionMethod(String prefix, String localName) instead.

Solutions

  1. Resolve via functionMethod(prefix, localName) with the actual parsed function name instead of the no-arg overload
  2. Check instanceof FlowableMultiFunctionDelegate before calling functionMethod()
  3. If only one method is intended, implement plain FlowableFunctionDelegate

Example fix

// before
Method m = delegate.functionMethod();
// after
Method m = delegate instanceof FlowableMultiFunctionDelegate
        ? ((FlowableMultiFunctionDelegate) delegate).functionMethod(prefix, localName)
        : delegate.functionMethod();
Defensive patterns

Strategy: type-guard

Validate before calling

// resolve the method via the multi-function API when applicable
Method m = delegate instanceof FlowableMultiFunctionDelegate
        ? ((FlowableMultiFunctionDelegate) delegate).functionMethod(prefix, localName)
        : delegate.functionMethod();

Type guard

static boolean isMultiFunction(FlowableFunctionDelegate d) {
    return d instanceof FlowableMultiFunctionDelegate;
}

Try / catch

try {
    Method m = delegate.functionMethod();
} catch (UnsupportedOperationException e) {
    Method m2 = ((FlowableMultiFunctionDelegate) delegate).functionMethod(prefix, localName);
}

Prevention

When it happens

Trigger: Calling functionMethod() on a FlowableMultiFunctionDelegate, or generic function-resolution code that invokes the no-arg functionMethod() without checking for multi-function delegates.

Common situations: Function-registry code written for single-method FlowableFunctionDelegate being reused with FlowableFunction implementations that register several related functions under one delegate.

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/61a21dc83f05eff5. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-engine-common-api/src/main/java/org/flowable/common/engine/api/delegate/FlowableMultiFunctionDelegate.java:33

import java.lang.reflect.Method;
import java.util.Collection;

/**
 * @author Filip Hrisafov
 */
public interface FlowableMultiFunctionDelegate extends FlowableFunctionDelegate {

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

    @Override
    Collection<String> localNames();

    @Override
    default Method functionMethod() {
        throw new UnsupportedOperationException("Function Delegate has more than one function method");
    }

    @Override
    Method functionMethod(String prefix, String localName) throws  NoSuchMethodException;
}

View on GitHub (pinned to d6d39ce1c6)