高度なカスタマイズ > ビジネスロジックのカスタマイズ > Windchill で標準を使用したデータ交換 > EXPRESS を使用した STEP データ交換 > STEP Foundation > メタデータマッピングの設定 > 複数値プリファレンスインスタンスの設定
  
複数値プリファレンスインスタンスの設定
作成したプリファレンス定義ごとに、マッピングを定義する複数値プリファレンスインスタンスを設定します。これらのインスタンスのフォームはキーと値のペアであり、これらのインスタンスはプリファレンスクライアントに関連付けられています。これは、複数のソースシステムに対して複数のインスタンス (マッピング) を設定できることを意味します。キーには、必要に応じて、マッピングされる値とともに条件を含めることができます。条件と値は、正規表現に対応できます。値が 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
プリファレンス定義のセクションで説明されているように、マッピングコンバータユーティリティを使用して、同じ CSV ファイルを使用することによってインポートできるプリファレンスインスタンスの XML ファイルを作成することもできます。これを行うには、次のコマンドを使用します。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