Oracle Workflow API:添加和访问人工任务的文件附件
我正在使用 SOA Suite 的工作流服务 Java API (11.1.1) 来访问和操作人工任务。我希望能够访问文件附件并将其添加到现有人工任务中。我正在使用 AttachmentType 接口中提供的方法。
添加附件时,我遇到的问题是附件确实被创建并与任务关联,但它是空的并且没有内容。我尝试设置附件的输入流以及内容字符串,但在每种情况下都没有成功(并且在尝试更新相应任务时设置内容字符串会导致异常)。
我已使用工作列表应用程序成功添加并访问了附件,但是当尝试通过代码访问此附件的内容时,我收到的对象除了附件名称外,大部分都为 null/0 值。
我用来访问附件的代码类似于:
List attachments = taskWithAttachments.getAttachment();
for(Object o : attachments){
AttachmentType a = (AttachmentType) o;
String content = a.getContent(); // NULL
InputStream str = a.getInputStream(); // NULL
String name = a.getName(); // Has the attachment name
String mime = a.getMimeType(); // Has the mime type
long size = a.getSize(); // 0
...
}
由于 API 的文档并不太丰富,我很可能错误地使用了它们。我非常感谢在处理 BPEL 任务附件时提供的任何帮助/建议/替代方案。
谢谢
I am using the Workflow Services Java API (11.1.1) for SOA Suite to access and manipulate human tasks. I would like to be able to access and add file attachments to existing human tasks. I am using the methods provided in the AttachmentType interface.
When adding an attachment, the problem I am running into is that an attachment does get created and associated with the task, however it is empty and has no content. I have attempted both setting the input stream of the attachment, as well as the content string and in each case have had no success (and setting the content string results in an exception when trying to update the corresponding task).
I have successfully added and accessed an attachment using the worklist application, however when trying to access the content of this attachment through code I receive an object with mostly null/0 values throughout, apart from the attachment name.
The code I am using to access attachments resembles:
List attachments = taskWithAttachments.getAttachment();
for(Object o : attachments){
AttachmentType a = (AttachmentType) o;
String content = a.getContent(); // NULL
InputStream str = a.getInputStream(); // NULL
String name = a.getName(); // Has the attachment name
String mime = a.getMimeType(); // Has the mime type
long size = a.getSize(); // 0
...
}
As the API's are not overly rich in documentation I may well be using them incorrectly. I would really appreciate any help/suggestions/alternatives in dealing with BPEL task attachments.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在联系 Oracle 寻求支持后,发现工作流 API 的附件部分在当前版本中已损坏。该修复将包含在未来的版本中。
After contacting Oracle for support, it turns out that the attachments portion of the Workflow API is broken in the current release. The fix will be included in a future release.