【发布时间】:2016-06-24 11:37:46
【问题描述】:
在我当前使用 Filenet P8 Content Platform Engine 5.2.1 和 WebSphere 8.5.5.3、IBM RAD 9.5 和 Apache Maven 3.3.1 的项目中
我正在尝试部署链接到某个文档类的变更预处理器。 每次将文档添加到此类或子类时,我都希望 CP 更改一些属性。
我将动作处理程序的类作为代码模块上传,就像我通常为订阅所做的那样:
其中更新文档属性CP对象内容元素选项卡显示如下:
并且我已经在文档类 Change Preprocessor Definitions 选项卡中使用 ACCE 正确配置了预处理器定义:
该动作的 Javascript 实现有效
// Set NumeroContratto property to certain value when a new document is created.
importClass(Packages.com.filenet.api.action.Create);
function preprocessObjectChange (sourceObj)
{
// Verify that the pending action is a create action.
var actions = sourceObj.getPendingActions();
for ( var i = 0; i < actions.length; i++ )
{
if ( actions[i] instanceof Create )
{
// Set NumeroContratto property to "777"
sourceObj.getProperties().putValue("NumeroContratto", "777");
return true;
}
}
return false;
}
这是Java实现:
package com.finmeccanica.spc.ecm.filenet.cp.actionhandler;
import com.filenet.api.action.*;
import com.filenet.api.core.IndependentlyPersistableObject;
public class AddPropertiesToObjectCP implements
com.filenet.api.engine.ChangePreprocessor {
public boolean preprocessObjectChange(
IndependentlyPersistableObject sourceObj) {
try {
PendingAction actions[] = sourceObj.getPendingActions();
for (int i = 0; i < actions.length; i++) {
if (actions[i] instanceof Create) {
sourceObj.getProperties()
.putValue("NumeroContratto", "777");
return true;
}
}
return false;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
有什么问题?
我无法让预处理器在 Java 中实现它。尽管我用 Java 类处理程序的名称和代码模块标题填充字段
当我点击保存更改预处理器动作时,系统总是告诉我找不到类:
FNRAC1005E 'PDGOV CP Add PropertiesToDocument Action' 对象是 没有保存。
用户响应:刷新对象,重新输入您的更改,然后尝试 再次,或联系您的系统管理员。
异常详细信息:无法从任何一个加载事件处理程序类 关联的代码模块或系统类路径: com.finmeccanica.spc.ecm.filenet.cp.actionhandler.AddPropertiesToObjectCP。 消息是: com.finmeccanica.spc.ecm.filenet.cp.actionhandler.AddPropertiesToObjectCP
我上传的jar包含正确包中的类,并且代码模块的内容没有损坏。
我错过了什么吗?我必须配置其他东西吗?
【问题讨论】:
标签: java filenet-p8 filenet-content-engine