Script Expression Functions

Last modified 17 Mar 2021 18:11 +01:00

Introduction

MidPoint provides several sets of built-in functions for scripting expressions. Although the scripting expressions can use full potential of the scripting language and all the associated libraries, there are some things that are commonly used in most deployments. These are either common for many IDM deployments such as string normalization and conversion or such functions are specific to the way how midPoint works. Either way there are several function libraries that are accessible from all the scripting environments that midPoint supports.

Each function library has its own "handle" that is used to access the functions. Invocation for generic scripting environments (Groovy, JavaScript, …​) uses simple variable name to access the functions. The following code snippet shows Groovy syntax for invocation of function norm in library identified by variable basic. The variable names used as library handles are pre-defined. They are specified in the following text.

basic.norm('Guľôčka v jamôčke!')
Not to be confused with custom function libraries.

Basic Library

Basic function library provides very basic functions for string operations, object property retrieval, etc. These are simple, efficient stand-alone functions.

Namespace http://midpoint.evolveum.com/xml/ns/public/function/basic-3

library name

basic

Logging Library

Logging library provides access to logging functions. The functions may be used to log data to the midPoint system logs. Such functions are used mostly for diagnostics and troubleshooting.

Namespace http://midpoint.evolveum.com/xml/ns/public/function/log-3

library name

log

All functions in this library log an entry into the system logs. Ordinary midPoint logging system is used. The log entries are recorded using com.evolveum.midpoint.expression logger. The functions have arguments using the SLF4J style: The first argument is a format string. Each occurrence of {} in the format string is replaced with the argument that follows the format string. E.g. following Groovy code will produce ERROR log record `"The foo is broken, bar is to blame`" assuming that resource=foo and reason=bar.

log.error('The {} is broken, {} is to blame', resource, reason)

Functions:

  • error

  • warn

  • info

  • debug

  • trace

Please see Log Levels page for description of the usual meaning and usage of individual log levels in midPoint.

MidPoint Library

Main article: MidPoint Script Library

MidPoint function library provides access to midPoint internals. It provides complex functions that contain IDM-specific and midPoint-specific logic.

Namespace http://midpoint.evolveum.com/xml/ns/public/function/midpoint-3

library name

midpoint

Documentation and Source Code

Please follow the JavaDoc links below for a documentation of individual functions. The source code may also provide additional information.

Version Basic Library Logging Library MidPoint Library

4.4-SNAPSHOT
(development)

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

4.3
(latest stable)

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

4.2

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

4.1

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

4.0.3
(latest LTS)

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

4.0.2

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.9.1

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

4.0.1

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

4.0

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.9

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.8

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.7.2

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.7.1

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.7

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.6.1

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.6

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.5.1

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.C

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.5

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.4.1

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.4

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.3.1

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.3

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.2

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.1.1

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.1

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source

3.0

JavaDoc, Source

JavaDoc, Source

JavaDoc, Source