Skip to content

Conversation

@ibodrov
Copy link
Collaborator

@ibodrov ibodrov commented Oct 13, 2025

Adds @ELFunction to the runtime v2 SDK. A static method of any @Named or explicitly bound class marked as @ELFunction will be available in expressions as a function. The function name can be customized:

@Named
public MyFunctions {

   @ELFunction("sayHello")
   public static String greet(String name) {
       return "Hello, " + name;
   }
}

@ibodrov ibodrov force-pushed the ib/custom-functions branch 2 times, most recently from 8d1e2da to cb25094 Compare October 14, 2025 13:19
@ibodrov ibodrov added the docs label Oct 14, 2025
@ibodrov ibodrov requested a review from a team October 14, 2025 14:13
@ibodrov ibodrov marked this pull request as ready for review October 14, 2025 14:13
* Marks a static method as a function that can be called in JUEL expressions.
* The method must be static and will be registered with the provided name or
* using the method's name if omitted.
* Use ":" to separate the prefix and the local name of the function.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there should be a test that covers the prefix:localName support. Is there an existing one prior to this PR that I'm overlooking?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a simple one.

@ibodrov ibodrov force-pushed the ib/custom-functions branch from cb25094 to 86a2ff7 Compare October 15, 2025 13:37
@ibodrov ibodrov requested a review from benbroadaway October 15, 2025 13:37
@ibodrov ibodrov merged commit d3b9b59 into master Oct 21, 2025
4 checks passed
@ibodrov ibodrov deleted the ib/custom-functions branch October 21, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants