Tracking the progress of automation scripts
When you start an automation script via SLNet, you can add the PROGRESS option to the ExecuteScriptMessage to receive ScriptProgressEventMessage notifications about that script. This is especially useful when you run a script asynchronously using the DEFER:TRUE option, as it allows the client to track when the script starts and finishes.
Note
From DataMiner 10.7.1/10.8.0 onwards, the PROGRESS option is supported for both interactive and non-interactive scripts. In earlier versions, progress notifications are only available for interactive scripts.
Tracking a script
Subscribe to
ScriptProgressEventMessageevents before sending theExecuteScriptMessage.Send the
ExecuteScriptMessagewith thePROGRESSoption, and keep theScriptIDfrom theExecuteScriptResponseMessage.Use the script ID and the DataMiner ID to identify the events that belong to this script execution.
var executeMessage = new ExecuteScriptMessage("MyScript")
{
DataMinerID = dmaId,
Options = new SA(new[] { "DEFER:TRUE", "PROGRESS" })
};
var response = (ExecuteScriptResponseMessage)connection.HandleSingleResponseMessage(executeMessage);
var scriptId = response.ScriptID;
Notifications
For scripts executed with the PROGRESS option, a ScriptProgressEventMessage can indicate the following:
| Notification | Description |
|---|---|
| Started | The script has started executing. |
| Completed | The script has finished executing. The notification includes the execution result. |
| RunStatus or DelayInfo | Additional execution status information, for example when the script is waiting for locked resources or when an error occurs. |
| Progress | Progress that is explicitly communicated by the script. |
For interactive scripts that are executed with the INTERACTIVE option, the client can additionally receive the following notifications:
| Notification | Description |
|---|---|
| InteractiveUI | The script is paused and requires input from the client. |
| Detached | The client has detached from the script. |
| Hidden | The client interface should be hidden. |