Reloading a document while being changed by an agent running in the background

混江龙づ霸主 提交于 2019-12-13 21:30:08

问题


A Lotus script calls a Java agent and passes parameters to it in an In-Memory-Document. The agent performs some computations and reports its progress in a property of the shared document. A Timer on the form periodically checks the value representing the progress in the document and updates the UI accordingly.

The agent, having accomplished some progress, says:

doc.replaceItemValue("Percent", String.valueOf(percent));           
doc.save(true, false);

The timer on the forms loads the document periodically and tries to read the value like this:

Set doc = db.GetDocumentByID(parDocId)
percent = doc.getItemValue("Percent")(0)
Call    uidoc.FieldSetText("Percent", percent)

The problem is that the changes done by the agent are not read by the timer until the agent is completely done with the processing. So the GUI is not updated until the 100% finally appears.

I am wondering whether there is a better way to do this.

I tried to let those components communicate through environment variables, but those are restricted operations which I would prefer not to use.

来源:https://stackoverflow.com/questions/24733460/reloading-a-document-while-being-changed-by-an-agent-running-in-the-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!