Mapping Section
Defining a mapping section¶
Each mapping section will have several parts; some of which are required. Others are optional.
Identifier and Informational Properties¶
There are 2 optional properties which return an array of property slugs. These are at the top level of the mapping section. getIdentifierProperties returns the slugs for properties used to identify the entity. Thus are used when searching for that entity. getInformationalProperties returns property slugs to help with debugging. So they are included in the data being sent; but not used in the search. Therefore can be used if there is a problem to help determine what the problem is. For example if the search doesn't find anything, the informational property values can be used to see if the entity / object exists and has an incorrect identifier property value; or if it doesn't exist at all.
getIdentifierProperties: () => ['divName', 'divNumber'],
getInformationalProperties: () => ['longName'],
Inbound Keys to Process¶
The 'vibeOwningKeys' array is a list of property slugs that are controlled by VibeIQ; so will not be set when processing inbound data. This is a black list control. Currently there isn't allow (or 'white') functionality. But it will be added. This is at the top level of the mapping section.
vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
Directional Properties¶
The directional sections are at the top level of the mapping section. Typically there will be two of these. One for going from VibeIQ to the outside system. And the other for coming from the outside system to VibeIQ. Within the directional section object, there are several properties.
The 'transformOrder' property is required; even if it is an empty array. The values are objects with a 'processor' property that matches one of the processor types. And then any properties needed for that 'processor'.
transformOrder: [
{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' },
{ processor: 'VALUE_TRANSFORM', functionTransformersKey: 'valueTransform' }]
Then there are two optional properties. And then any properties needed for the transform processors.
|Property Slug | Description |
|:---|:---|
|getClass | Function that returns the entity's or object's class |
|getSoftType | Function that returns the soft type for the entity / object |
|
direction: {
getClass: () => 'color',
getSoftType: (entity /*, dependencies*/) =>{
const objectSoftType = entity['objectSoftType'];
let val = '';
switch (objectSoftType) {
case 'singleColor':
val = 'color:solid';
break;
case 'complexColor':
val = 'color:pattern';
break;
}
return val;
},
transformOrder: [
{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' },
{ processor: 'VALUE_TRANSFORM', functionTransformersKey: 'valueTransform' }],
rekey: {
productName: 'name',
vibeIQIdentifier: 'itemNumber'
},
valueTransform: {
transformEx: (row/*, dependencies*/) => {
return row['otherProp'] + 'xxx';
}
}