与其他应用程序集成 > Windchill Workgroup Manager 文档 > SolidWorks > 管理和配置 > 使用 SolidWorks 配置业务实践 > 配置属性 > 编辑委派
  
编辑委派
Windchill 提供了服务器端委派,可用于下载后将参数插入到 SOLIDWORKS 部件中。可利用该机制将信息从服务器传递到 SOLIDWORKS,其中该机制的用法与所有其他 SOLIDWORKS 参数类似 (例如,将信息置于绘图表单上)。以 PTC 或 PROI 开始的参数视为保留的系统参数,不能通过自定义进行传播。如果在自定义中添加这些参数,下载服务会将其忽略。
* 
在下载时给客户端提供自定义参数,且执行 Windchill 操作 (例如,检入) 后,不在 CAD 应用程序会话中更新这些参数。例如,如果给某个自定义参数分配了 CAD 文档编号的值,其值会在下载时提供给客户端。如果后来对 CAD 文档进行了重编号,则 SOLIDWORKS 会话或客户端缓存中的值不会自动更新。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
{
// getAvailableAttributes() returns
// HashMap<String, Object> which contains
// HashMap<Attribute name, Attribute type>
HashMap getAvailableAttributes();

// getModeledAttributes(Collection docs) returns
// HashMap<input object, HashMap<Attribute name,
Attribute value>>
HashMap getModeledAttributes(Collection docs)
throws WTException;
}
请参见实现的示例,位于:
<Windchill home>/codebase/com/ptc/windchill/uwgm/proesrv/c11n/
DefaultModeledAttributesDelegate.java
2. 编辑 site.xconf 文件 (可见于 <Windchill>) 来添加下列特性,以指明服务器上自定义服务的可用性:
<Service context="default"
name="com.ptc.windchill.uwgm.proesrv.c11n.ModeledAttributesDelegate"
targetFile="codebase/service.properties">
<Option cardinality="singleton"
requestor="java.lang.Object"
serviceClass="com.ptc.windchill.uwgm.proesrv.c11n.DefaultModeled
AttributesDelegate"/>
</Service>
使用类路径代替 serviceClass 的值 (即,使用该类的路径替换
com.ptc.windchill.uwgm.proesrv.c11n.Default
ModeledAttributesDelegate
)
3. 然后使用 xconfmanager 工具,将这些更改应用于 service.properties 文件。
Runxconfmanager -p
4. 重新启动 Windchill。