<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello Lothar,</p>
    <p>I am afraid we don't have any sample. But all you need to do is
      to create a JAR file (e.g. <font face="monospace">sample.jar</font>,
      having <font face="monospace">org.sample.SampleUtil</font> class
      with a static <font face="monospace">hello(String)</font> method)
      and place it into that directory.</p>
    <p><font face="monospace">package org.sample;<br>
        <br>
        public class SampleUtil {<br>
            public static String hello(String input) {<br>
                return "Hello, " + input + "!";<br>
            }<br>
        }</font></p>
    <p>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:</p>
    <p><font face="monospace">    <mapping><br>
                <name>generate-fullname</name><br>
                <description>Generate fullName (enforcing on
        renames because of strong mapping)</description><br>
                <strength>strong</strength><br>
                <source><br>
                    <path>givenName</path><br>
                </source><br>
                <source><br>
                    <path>familyName</path><br>
                </source><br>
                <expression><br>
                    <script><br>
                        <code><br>
                            <font color="#0000ff">org.sample.SampleUtil.hello</font>(basic.concatName(givenName,
        familyName))<br>
                        </code><br>
                    </script><br>
                </expression><br>
                <target><br>
                    <path>fullName</path><br>
                </target><br>
            </mapping></font></p>
    <p>It gets called from the script.</p>
    <pre class="moz-signature" cols="72">-- 
Pavol Mederly
Interim Chief Product Officer
evolveum.com</pre>
    <div class="moz-cite-prefix">On 16/01/2026 18:41, Lothar Haeger via
      midPoint wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:4074117E-EE6E-4C1F-A5A0-F28DCDA0E47A@is4it.de">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      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? <br
        id="lineBreakAtBeginningOfMessage">
      <div><br>
        <blockquote type="cite">
          <div>Am 16.01.2026 um 17:22 schrieb Ethan Kromhout via
            midPoint <a class="moz-txt-link-rfc2396E" href="mailto:midpoint@lists.evolveum.com"><midpoint@lists.evolveum.com></a>:</div>
          <br class="Apple-interchange-newline">
          <div>
            <meta http-equiv="Content-Type"
              content="text/html; charset=UTF-8">
            <div>
              <p>Hi Lothar,</p>
              <p>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.</p>
              <p>Thanks,</p>
              <p>Ethan</p>
              <div class="moz-cite-prefix">On 1/16/26 10:18 AM, Lothar
                Haeger via midPoint wrote:<br>
              </div>
              <blockquote type="cite"
                cite="mid:25F3C874-5948-4497-B011-F8F81C8156D4@is4it.de">
                Hello everyone,
                <div><br>
                </div>
                <div>still getting used to MidPoint after 20+ years of
                  IDM experience with other tools, pls excuse me asking
                  very basic questions at this point.</div>
                <div><br>
                </div>
                <div>I just came across <a
href="https://docs.evolveum.com/midpoint/reference/master/expressions/function-libraries/configuration/"
originalsrc="https://docs.evolveum.com/midpoint/reference/master/expressions/function-libraries/configuration/"
                    moz-do-not-send="true" class="moz-txt-link-freetext">https://docs.evolveum.com/midpoint/reference/master/expressions/function-libraries/configuration/</a> and <a
href="https://docs.evolveum.com/midpoint/reference/master/expressions/expressions/script/functions/"
originalsrc="https://docs.evolveum.com/midpoint/reference/master/expressions/expressions/script/functions/"
                    moz-do-not-send="true" class="moz-txt-link-freetext">https://docs.evolveum.com/midpoint/reference/master/expressions/expressions/script/functions/</a> 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 <i>FunctionLibraryType</i>
                  in XML syntax? Did not find it in the docs yet…</div>
                <div><br>
                </div>
                <div>Cheers, Lothar</div>
                <div><br>
                </div>
              </blockquote>
            </div>
            _______________________________________________<br>
            midPoint mailing list<br>
            <a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
            <a class="moz-txt-link-freetext" href="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
          </div>
        </blockquote>
      </div>
      <br>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
  </body>
</html>