[midPoint] Are custom Java function libraries possible in MidPoint?

Pavol Mederly mederly at evolveum.com
Wed Jan 21 22:31:04 CET 2026


Hello Lothar,

I am afraid we don't have any sample. But all you need to do is to 
create a JAR file (e.g. sample.jar, having org.sample.SampleUtil class 
with a static hello(String) method) and place it into that directory.

package org.sample;

public class SampleUtil {
     public static String hello(String input) {
         return "Hello, " + input + "!";
     }
}

Then you can refer to those classes simply like this - it is a 
modification of a mapping provided in the Person object template by default:

     <mapping>
         <name>generate-fullname</name>
         <description>Generate fullName (enforcing on renames because of 
strong mapping)</description>
         <strength>strong</strength>
         <source>
             <path>givenName</path>
         </source>
         <source>
             <path>familyName</path>
         </source>
         <expression>
             <script>
                 <code>
org.sample.SampleUtil.hello(basic.concatName(givenName, familyName))
                 </code>
             </script>
         </expression>
         <target>
             <path>fullName</path>
         </target>
     </mapping>

It gets called from the script.

-- 
Pavol Mederly
Interim Chief Product Officer
evolveum.com

On 16/01/2026 18:41, Lothar Haeger via midPoint wrote:
> Oh that's great! Do you know of any Howto or Javadoc or sample code 
> that describes how those classes need to look like, so MidPoint 
> recognizes them and makes them available in scripts? How would custom 
> functions like that be referenced in scripts?
>
>> Am 16.01.2026 um 17:22 schrieb Ethan Kromhout via midPoint 
>> <midpoint at lists.evolveum.com>:
>>
>> Hi Lothar,
>>
>> You should be able to add custom jar files to the MIDPOINT_HOME/lib 
>> directory (location maybe version dependent) and then reference those 
>> in your configurations.
>>
>> Thanks,
>>
>> Ethan
>>
>> On 1/16/26 10:18 AM, Lothar Haeger via midPoint wrote:
>>> Hello everyone,
>>>
>>> still getting used to MidPoint after 20+ years of IDM experience 
>>> with other tools, pls excuse me asking very basic questions at this 
>>> point.
>>>
>>> I just came across 
>>> https://docs.evolveum.com/midpoint/reference/master/expressions/function-libraries/configuration/ and 
>>> https://docs.evolveum.com/midpoint/reference/master/expressions/expressions/script/functions/ and 
>>> wonder if it's possible to add custom Java function libraries 
>>> (similar to the Basic or Logging built-in library) instead of 
>>> creating objects of type /FunctionLibraryType/ in XML syntax? Did 
>>> not find it in the docs yet…
>>>
>>> Cheers, Lothar
>>>
>> _______________________________________________
>> midPoint mailing list
>> midPoint at lists.evolveum.com
>> https://lists.evolveum.com/mailman/listinfo/midpoint
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20260121/fcc35eea/attachment.htm>


More information about the midPoint mailing list