PDM 操作的预操作自定义挂接
当前,只有检入、检出、重命名、修订和另存为操作才支持预操作挂接。不支持后操作挂接。预操作挂接在本质上只能处于否决状态;并且仅会添加不会修改可持续对象的工作流。唯一的检查是捕获处于否决状态的异常并中止事务处理。这有助于添加可从可持续对象中提取特性的工作流,并添加其他验证机制。
要实现自定义预操作挂接,必须执行以下步骤:
1. 实现 UWGMEventListener 接口
2. <Windchill>\codebase\com\ptc\windchill\uwgm\common\delegate\application.service.xconf 中注册实现的事件监听程序
UWGMEventListener
以下是自定义 EventHandler 代码需要实现的 UWGMEventListener API 的说明。
public interface UwgmEventListener
{
/**
* API to process UwgmEvent
* Custom UwgmEventService delegate should implement this API.
*
* @param iteration : Collection of request Iterations
* @param workspace : EPMWorkspace
* @return WTCollection : Response
* @throws WTException
*/

public WTCollection processUwgmEvent(C11nRequestContext
requestContext,WTCollection iteration,EPMWorkspace workspace)
throws WTException;

}
<Windchill>\codebase\com\ptc\windchill\uwgm\proesrv\c11n\UwgmC11nEventListenerTest.java 的 Windchill 安装中提供了 UWGMEventListener 的示例实现,仅供参考。您不应重用此类。您需要根据需要实现您自己的服务器端自定义。
注册自定义事件监听程序
必须在 <Windchill>\codebase\com\ptc\windchill\uwgm\common\delegate\application.service.xconf 文件中注册任何自定义监听程序 (UwgmEventListener) 处理程序。
以下是典型格式的示例:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Configuration SYSTEM "xconf.dtd">
<Configuration targetFile="codebase/service.properties">
<!-- UWGM Custom Services Implementation for Unit Test -->
<Service context="default"
name="com.ptc.windchill.uwgm.proesrv.c11n.UwgmEventListener">
<Option cardinality="duplicate"
requestor="java.lang.Object" selector="PRE_CHECKIN"
serviceClass="com.ptc.windchill.uwgm.proesrv.c11n.UwgmC11nEventListenerTest"/>
</Service>
</Configuration>
当前支持将以下选择器用于注册自定义事件监听程序:
PRE_CHECKIN
PRE_CHECKOUT
PRE_RENAME
PRE_SAVEAS
PRE_REVISE
必须使用 xconfmanager 实用程序将 application.service.xconf 文件中的更改传播到 service.properties 文件中。
这对您有帮助吗?