我将参数从 Lotus Script 传递给 Java 代理,如下所示:
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 说出以下内容:
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();
代理正在正确地履行其职责。我检查了参数文档,它确实包含代理的结果。但是,我的表单无法读取结果参数。
最佳答案
您必须在 Java 代码中保存文档,并在调用代理后在 LotusScript 中重新读取您的文档。
使用更方便an In-Memory Document不过:
莲花脚本
MyAgent.RunWithDocumentContext(doc, doc.NoteID)
Java
Document doc = agentContext.getDocumentContext()
关于lotus-notes - 检索 Java 代理对文档所做的更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24658499/