元数据的默认值设置
有时,传入数据可能无法为 Windchill 中的某些元数据提供值。在这种情景下,可利用扩展的映射框架来提供默认值。使用源值 '/NULL' 设置可映射标记的映射规则,这意味着源数据未为该标记的值属性指定的元素提供任何值,因此将拾取规则中为目标指定的任何值。如果此类规则包括条件类型的标记,则将在达到目标值之前确定条件。以下是此类规则的一些示例,其中根据数据的 externalTypeId 以及 PreferenceDefinition 和映射配置详细信息为 folderpath 分配了默认值。
<PreferenceDefinition>
<name>R_folderPath</name>
<visibility>HIDDEN</visibility>
<categoryName>FederationMapping</categoryName>
<displayName>R_folderPath</displayName>
<description>R_folderPath</description>
<fullDescription>R_folderPath</fullDescription>
<defaultValue></defaultValue>
<handler>com.ptc.windchill.enterprise.preference.handler.
MultiValueMapPreferenceHandler:</handler>
<defaultComments></defaultComments>
<clientOverride>false</clientOverride>
</PreferenceDefinition>
<LinkPreferenceClientDefinition>
<name>R_folderPath</name>
<clientName>536416322-1456322554305-2141932519-203-136-220-10</clientName>
</LinkPreferenceClientDefinition>
<Mapping preferenceDefinition="R_folderPath" separator=";"
mappingProcessor="wt.ixb.publicforapps.extendedmapping.processor.
MultiTagMappingProcessor">
<Tag value="externalTypeId" condition="true" regex="true"/>
<Tag value="folderPath"/>
</Mapping>
<MVPreferenceInstance>
<valuekey>/NULL;/NULL</valuekey>
<value>/Default/Unspecified</value> <!-Default folderPath if
externaltypeId is not specified -->
<locked>FALSE</locked>
</MVPreferenceInstance>
<MVPreferenceInstance>
<valuekey>^(?=.*wt.doc.WTDocument).*$;/NULL</valuekey>
<value>/Default/WTDocument</value>
<!-Default folderPath for all data that has externalTypeId suggesting it is a
WTDocument or it’s subtype -->
<locked>FALSE</locked>
</MVPreferenceInstance>
<MVPreferenceInstance>
<valuekey>^(?!.*wt.part.WTPartUsageLink)(?=.*wt.part.WTPart).
*$;/NULL</valuekey>
<value>/Default/WTPart</value>
<!-Default folderPath for all data that has externalTypeId suggesting
it is a WTPart or it’s subtype -->
<locked>FALSE</locked>
</MVPreferenceInstance>
<MVPreferenceInstance>
<valuekey>^(?=.*wt.epm.EPMDocument).*$;/NULL</valuekey>
<value>/Default/EPMDocument</value>
<!-Default folderPath for all data that has externalTypeId suggesting
it is a EPMDocument or it’s subtype
<locked>FALSE</locked>
</MVPreferenceInstance>