Type Mapping
Defining the typeConversion section¶
The 'typeConversion' section is used to map different entities of the same type class to different mapping sections in the map file. For example: On the custom-entity type, there could be two sub types that refer to different object classes on the destination system. So using different mapping sections will allow different conversion rules for each type.
typeConversion format¶
In the typeConversion object, define properties with keys for the direction of the transformation. For example: 'vibe2flex' for transforming from VibeIQ to FlexPLM. There are no requirements on the format of the key; but it should be easy to understand the intent.
typeConversion: {
vibe2flex: {
}
}
typeConversion: {
vibe2flex: {
'custom-entity': {
getMapKey: (entity) => {
const typePath = entity['typePath'];
let mapKey = '';
switch (typePath) {
case 'custom-entity:pack':
mapKey = 'packaging';
break;
case 'custom-entity:factory':
mapKey = 'factory';
break;
}
return mapKey;
}
},
color: {
getMapKey: (entity) => {
const colorSystem = entity['colorSystem'];
let mapKey = '';
switch (colorSystem) {
case 'cmyk':
mapKey = 'colorCMYK';
break;
case 'pant':
mapKey = 'colorPant';
break;
}
return mapKey;
}
}
}
}