高度なカスタマイズ > ビジネスロジックのカスタマイズ > PDM のカスタマイズ > ダウンロードサービスでのパラメータのカスタマイズ
  
ダウンロードサービスでのパラメータのカスタマイズ
ダウンロード時に、Windchill から提供されるサーバー側代理を使用して Creo Parametric モデルにパラメータを挿入できます。このメカニズムを利用して、サーバーから Creo Parametric に情報を渡し、その情報をほかの Creo Parametric パラメータと同じように使用できます (たとえば、図面フォームに情報を配置する場合など)。"PTC" または "PROI" で始まるパラメータは、予約済みのシステムパラメータと見なされ、カスタマイズによって適用することはできません。カスタマイズでこれらのパラメータを追加しても、ダウンロードサービスで無視されます。
* 
この機能はサードパーティの CAD ツールに統合されたすべての Windchill Workgroup Manager に適用可能です。
* 
カスタマイズされたパラメータは、ダウンロード時にクライアントに提供されます。これに対し、PTC_WM_ITERATION などのシステムパラメータは、Creo Parametric セッションでも Windchill 操作 (チェックインなど) 後のローカルキャッシュでも更新されません。
たとえば、カスタマイズされたパラメータに CAD ドキュメント番号の値が割り当てられている場合、その値はモデルのダウンロード時にクライアントに提供されます。後から CAD ドキュメント番号が変更されても、Creo Parametric セッションまたはクライアントキャッシュ内の値は自動的に更新されません。
カスタマイズを可能にするのは、Windchill のサービス代理メカニズムです。以下の手順でカスタマイズプロセスを説明します。
1. インタフェース ModeledAttributesDelegate を実装する Java クラスを作成します。このインタフェースの定義は以下のとおりです。
package com.ptc.windchill.uwgm.proesrv.c11n;
import java.util.Collection;
import java.util.HashMap;
import wt.util.WTException;
public interface ModeledAttributesDelegate
{
/*
Implement this API to return list of parameters added by
customization along with it's type (customization profile of the
server). For example "WT_CADDOC_NUMBER" custom parameter will
be of type "String.class" (the java class)
*/
// getAvailableAttributes() returns
// HashMap<String, Object> which contains
// HashMap<Attribute name, Attribute type>
HashMap getAvailableAttributes();
/*
This is the API, invoked by the download service on download, to
be implemented for the customization. Create and return a
HashMap where key is input object and value is HashMap of
parameter name - value pairs that must be propagated to Pro/E
part represented by the EPMDocument (input object). Use the
getCADName() API on the EPMDocument to identify the Pro/E part
*/
// getModeledAttributes(Collection docs) returns
// HashMap<input object, HashMap<Attribute name, Attribute
value> HashMap getModeledAttributes(Collection docs) throws
WTException;
}
2. <Windchill> にある site.xconf ファイルを編集して、サーバー上のカスタマイズサービスの使用可能性を示す次のプロパティを追加します。
<Service context="default"
name="com.ptc.windchill.uwgm.proesrv.c11n.ModeledAttributesDele
gate" targetFile=codebase/service.properties">
<Option cardinality="singleton"
requestor="java.lang.Object"
serviceClass="com.ptc.windchill.uwgm.proesrv.c11n.DefaultModele
dAttributesDelegate"/>
</Service>
その後、xconfmanager ツールを使用して変更を service.properties ファイル (run xconfmanager -p) に適用します。
serviceClass の値の代わりにクラスのパスを使用します (com.ptc.windchill.uwgm.proesrv.c11n.DefaultModeledAttributesDelegate をクラスへのパスで置き換えます)。
3. メソッドサーバーを再起動します。