Enterprise Administration > Windchill Export and Import > Import and Export Policies, Mapping Rules, and Conflict Messages > Reforming Custom-Modeled Attributes
  
Reforming Custom-Modeled Attributes
If an object with custom modeled attributes is exported from system A and then imported into system B, and the object that is being imported on system B does not include the custom modeled attributes, the import fails. The custom modeled attributes should be exported as reusable attributes. This section explains how to write a mapping rule for use in export to ensure that import succeeds in these cases.
Using this type of rule achieves the following goals:
The custom modeled attributes are ignored.
The tags, especially the root tag, are mappable so that the XML files can be handled by the import system.
The DTD specified in the XML is mappable so that the new DTD is recognized and the XML files can be validated by the import system.
As an example, assume there is a class SubTypeOfWTPart, which extends wt.part.WTPart, with the additional attribute mySubTypeAttr1. At the export side is the corresponding handler with a customer DTD Customer-DTD.dtd, which is not included in IXB framework. The export system has the handler to export SubTypeOfWTPart, but unfortunately the import system does not have this handler.
To make the import successful, the export system can supply a mapping rule to achieve the goals described above. In this example, the attribute mySubTypeAttr1 should be ignored, the tag SubTypeOfWTPart should be changed to WTPart, and the Customer-DTD.dtd should be changed to a DTD that is understood by the import system (for example, standardX26.dtd).
The IXB framework supports two mapping rule file formats on export in IXB: XML files and XSL files.
Examples of Mapping File Formats
The XML file exportMapping.xml and XSL file exportMapping.xsl are two examples of mapping files.
XML Example
<?xml version="1.0" encoding="UTF-8"?>
<userSettings>
<mappingRules>
<IGNORE>
<tag> mySubTypeAttr1</tag>
<value>*</value>
</IGNORE>
<CHANGE_TAG>
<tag>SubTypeOfWTPart</tag>
<newTag>WTPart</newTag>
<newDtd>standardX26.dtd</newDtd>
</CHANGE_TAG>
</mappingRules>
</userSettings>
XSL Example
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="SubTypeOfWTPart">
<xsl:choose>
<xsl:when test="name='simplePart'">
<mappingRules>
<IGNORE>
<tag> mySubTypeAttr1</tag>
<value>*</value>
</IGNORE>
</mappingRules>
<mappingRules>
<CHANGE_TAG>
<tag>SubTypeOfWTPart</tag>
<newTag>WTPart</newTag>
<newDtd>standardX26.dtd</newDtd>
</CHANGE_TAG>
</mappingRules>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Ignoring an Attribute
To ignore an attribute, use the built-in command <IGNORE> in a syntax like the following:
<IGNORE>
<tag>tagName</tag>
<path>pathOfTheTag</path>
<value>tagValue</value>
</IGNORE>
In the preceding syntax, the following line is optional:
<path>pathOfTheTag</path>
In the preceding syntax, you can use an asterisk (*) as a wildcard in the following line:
<value>tagValue</value>
To continue the example (Class SubTypeOfWTPart, which extends wt.part.WTPart, with one additional attribute mySubTypeAttr1), tagName is mySubTypeAttr1 and tagValue is * (the wildcard). This ignores all mySubTypeAttr1 with any value.
If there is another object type with an attribute with the same name as mySubTypeAttr1, and this type is not to be ignored, you can include the type by specifying the <path>pathOfTheTag</path>. For example, <path> SubTypeOfWTPart</path>, which means the mySubTypeAttr1 is ignored only if it is a tag under SubTypeOfWTPart.
Changing a Tag to a Different Name
To change a tag to a different name, use the built-in command <CHANGE_TAG>. The syntax for changing a tag to a different name is the following:
<CHANGE_TAG>
<tag>oldTagName</tag>
<path>pathOfTheOldTag</path>
<newTag>newTagName</newTag>
<newDtd>newDTD</newDtd>
</CHANGE_TAG>
You can write similar code to change the DTD by specifying the value of <newDtd>. Look at the two longer example files earlier in this topic to understand how to implement these changes.
The following two lines in the preceding example are optional:
<path>pathOfTheOldTag</path>
<newDtd>newDTD</newDtd>
Administrative Conflicts of Common Administrative Objects
This section describes conflicts for some common administrative items, such as reusable attribute definition, attribute organizer, quantity of measure, measurement system, and subtype definition.
Potential conflict
Behavior
Resolution or Message
Description mismatch for reusable attribute definition, attribute organizer, and subtype definition
User notification
Attributes are different for “Description.” The value of attribute <type> is different from the value as found in database. Expected: <type>, found: <type>
Display name mismatch for reusable attribute definition, attribute organizer, and subtype definition
User notification
Attributes are different for “Display Name.” The value of attribute <type> is different from the value as found in database. Expected: <type>, found: <type>
Hierarchy display name mismatch for reusable attribute definition, attribute organizer, and subtype definition
User notification
Attributes are different for “Hierarchy Display Name.” The value of attribute <type> is different from the value as found in database. Expected: <type>, found: <type>
Attribute organizer does not exist
User notification
Attribute Organization <type> cannot be found.
For more information, see Viewing and Editing Attribute Organizers.
Creating hierarchical reusable attribute definitions not allowed
User notification
Hierarchical Definition <type> is not allowed.
Reusable attribute definition mismatch
User notification
Attribute definition <type> is defined locally as <type>, but is imported as <type>.
For more information, see Managing Reusable Attributes.
Reusable attribute definition or attribute organizer does not exist
User notification
Definition of Instance Based Attribute <type> cannot be found.
For more information, see Managing Reusable Attributes.
Quantity of measure does not exist
User notification
Quantity of measure <type> does not exist.
Unit definition exists with different base unit
User notification
The Quantity of measure <type> for Unit Definition <type> exists with different display units or overridden display units.
Measurement system mismatch for base symbol values
User notification
Measurement system <type> exists with different base symbol value.
Measurement system does not exist
User notification
Measurement system <type> does not exist.
Type definition does not exist
User notification
Type Definition cannot be found: <type>
Existing subtype has fewer reusable attributes than in XML file
User notification
IBA value (attribute type: <type>, path: <type>, value: <type>) is expected with respect to import for: <type>
Existing subtype has extra reusable attributes relative to XML file
User notification
Extra IBA value (attribute type: <type>, path: <type>, value: <type>) is found with respect to import for: <type>
Existing subtype has fewer constraints than in XML file
User notification
Type constraint (enforcementRuleClassname: <type>, bindingRuleClassName: <type>, enforcementRuleData: <type>, IBA definition path: <type>) is expected with respect to import for: <type>
Existing subtype has extra constraints relative to XML file
User notification
Extra type constraint (enforcementRuleClassname: <type>, bindingRuleClassName: <type>, enforcementRuleData: <type>, IBA definition path: <type>) is found with respect to import for: <type>