10-11-2013 11:55 AM
I can determine if a sequence has failed (RunState.SequenceFailed), Errored (RunState.SequenceError.Occurred), and it is set to go to Cleanup (RunState.GotoCleanup), but I'm not sure how to determine if the sequence is terminating. Is there a boolean or another way to determine this?
Purpose: I believe the MainSequence Cleanup still runs even if a sequence is terminating. I'd like to have a step in the cleanup that operates only during a termination (must be within "MainSequence"). Can this be done?
Thanks!
Solved! Go to Solution.
10-11-2013 03:19 PM
Look into Execution.GetStates().
10-14-2013 09:10 AM - edited 10-14-2013 09:17 AM
I may have been able to get Execution.GetStates() to work, however after looking at the Exection methods I found an alternative. I was looking to use this as a precondition, so I'm not sure how to use GetStates() within the precondition (since it returns the state to another variable) without calling this in another statement prior to the one I'm interested in. I'm gussing there is a way (maybe I'm overthinking that), but the following worked for me:
Solution:
RunState.Execution.GetTerminationMonitorStatus(Locals.TerminationMonitor)
where Locals.TerminationMonitor is an Object Reference variable initialized to RunState.Execution.InitTerminationMonitor() earlier in the test (I did this in the MainSequence Setup steps).
Thanks again!
10-14-2013 10:34 AM
10-14-2013 10:37 AM
The result of a compound expression is the value of the last expression so the following should work:
RunState.Execution.GetStates(Locals.runState, Locals.termState), (Locals.termState == ExecTermState_Terminating || Locals.termState == ExecTermState_TerminatingInteractive)