Integrate Mapper
The integrate
command performs an upsert operation of selected backend objects. This operation is not available for all types of objects. This command is particularly useful in a situation where the caller does not (and should not) know about typed IDs and other “internal” data fields, i.e. typically in an integration scenario. The only mandatory pre-requisite for this command is that the object’s defined business key fields (vary per object type) are present in every request. No type ID or version fields are required. This also means that no version checking is performed, thus the request will overwrite existing data of that record regardless of other changes.
Attribute | Description |
---|---|
| Sets implicit mapping for each attribute. It simplifies mapping because you do not need to define each attribute. If it is set to true, the mapper will map all keys included in the provided model. If you want to override the implicit mapping of an attribute by explicit mapping, add the attribute name into |
| Defines a set of properties that should be excluded from mapping. It is used together with Multiple excluded properties are written as a comma-separated list. Note that the format slightly differs among different IM versions: <pfx:loadMapper id="mapper" excludeProperties="attribute2,attribute3" includeUnmappedProperties="true"/> <pfx:loadMapper id="mapper" excludeProperties="#{'attribute2,attribute3'.split(',')}" includeUnmappedProperties="true"/> |
| Converts all empty strings to null values. It is handy when you send data to Pricefx: if you send an empty value, the filter # in Pricefx UI does not work and also the Groovy logic mainly operates with nulls instead of "". |
| Allows null values to be forwarded to the payload of the integrate request in order to update a field to null value. To set this behavior globally for the integrate method, just set the IM property |
Element | Description |
---|---|
| Maps a value from the body. This example converts the input property 'material' into output property 'sku':
When use the <integrateMapper id="mapper">
<body in="inAttribute1"/>
<body in="inAttribute2" out="outAttribute2"/>
<body in="inAttribute3" out="outAttribute3" predicate="predicateExpression"/>
<simple expression="simple_expression" out="outAttribute5"/>
<groovy expression="groovy_expression" out="outAttribute6"/>
</integrateMapper> |
| Evaluates a simple language expression. In this example we do same operation like in the body example:
|
| Evaluates a Groovy language expression. Expressions can contain any Groovy code. In this example we do same operation like in the body and simple examples:
In the Groovy context, the following properties are available by default:
It is also possible to get the record index (zero-based) from the exchange properties like this:
|
| Maps a value from the message header. This example takes the header parameter with the name 'messageId' and puts 'messageId' into the message:
|
| Maps a value from the exchange property:
|
Each element can also have the converter
attribute which converts data to the required format or type.
IntegrationManager version 5.8.0