Custom function
When you need a custom function which is not provided by Chutney, you can implement it and load it to your chutney server.
Implement🔗
- Create a new java class.
- Declare a static method and implement it.
- Annotate it with
@SpelFunction
.
Warning
Method overloading does not work with SpEL.
Package🔗
-
Declare your custom actions full class names inside the file
META-INF/extension/chutney.functions
. -
Add your custom functions' code and meta file in the classpath of a Chutney engine.
Custom function starting server debug log
Check your server log, you will see something like
Add custom functions to an already packaged Chutney server
- Package a JAR archive with your custom functions and associated meta file.
- Use the
loader.path
Java system properties to add your archive to classpath.
Use🔗
Call your custom function from your Kotlin scenario.