Map functions - SmartPlant Foundation - IM Update 48 - Help - Hexagon

SmartPlant Foundation Help

Language
English
Product
SmartPlant Foundation
Search by Category
Help
SmartPlant Foundation / SDx Version
10
SmartPlant Markup Plus Version
10.0 (2019)
Smart Review Version
2020 (15.0)

It is possible to create a map function and relate the map function to the property mapping relationship. This allows you to write code for the map function using the Method override technique, as described in the section on Mapping customization found in CDW customization.

OOTB map functions

Below is an example of the out-of-the-box map functions.

<SPFMapFunctionDef>

<IObject UID="MF_SPFClassificationFromTyping" Name="SPFClassificationFromTyping" />

<ISPFMapFunctionDef SPFMapFunctionToInvoke="SPFClassificationFromTyping" />

</SPFMapFunctionDef>

This is related to a property mapping in the ATP schema as follows:

<Rel>

<IObject UID="InstrumentType.InstrumentType.PropertyDefToPropertyDef"/>

<IRel UID1="InstrumentType" UID2="InstrumentType" DefUID="PropertyDefToPropertyDef" OrderValue="0" IsRequired="False"/>

<IMapRel End1MapValue="PIDInlineInstrument" />

<ISchemaObj/>

</Rel>

<Rel>

<IObject UID="InstrumentType.InstrumentType.PropertyDefToPropertyDef.MF_SPFClassificationFromTyping"/>

<IRel UID1="InstrumentType.InstrumentType.PropertyDefToPropertyDef" UID2="MF_SPFClassificationFromTyping" DefUID="MappingToSPFMapFunction" OrderValue="0" IsRequired="False"/>

<ISchemaObj/>

</Rel>

Map function implementation

The mapping classes tell the interpreter that there is a map function that needs to be run. The interpreter calls the method definition ExecuteMapFunction on the ISPFMapFunctionDef interface.

The property SPFMapFunctionToInvoke on the map function definition is compared, and, if it matches any of the predefined mapping class values, the method is called.

The ExecuteMapFunction method returns a string that is used to set the property defined by the mapping relationship. In the example, the map function passes the source object property value for InstrumentType, and then the value returned is used to set the InstrumentType property on the target object.

See Also

Consolidation Implementation and Customization
Consolidation implementation basics
Authoring relationship processing
Classification handling
CDW customization
Correlate by name