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
- Resolve via functionMethod(prefix, localName) with the actual parsed function name instead of the no-arg overload
- Check instanceof FlowableMultiFunctionDelegate before calling functionMethod()
- 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
- Always resolve multi-function delegates with functionMethod(prefix, localName)
- Branch on instanceof FlowableMultiFunctionDelegate in shared resolution code
- Keep prefix/localName parsing in one utility to avoid inconsistent calls
- Cover both delegate types in unit tests
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
- Function has more than one local name
- Empty object, no variables can be set
- endOr() can only be called after calling or()
- endOr() can only be called after calling or()
- latest can only be used together with a deployment key
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)