In this sample workflow script, an asynchronous task is initiated, then status is checked in a loop until error or completion.
On Error Resume Next
Dim sa
Set sa = CreateObject("SAClient.SAapi")
sa.Login "http://localhost:8080/qcbin", "henry", "tilney"
WScript.Echo("Connected")
'Start the asynchronous task
sa.Upgrade "DOMAIN_1", "PROJECT_1", ""
Do While True
WScript.Sleep 1000
' ReadMaintenanceTaskProgress returns current state of upgrade in XML
WScript.Echo(sa.ReadMaintenanceTaskProgress("DOMAIN_1", "PROJECT_1") )
' On Exception, display and exit.
' ReadMaintenanceTaskProgress throws exception on error
' and when Verify, Repair, Upgrade tasks are completed.
If Err.Number <> 0 Then
WScript.Echo Err.Description
Err.Clear
Exit Do
End If
Loop
sa.Logout
WScript.Echo("Disconnected")