# MappingType (Complex Type)

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

Defines how a value of a property (or attribute) should be constructed. The value may be static or constructed as an result of evaluating an expression. This structure also defines a method how to merge several value construction definitions, how to behave if a property already has a value, etc. This is reusable data structure, used in schemaHandling, roles and it may also be used in may other places. Motivation: We need to construct attribute or property values on many places in midPoint. E.g. we need that in roles to generate dynamic account attribute values, we need that to define "templates" for identifiers and default values for attributes when creating a new account. We also need that to specify values when creating a new user (user templates). Having the same data structure for all of these cases may simplify the code, as it all can be handled by a generic library reused in many places through the system.

Item Summary
Name | Type | Multiplicity | Description
--- | --- | --- | ---
name | property string | [0,1] | Short name of the mapping.
description | property string | [0,1] |
extension | container ExtensionType | [0,1] | Place for non-standard object properties.
trace | property boolean | [0,1] | Explicitly trace the execution of this mapping.
authoritative | property boolean | [0,1] | Authoritative flag controls the way how mapping is used to remove values.
exclusive | property boolean | [0,1] | Exclusive mapping may be applied only as a single mapping for a particular target property.
strength | property MappingStrengthType | [0,1] | Strength of the mapping defines how aggressively will the mapping be applied.
channel | property anyURI | [0,-1] | Limits application of this mapping only to specific channel.
exceptChannel | property anyURI | [0,-1] | Limits application of this mapping except for channel specified.
timeFrom | property MappingTimeDeclarationType | [0,1] |
timeTo | property MappingTimeDeclarationType | [0,1] |
source | property VariableBindingDefinitionType | [0,-1] |
expression | property ExpressionType | [0,1] |
target | property VariableBindingDefinitionType | [0,1] |
condition | property ExpressionType | [0,1] |

- ### Items

  - #### name

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Short name of the mapping. Used for debugging purposes.

  - #### description

    Flags: RAM,runtime

    Multiplicity: [0,1]

  - #### extension

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Place for non-standard object properties. The elements placed here will be handled exactly like the elements in the object body. It must NOT contain standard elements.

  - #### trace

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Explicitly trace the execution of this mapping. The execution will be logged on INFO level if this property is set to true to make sure that it will be visible in the logs.

  - #### authoritative

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Authoritative flag controls the way how mapping is used to remove values. It does not influence adding of values. If mapping is authoritative then it will add value and also remove the value. If mapping is not authoritative it will only add the value.

    Non-authoritative mappings are used if there are several possible sources for a particular value. E.g. the value may be added by the mapping and also added directly on the resource by system administrator. In this case midPoint cannot remove the value when the assignment (or role) containing the mapping is removed because the value might have been added manually. Other settings, such as tolerance may apply on attribute level.

    The default value for authoritative flag is true.

  - #### exclusive

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Exclusive mapping may be applied only as a single mapping for a particular target property. If an exclusive mapping is applied together with any other mapping it results in an error.

    The default value for exclusive flag is false.

  - #### strength

    Flags: RAM,runtime,AVals:3

    Multiplicity: [0,1]

    Strength of the mapping defines how aggressively will the mapping be applied. The strongest mappings are applied all the time (regardless of the consequences) and the weakest mappings are applied only if nothing else can be applied.

  - #### channel

    Flags: RAM,runtime

    Multiplicity: [0,-1]

    Limits application of this mapping only to specific channel. If the channel is listed then the mapping will be applied. If it is not then it will not be applied. If no channel is specified then no limitations apply and the mapping will be applied for all channels.

  - #### exceptChannel

    Flags: RAM,runtime

    Multiplicity: [0,-1]

    Limits application of this mapping except for channel specified. If the channel is listed then the mapping will be not applied in this channel. If it is not then it will be applied. If no channel is specified then no limitations apply and the mapping will be applied for all channels.

  - #### timeFrom

    Flags: RAM,runtime

    Multiplicity: [0,1]

  - #### timeTo

    Flags: RAM,runtime

    Multiplicity: [0,1]

  - #### source

    Flags: RAM,runtime

    Multiplicity: [0,-1]

  - #### expression

    Flags: RAM,runtime

    Multiplicity: [0,1]

  - #### target

    Flags: RAM,runtime

    Multiplicity: [0,1]

  - #### condition

    Flags: RAM,runtime

    Multiplicity: [0,1]