我有一个标有“在后台客户端线程中运行”的Java代理。像这样的公式语句调用时,代理可以正常运行:
@Command([RunAgent]; "MyAgent")
遇到的问题是我无法传递文档ID来提交我的参数。
另外,我可以使用Lotus Script用所需的参数调用代理:
Call shAgent.Run(doc.NoteID)
或像这样:
Call MyAgent.RunWithDocumentContext(doc)
但是在这种情况下,代理不会在自己的线程中运行。我知道还存在其他方法。但是出于遗留原因,我宁愿使用代理。
有没有一种方法可以让代理从Lotus Script调用时在自己的线程中运行,或者在通过公式调用时不使用环境变量的情况下将参数传递给它?
您可以通过概要文件传递参数:
@SetProfileField("MyProfileDocument"; "MyField"; MyValue);
@Command([RunAgent]; "MyAgent")
要获得Java的价值,只需使用以下命令:
//Your code
Document profileDoc = session.getCurrentDatabase().getProfileDocument("MyProfileDocument", null);
Vector value = profileDoc.getItemValue("SomeField");
//Your code
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句