flowable/flowable-engine · error · UnsupportedOperationException
Function has more than one local name
Error message
Function has more than one local name
What it means
FlowableMultiFunctionDelegate.localName() is a default interface method that deliberately throws UnsupportedOperationException("Function has more than one local name") because a multi-function delegate supports several local names instead of exactly one. Implementations must override localNames() and functionMethod(String,String) instead.
Solutions
- Use localNames() (the Collection) instead of localName() when working with multi-function delegates
- Add an instanceof FlowableMultiFunctionDelegate check and branch to localNames() / functionMethod(prefix, localName)
- If this delegate should have a single name, implement FlowableFunctionDelegate directly with localName() and functionMethod()
Example fix
// before
String name = delegate.localName();
// after
String name = delegate instanceof FlowableMultiFunctionDelegate
? ((FlowableMultiFunctionDelegate) delegate).localNames().iterator().next()
: delegate.localName(); Defensive patterns
Strategy: type-guard
Validate before calling
// avoid calling localName() on multi-function delegates
if (delegate instanceof FlowableMultiFunctionDelegate) {
List<String> names = new ArrayList<>(((FlowableMultiFunctionDelegate) delegate).localNames());
} else {
String name = delegate.localName();
} Type guard
static boolean isMultiFunction(FlowableFunctionDelegate d) {
return d instanceof FlowableMultiFunctionDelegate;
} Try / catch
try {
String name = delegate.localName();
} catch (UnsupportedOperationException e) {
Collection<String> names = ((FlowableMultiFunctionDelegate) delegate).localNames();
} Prevention
- Treat FlowableMultiFunctionDelegate as a distinct API surface (localNames/functionMethod(prefix, localName))
- Add instanceof checks in generic function-registry code
- Read the interface contract before implementing or consuming function delegates
- Unit-test custom function registration with both delegate kinds
When it happens
Trigger: Calling localName() directly on a FlowableMultiFunctionDelegate, or engine/function-lookup code that assumes single-name FlowableFunctionDelegate semantics and queries localName() on a multi-name function.
Common situations: Custom JUEL/flowable function registrars iterating all function delegates and calling localName() uniformly without an instanceof FlowableMultiFunctionDelegate check.
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 Delegate has more than one function method
- 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/590ad3eebb4d2fc5.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine-common-api/src/main/java/org/flowable/common/engine/api/delegate/FlowableMultiFunctionDelegate.java:25
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flowable.common.engine.api.delegate;
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)