高级自定义 > 业务逻辑自定义 > 包自定义 > 标识上下文复制中的用户并激活副本化用户 > 方案二:如何在需要激活/转换为活动用户时标识复制用户
方案二:如何在需要激活/转换为活动用户时标识复制用户
下图描述了已配置的 PrincipalMatchDelegate 服务实现在确定如何找到要激活的复制用户方面的作用。
下图详细说明了已配置的 PrincipalMatchDelegate 在复制用户激活中的作用。
解决方案元素
这些元素可确定如何在需要激活/转换为活动用户时标识复制用户
* 
在以下内容中,selector 值是使用关系上下文的预确定的指定符,用于标识适用于特定使用关系的服务配置。不得修改 selector 的值 - 只能更改相应的 serviceClass
元素
类型
说明
ReplicatedUserForActivationByUserNameMatchDelegate
预设的委派 JAVA 类
位置:<Windchill>\codebase\wt\org\ReplicatedUserForActivationByUserNameMatchDelegate.class
此委派实现与选择器 "ReplicatedUserForActivation" 配合使用。这是默认情况下为此选择器配置的委派。
此委派仅用于查找创建用户期间匹配的复制项。其使用源用户的名称来查找可转换为活动用户的匹配的复制用户。
ReplicatedUserForActivationByEmailIdMatchDelegate
预设的委派 JAVA 类
位置:<Windchill>\codebase\wt\org\ReplicatedUserForActivationByEmailIdMatchDelegate
此委派实现与选择器 "ReplicatedUserForActivation" 配合使用。这不是默认情况下为此选择器配置的委派。
此委派仅用于查找创建用户期间匹配的复制用户。其使用源用户的电子邮件地址来查找可转换为活动用户的匹配的复制用户。
service.properties.xconf
服务委派配置文件
位置:<Windchill>\codebase\service.properties
以下服务配置元素用于确定要应用于选择器 ReplicatedUserForActivation 的 serviceClass。
<Service context="default" name="wt.org.delegate.PrincipalMatchDelegate">
<Option cardinality="singleton" requestor="wt.org.WTUser" selector="ReplicatedUserForActivation" serviceClass="wt.org.delegate.ReplicatedUserForActivationByUserNameMatchDelegate"/>
</Service>
PrincipalMatchDelegate
自定义者的委派 JAVA 接口
位置:<Windchill>\codebase\wt\org\PrincipalMatchDelegate.class
所有自定义委派实现都必须遵循此接口所建立的合约
过程
要更改行为,以便在用户激活期间使用用户的电子邮件地址来标识复制用户,请将与选择器 ReplicatedUserForActivation 关联的 serviceClass 更改为使用 ReplicatedUserForActivationByEmailIdMatchDelegate 实现:
<Service context="default" name="wt.org.delegate.PrincipalMatchDelegate">
<Option cardinality="singleton" requestor="wt.org.WTUser"
selector="ReplicatedUserForActivation"
serviceClass="wt.org.delegate.
ReplicatedUserForActivationByEmailIdMatchDelegate"/>
</Service>
要更改行为以使用基于用户其他属性的更多自定义逻辑,请参阅自定义点和限制
这对您有帮助吗?