For Customer Defined Data Model
This section describes another example. Let us assume that you have created a specialized data model:
MyVPMReferenceentity derived fromVPMReference:MyAttribute1(Type: Integer)MyAttribute2(Type: String)
My3DShapeentity derived from3DShape:MyAttribute3(Type: Integer)MyAttribute4(Type: String)
- A
MyExtensioncustomer extension for which scope contains theMyVPMReferenceandMy3DShapetypes:MyAttribute5(Type: Integer)MyAttribute6(Type: String)
The following entries can be added in the pdm-cust-config.xml file to map such data model, this example illustrates the different mapping capabilities of this file:
<ObjectsConfig>
<Object XPGXMLType="Product" V6Type="MyVPMReference" MappingType="XPDMProduct">
<attribute XPGName="XPDMatt1" V6Name="MyAttribute1" type="integer" Export="true" Import="true" />
<attribute XPGName="XPDMatt2" V6Name="MyAttribute2" type="string" Export="true" Import="true" />
<attributeGroup name="XPDMMyExtensionAttributes" >
<attribute XPGName="XPDMatt5" V6Name="MyAttribute5" type="string" V6ExtensionName="MyExtension" Export="true" Import="true" />
<attribute XPGName="XPDMatt6" V6Name="MyAttribute6" type="string" V6ExtensionName="MyExtension" Export="true" Import="true" />
</attributeGroup>
</Object>
<Object XPGXMLType="Rep3D" V6Type="My3DShape" MappingType="XPDMRep3D">
<attribute XPGName="XPDMatt3" V6Name="MyAttribute3" type="integer" Export="true" Import="true" />
<attribute XPGName="XPDMatt4" V6Name="MyAttribute4" type="string" Export="true" Import="true" />
<attribute XPGName="XPDMatt5" V6Name="MyAttribute5" type="string" V6ExtensionName="MyExtension" Export="true" Import="true" />
<attribute XPGName="XPDMatt6" V6Name="MyAttribute6" type="string" V6ExtensionName="MyExtension" Export="true" Import="true" />
</Object>
<Object XPGXMLType="Rep3DAggr" V6Type="My3DShape" MappingType="XPDMRep3DAggr">
<attributeGroup name="XPDMRep3DAggrAttributes" >
<attribute XPGName="XPDMatt3" V6Name="MyAttribute3" type="integer" Export="true" Import="true" />
<attribute XPGName="XPDMatt4" V6Name="MyAttribute4" type="string" Export="true" Import="true" />
</attributeGroup>
<attribute XPGName="XPDMatt5" V6Name="MyAttribute5" type="string" V6ExtensionName="MyExtension" Export="true" Import="true" />
<attribute XPGName="XPDMatt6" V6Name=" MyAttribute6" type="string" V6ExtensionName="MyExtension" Export="true" Import="true" />
</Object>
</ObjectsConfig>
Each Object tag maps an XPDMXML element (XPGXMLType) and a type (V6Type) to an external logical type
(MappingType).
Within each Object tag attribute tags are used to map the attribute name (V6Name) to an external
logical name (XPGName). For attributes defined on extensions V6ExtensionName must contain the extension name.
An attribute results in a Property element in the XPDMXML file.
Attributes can also be grouped using the attributeGroup tag. While this capability is useful to regroup all
extension’s attributes into a group, it is not limited to it (see declaration for Rep3DAggr/My3DShape).
An attributeGroup results in a Properties element in the XPDMXML file.
VPMRepReference is mapped to four
XPDMXML entities:
Rep3DRep3DAggr
Here is an extract of an XPDMXML that follows this mapping :
<Product id="ID_2" mappingType="XPDMProduct">
...
<Property name="XPDMatt1" type="integer" >
<Value>10</Value>
</Property>
<Property name="XPDMatt2" type="string" >
<Value>dummy</Value>
</Property>
<Properties name="XPDMMyExtensionAttributes">
<Property name="XPDMatt5" type="integer" >
<Value>10</Value>
</Property>
<Property name="XPDMatt6" type="string" >
<Value>dummy</Value>
</Property>
</Properties>
...
</Product>
<Rep3D id="ID_2" mappingType="XPDMRep3D">
...
<Property name="XPDMatt3" type="integer" >
<Value>10</Value>
</Property>
<Property name="XPDMatt4" type="string" >
<Value>dummy</Value>
</Property>
<Property name="XPDMatt5" type="integer" >
<Value>10</Value>
</Property>
<Property name="XPDMatt6" type="string" >
<Value>dummy</Value>
</Property>
...
</Rep3D>
<Rep3DAggr id="ID_2" mappingType="XPDMRep3DAggr">
...
<Properties name="XPDMRep3DAggrAttributes">
<Property name=" XPDMatt3" type="integer" >
<Value>10</Value>
</Property>
<Property name=" XPDMatt4" type="string" >
<Value>dummy</Value>
</Property>
</Properties>
<Property name="XPDMatt5" type="integer" >
<Value>10</Value>
</Property>
<Property name="XPDMatt6" type="string" >
<Value>dummy</Value>
</Property>
...
</Rep3DAggr>
Similarly, you can declare custom attributes of types specializing Instances, Representation Instances.
The supported types for Property elements are listed in XPDMXMLCore.xsd (DynamicAttributeValueTypeEnum).
For more information, see
Resources For Creating An X-PDM Adapter.
When 3DEXPERIENCE platform custom attributes are defined as an enumeration of values, the Property value is the index of the value. For example if, an attribute is an enumeration of strings A, B and C,
exporting value B generates the following content in XPDMXML file:
<Property name="MyEnumerationAtt1" type="integer"> <Value>2</Value> </Property>