简体   繁体   English

实例化被调用类中的AppModule时,Oracle BPM人工任务注释回调错误

[英]Oracle BPM Human Task Comments Callback Errors When Instantiating AppModule in Called Class

Oracle BPM Version 11.1.1.7. Oracle BPM版本11.1.1.7。 In a Humantask.task, Events tab, Content Change Callbacks section, I have entered the fully qualified class name of a class that implements NotesStore and the addNote and getNotes methods. 在Humantask.task的“事件”选项卡的“内容更改回调”部分中,我输入了实现NotesStore以及addNote和getNotes方法的类的完全限定类名。

The class uses public methods in an AppModule to write and read comments using our custom table and these methods were well tested during development using the the BC tester and a temporary main in the callback class. 该类在AppModule中使用公共方法来使用我们的自定义表编写和读取注释,并且在开发过程中使用BC测试器和回调类中的临时main对这些方法进行了良好的测试。

The project is compiled to a jar and placed in the BPM project's SCA-INF/lib folder, then the SCA and related ADF human task forms are deployed. 将项目编译到jar中,并将其放置在BPM项目的SCA-INF / lib文件夹中,然后部署SCA和相关的ADF人工任务表格。

When a comment is made in the out of box human task comments section during a process instance, the class is called, but an exception occurs in the getNotes method at the line the AppModule is created: 在流程实例期间在开箱即用的人工任务注释部分中进行注释时,将调用该类,但在创建AppModule的行的getNotes方法中会发生异常:

java.lang.ClassCastException: oracle.jbo.common.ampool.PoolMgr java.lang.ClassCastException:oracle.jbo.common.ampool.PoolMgr

In the class, the AppModule is created as so: 在类中,AppModule的创建方式如下:

AuditModule service = (AuditModule)Configuration.createRootApplicationModule("com.co.modules.AuditModule", "AuditModuleLocal");

I've tried adding a web.xml config file to the SCA BPM project with a filter as discussed in this post (last answer). 我已经尝试使用本文中讨论的过滤器将web.xml配置文件添加到SCA BPM项目 (最后一个答案)。 This discusses triggering the ADF Context initialization, but I'm still getting the error. 本文讨论了如何触发ADF上下文初始化,但仍然出现错误。

The question is, how can I use a call back from a human task to call a method that uses AppModule public methods to do the DB work? 问题是,如何使用人工任务的回调来调用使用AppModule公共方法来完成数据库工作的方法? Oracle's documentation is very sparse in this area (29.11.1). Oracle的文档在这方面非常稀疏(29.11.1)。

UPDATE 更新

Turns out that the stack trace shows that it is having problems looking up the data source name and is actually throwing a JBO error. 事实证明,堆栈跟踪表明它在查找数据源名称时遇到问题,并且实际上引发了JBO错误。 If anyone runs in to this, check the stack trace for other issues. 如果有人遇到此问题,请检查堆栈跟踪是否有其他问题。

UPDATE2 更新2

Finally got this to write task comments into the custom comments table. 最后,将任务注释写入自定义注释表中。 It turns out it doesn't seem possible to use an AppModule/Model approach in a comments callback class as there appears no way to initiate the needed ADF context when the class is called. 事实证明,在注释回调类中似乎无法使用AppModule / Model方法,因为在调用该类时似乎无法启动所需的ADF上下文。 By rewriting the class to access the DB directly in code the comment callback class does write the table. 通过重写该类以直接在代码中访问DB,注释回调类确实写入了表。 But, I am getting the same error as this post . 但是,我收到了与此帖子相同的错误。 Namely: 即:

Exception invoking method from XML data control. Cause:oracle.bpel.services.workflow.client.WorkflowServiceClientException: java.rmi.UnmarshalException: cannot unmarshaling return; nested exception is: 
Supplemental Detail java.io.IOException: Error: Unexpected type encountered in writeExternal oracle.bpel.services.workflow.client.WorkflowServiceClientException: java.rmi.UnmarshalException: cannot unmarshaling return; nested exception is: 
java.io.IOException: Error: Unexpected type encountered in writeExternal

I suspect this is an Oracle framework issue as the types that are passed back are from the NotesStore implementation which are all passed back to the framework: 我怀疑这是一个Oracle框架问题,因为传递回的类型来自NotesStore实现,这些类型都传递回了框架:

public class CommentsCallback implements NotesStore, Serializable...

    public List<CommentType> getNotes(Task task)

Has anyone solved this? 有人解决了吗? Full stacktrace at: 完整的堆栈跟踪位于:

https://community.oracle.com/thread/3638940 https://community.oracle.com/thread/3638940

After discussion with Oracle, the key to avoiding the unexpected type error is to use an ObjectFactory to populate the CommentType object. 与Oracle讨论之后,避免意外的类型错误的关键是使用ObjectFactory填充CommentType对象。 While we took a different approach ultimately, the below code was provided by Oracle as an example and might help someone trying to do this: 尽管我们最终采用了不同的方法,但是下面的代码是Oracle提供的示例,可能会帮助尝试这样做的人:

import oracle.bpel.services.workflow.task.model.ObjectFactory; 
import oracle.bpel.services.workflow.task.model.CommentType; 
import oracle.bpel.services.workflow.task.model.IdentityType; 

...

ObjectFactory factory = new ObjectFactory() 

CommentType commentType = factory.createCommentType(); 

IdentityType updatedBy = factory.createIdentityType(); 
updatedBy.setId("some user"); 
updatedBy.setType(IWorkflowConstants.IDENTITY_TYPE_USER); 
updatedBy.setDisplayName("some user display name"); 

commentType.setUpdatedBy(updatedBy); 
commentType.setComment("some comment"); 

...set the rest of the comment fields as necessary... 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM