Hello,
I’m working with a QAction in DataMiner where I call an Automation Script using ExecuteScriptMessage
.
The script runs fine, and I'm using engine.AddScriptOutput(...)
to define specific return values.
____________________________________________________________
Here's how I call the script in my QAction:
var response = protocol.ExecuteScript(message);
string fullMessage = response.ScriptOutput["1"];
string startInfo = response.ScriptOutput["StartTaskUpdated"];
____________________________________________________________
Here's what I do inside the Automation Script:
engine.AddScriptOutput("1", "Example1");
engine.AddScriptOutput("StartTaskUpdated", "Example2");
____________________________________________________________
Even though the script executes successfully, all keys in response.ScriptOutput
are either null or "(not set)" in my QAction.
What could be causing this?
Is there a requirement that prevents ScriptOutput
from populating correctly? Am I not referencing the content properly?
Some documentation or a code snippet would help me a lot!
Best Regards,
Hi David,
Did you set the script options? If not, we likely do not wait for the script to complete before accessing the output. To avoid this, I believe you need to set the option "DEFER:False".
Class ExecuteScriptMessage | DataMiner Docs
Hope this helps!

Thank you, Flavio.
That makes sense.
I was looking at the wrong end. Everything works as expected.
Best regards,