Expressions and mappings are very efficient way how to customize midPoint. They are short specifications how to transform source values to another value(s).
Expressions and mappings are small, fit for the purpose and usually associated with the data that they operate on. Therefore they are quite easy to maintain. MidPoint will execute them only when they are needed. Therefore they are also efficient.
Mapping is a complex solution for reflecting one value to the other. E.g. a mapping is used to reflect a value of user's family name to the
sn LDAP account attribute. It can also be used together with expressions for form complex transformations, form a value from several sources and so. Mappings are very flexible. There are options for specifying fixed values, point to other attributes using path or even using script expressions. Mappings are the "brain" of all synchronization functions, they are used in RBAC and user templates, they are everywhere.
Mappings are intelligent. Mappings are not only aware of the source values, but they also know how the source values are changed and can efficiently reflect that change to the target values. Therefore maintaining the relative change model through the entire midPoint system. The mapping also knows what are its sources and targets and therefore also compensates for correct data type conversions. Mapping is the best tool to customize midPoint behavior. It is used e.g. in outbound mappings, inbound mappings, assignments, roles and so on.
See Mapping page for more details.
Expression is the part of midPoint that contains logic. It is usually part of a mapping, form correlation and confirmation expressions and so on. The expression can be simple data pointers, invocation of Java classes or there may be complex script code to determine the result. Expressions are very flexible, with many options to choose from including the use of literal values, paths to data objects, scripting languages and more.
See Expression page for more details.