填充多值首选项实例
对于您创建的每个首选项定义,您将填充定义映射的多值首选项实例。这些实例采用键值对的形式,并与首选项客户端相关联,这意味着您可以针对多个源系统拥有多个实例 (映射)。键可选择性地包含条件以及要映射的值。条件和值可支持正则表达式。如果 RegEx 支持这些值,则可以控制生成的值应替换匹配模式还是完全替换整个字符串。
<BeginMVPreferenceInstance>
<name>R_objectContainerPath</name>
<!-identifier of the preference definition -->
<comments>Just a test</comments>
<clientName>536416322-1456322554305-2141932519-203-136-220-10</clientName>
<!- the preference client (indirectly a source system) for which these
instances/mappings are defined
<locked>false</locked> <!-are these instances mutable -->
</BeginMVPreferenceInstance>
<MVPreferenceInstance> <!-every instance -->
<valuekey>/NULL</valuekey>
<!-- Default for objectContainerPath . If there is no objectContainerPath
element present or no value specified, the following default value
would be used then-->
<value>/wt.inf.container.OrgContainer=Demo Organization/
wt.pdmlink.PDMLinkProduct=GOLF_CART</value>
<locked>false</locked> <!-Is this instance mutable -->
</MVPreferenceInstance>
<MVPreferenceInstance> <!-every instance -->
<valuekey>/wt.inf.container.OrgContainer=Demo
Organization/wt.pdmlink.PDMLinkProduct=CART1</valuekey>
<!-a specific value is mapped -->
<value>/wt.inf.container.OrgContainer=Demo
Organization/wt.pdmlink.PDMLinkProduct=GOLF_CART</value>
<locked>false</locked> <!-Is this instance mutable -->
</MVPreferenceInstance>
<MVPreferenceInstance> <!-every instance -->
<valuekey>>.*CART2.*</valuekey>
<!-if the source containerPath has CART2 word in it, it
would be mapped to GOLF_CART always-->
<value>/wt.inf.container.OrgContainer=Demo
Organization/wt.pdmlink.PDMLinkProduct=GOLF_CART</value>
<locked>false</locked> <!-Is this instance mutable -->
</MVPreferenceInstance>
<EndMVPreferenceInstance/>
* 
示例文件位于系统中的以下位置:。\IX_LOAD\prog_examples\Mappings\src\mappings-instances.xml
您还可以使用映射转换器实用程序为首选项实例创建 XML 文件,这些首选项实例可以通过以下命令使用首选项定义部分中所述的相同 CSV 文件导入:windchill wt.ixb.publicforapps.extendedmapping.tools.MetadataMappingConverter -csvtoxml "e:\ptc\mapping-test\mappings.csv" null mappings-instances
mappings-instances 是可以导入以填充多值首选项实例的 xml 文件的名称。
这是将首选项实例导入系统的命令:windchill wt.preference.ImportPreferences -importfile=e:\ptc\mapping-test\mappings-instances.xml -overwriteValueConflicts -user=wcadmin -password=wcadmin -importSiteLevel -applyToSiteLevel
这对您有帮助吗?