Mapper Properties

Mapper properties are integral components of mapping data attributes between a source and a target in a data transformation process. These properties define how data is manipulated during the mapping process. A mapper can have zero to many properties, each serving a specific purpose in the data transformation workflow.

Types of Mapper Properties

body

Body properties are used to map data attributes from the body of a message or payload. Use body properties when the data to be mapped resides within the main content of the message or payload.

<body in="Price of the product" out="price"/>

groovy

Groovy properties enable the execution of custom Groovy scripts for complex data transformations during the mapping process. Utilize Groovy properties when advanced data manipulation or conditional mapping logic is required.

<groovy expression="body.price.toInteger()+body.vat.toInteger()" out="attribute3"/>

Example:

<loadMapper id="productMapper"> <body in="sku" out="sku"/> <body in="price" out="attribute1"/> <groovy expression="body.size()" out="attribute2" maxLength="20"/> </loadMapper>

In this example:

  • The loadMapper element defines a mapper with the ID "productMapper".

  • Two <body> elements specify mappings for the "sku" and "price" attributes from the input source to the output target. The "sku" attribute is mapped directly to "sku", while the "price" attribute is mapped to "attribute1".

  • The <groovy> element defines a mapping for the "attribute2" attribute using a Groovy expression body.size(). This expression calculates the size of the "body" data and assigns it to "attribute2". A maxLength attribute of 20 is applied to this mapping as well.

MaxLength Attribute (from 4.10.8, 5.3.0)

In general, the maximum length for each attribute mapped by a mapper is set to 255 characters by default. This limit aligns with the partition attribute limit in Pricefx, which also stands at 255 characters. However, exceptions exist, such as handling LOB (Large Object) data in Data Sources, introduced in IM versions 4.10.8 and 5.3.0.

In this example of the <loadMapper> block named "dsMapper":

  • The "sku" attribute is directly transferred from the source to the target with maxLength 255.

  • The "price" attribute from the source is mapped to "attribute1" in the target, with a maximum allowed length of 100 characters.

  • The "description" attribute from the source is mapped without specifying a target attribute, and it has a maximum length constraint of 10,000 characters.

IntegrationManager version 5.8.0