I have a script on an EAM Controller that triggers a "Collect Backup" agent task using system.eam.runTask()
and I want to wait until that task completes before executing the next part of the script. Is there any way to do this? I have tried system.eam.queryAgentHistory()
with no arguments (default) and it returns None
so it is not helpful.
Maybe you want to use system.eam.queryAgentStatus | Ignition User Manual instead of queryAgentHistory?
Also, it looks like from the manual system.eam.runTask | Ignition User Manual returns a UIResponse you might be able to inspect for information.
That is a good thought but unfortunately the UIResponse from runTask does not give me any information in the warnings, errors, or info lists when the task successfully completes.
system.eam.queryAgentStatus()
does provide the dataset output that its documentation promises but none of those fields are relevant to the agent's tasks completion. They mostly give general information regarding the general status of the agent gateway.
There's no (supported) way to get live status of a running task, unfortunately. It would theoretically be possible to do something with the backend by going into unsupported SDK only methods to retrieve task status, but you'll be off in the weeds and I can pretty much guarantee anything you write will be broken in 8.3, so it may not be worth the effort.
Thank you, that is helpful to know. I was originally hoping for some java functions easily accessible via Jython but I don't think I'm willing to dive into the SDK for this, especially when it will break upon upgrading to 8.3.
For now, I will either make this backup step a manual part of the process or create a process that waits until a new file is added before continuing.