Populating Multi-Value Preference Instances
For every Preference Definition you have created, you would populate multi value preference instances that defines the mapping. These instances are in the form of a key and value pair and are as well associated to the Preference Client implying that you can have multiple instances (mapping) for multiple source systems. The key can optionally include conditions along with the value(s) to be mapped. The conditions and values can support regular expressions. In case of RegEx support for the values, you can control if the resulting value should replace the matching patterns or fully replace the whole string.
<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/>
* 
A sample file resides in the system at the following location: ..\IX_LOAD\prog_examples\Mappings\src\mappings-instances.xml
You can also use the mapping converter utility to create the XML file for the preference instances that can be imported by using the same CSV file as described in the Preference Definition section through the following command: windchill wt.ixb.publicforapps.extendedmapping.tools.MetadataMappingConverter -csvtoxml "e:\ptc\mapping-test\mappings.csv" null mappings-instances
mappings-instances is the name of xml file that can be imported to populate multi-value preference instances.
Here is the command to import preference instances into the system: windchill wt.preference.ImportPreferences -importfile=e:\ptc\mapping-test\mappings-instances.xml -overwriteValueConflicts -user=wcadmin -password=wcadmin -importSiteLevel -applyToSiteLevel
도움이 되셨나요?