{"record":{"id":"12948a57f74ea9a4","repo":"flowable/flowable-engine","slug":"function-has-more-than-one-local-name-12948a","errorCode":null,"errorMessage":"Function has more than one local name","messagePattern":"Function has more than one local name","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/el/function/AbstractFlowableVariableExpressionFunction.java","lineNumber":82,"sourceCode":"                return method;\n            }\n        }\n        throw new FlowableException(\"Programmatic error: could not find method \" + functionName + \" on class \" + this.getClass());\n    }\n\n    @Override\n    public String prefix() {\n        throw new UnsupportedOperationException(\"Function has more than one prefix\");\n    }\n\n    @Override\n    public Collection<String> prefixes() {\n        return FUNCTION_PREFIXES;\n    }\n\n    @Override\n    public String localName() {\n        throw new UnsupportedOperationException(\"Function has more than one local name\");\n    }\n\n    @Override\n    public Collection<String> localNames() {\n        return functionNamesOptions;\n    }\n\n    @Override\n    public Method functionMethod() {\n        if (method != null) {\n            return method;\n        }\n\n        method = findMethod(functionName);\n        return method;\n    }\n\n    // Helper methods","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/el/function/AbstractFlowableVariableExpressionFunction.java#L64-L100","documentation":"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().","triggerScenarios":"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.","commonSituations":"Custom function registration or documentation tooling iterating Flowable functions and reading localName(); a subclass updated to accept multiple aliases while callers still call localName().","solutions":["Use localNames() and iterate the returned collection.","Construct the function with a single name option if a singular localName is needed.","Update consumer code to support multiple local names per function."],"exampleFix":"// before\nString name = function.localName();\n\n// after\nfor (String name : function.localNames()) { register(function.prefixes(), name, ...); }","handlingStrategy":"type-guard","validationCode":"if (function.localNames().size() != 1) {\n    // must use localNames()\n}","typeGuard":"String safeLocalName(AbstractFlowableVariableExpressionFunction f) {\n    return f.localNames().size() == 1 ? f.localNames().iterator().next() : null;\n}","tryCatchPattern":"try {\n    String n = function.localName();\n} catch (UnsupportedOperationException e) {\n    // multi-name function: iterate function.localNames() instead\n}","preventionTips":["Prefer localNames() in all generic function-registration/introspection code.","Remember Flowable functions may have aliases (e.g. vars:get, variables:get).","Add unit coverage for tooling against multi-alias functions."],"tags":["el","function","api-usage"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}