检索Java代理对文档所做的更改 [英] Retrieving changes made by a Java Agent on a document

查看:39
本文介绍了检索Java代理对文档所做的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在像这样从Lotus Script将参数传递给Java代理:

I am passing parameters to a Java agent from Lotus Script like this:

Set db = session.CurrentDatabase    
Set doc = db.CreateDocument     
Set uiDoc = workspace.CurrentDocument

Call doc.AppendItemValue("fileName", "SomeString" )
Call doc.Save(True, False)

Set MyAgent = db.GetAgent("AgentName")
Call MyAgent.Run(doc.NoteID)    
Set session = New NotesSession
Set db = session.CurrentDatabase

result = doc.GetItemValue("Result")(0)

代理使用Java指出以下内容:

The agent says the following in Java:

Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Agent agent = agentContext.getCurrentAgent();
Database db = agentContext.getCurrentDatabase();
Document doc = db.getDocumentByID(agent.getParameterDocID());
String fileName = doc.getItemValueString("fileName");
doc.appendItemValue("Result","MyResult");
doc.save();

座席工作正常.我检查了参数文档,它确实包含来自代理程序的结果.但是,我的表单无法读取Result参数.

The agent is doing his job correctly. I checked the parameter document and it indeed contains the results from the agent. However, my form is not able to read the Result parameter.

推荐答案

您必须在Java代码中保存该文档,并在LotusScript中重新阅读您的文档打电话给您的经纪人之后.

You have to save the doc in your Java code and to re-read your doc in LotusScript after calling your agent.

使用内存中文档尽管:

LotusScript

LotusScript

MyAgent.RunWithDocumentContext(doc, doc.NoteID)

Java

Document doc = agentContext.getDocumentContext()

这篇关于检索Java代理对文档所做的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆