Execution.GetTerminationMonitorStatus
- Mise à jour2025-07-21
- Temps de lecture : 2 minute(s)
Execution.GetTerminationMonitorStatus
Syntax
Execution.GetTerminationMonitorStatus( terminationMonitorData, [sequenceContextParam])
Return Value
Returns True if the execution is terminating or aborting.
Purpose
Monitors an execution so the calling code can abort what it is doing and exit if the user requests that the execution terminate or abort.
Remarks
Use this method with the Execution.InitTerminationMonitor method to monitor the state of the execution when performing a task inside of a step that takes a long time or requires user input to continue, such as launching a dialog box. When performing such a task, first call the Execution.InitTerminationMonitor method and hold on to the PropertyObject it returns. Then, while performing the task or inside of the message processing loop, periodically call this method and pass the PropertyObject you got from the Execution.InitTerminationMonitor method. If the method returns True , the execution is terminating and you should abort the task you are performing.
This method calls the Execution.GetStates method to update the state information it stores in terminationMonitorData. The Execution.GetTerminationMonitorStatus method uses the state information to determine whether to exit an execution under various conditions, such as when a Cleanup step launches a dialog box while the sequence is already terminating.
Use the Execution.InitTerminationMonitor and Execution.GetTerminationMonitorStatus methods to monitor whether the execution receives a request to terminate or abort the execution. The monitor only recognizes requests to terminate or abort while monitoring, so a code module that executes in a Cleanup step group of an already terminating execution monitors for a subsequent request to terminate the step or abort the execution. Use the Execution.GetStates method to determine the execution state of the code module.
Parameters
terminationMonitorData As PropertyObject
[In] Specifies a property object you obtain by calling the Execution.InitTerminationMonitor method. The data this property object contains is not meant to be accessed directly.
sequenceContextParam As Variant
[In] [ Optional ] If you are monitoring an execution from a step that is running as part of the execution so you can abort the step when the execution terminates or aborts, pass the SequenceContext object of the step. If you are monitoring an execution from a step in a different execution or from code that is not part of a step, leave this parameter unspecified. When you specify this parameter, TestStand uses other information about the execution of the step that is monitoring the execution to determine whether to abort.