07-20-2012 11:45 AM
I think you are making a mistake going this route. You should really use the SequenceFilePostStepFailure callback. Your very case is the reason this callback is there. You have the Step and Results passed in as parameters and you can write code to filter for certain steps. Also, your code will be much more scalable by doing this.
Just my 2 cents but hey- it sounds like you have it working so good luck.
07-23-2012 11:46 AM
Thanks jigg. Not being that profience in Teststand I hate over riding the callbacks. I never know what else it'll affect. If I do implement your suggest won't the popup occur every time a step fails because its in SequenceFilePostStepFailure callback? I'll get the popup even if its another step where I DON'T want the popup...if the step fails
07-23-2012 12:35 PM
In the SequenceFilePostStepFailure you could precondition the popup step and put the names of the steps that will trigger it. Then later you just simply add new step names. So basically in the message popup step in the callback I would put in the precondition:
AnyOf(Parameters.Step.Name == "Foo",
Parameters.Step.Name == "Bar")
So using the callback method you will see the popup immediately after the step that failed.
In your case where you want both steps to execute and then do the popup you wouldn't want to use the callback. You would just do it like you have with 3 steps but precondition Step 3 to use the results from Steps 1 and 2. So something like this:
AnyOf(RunState.Sequence.Main["Step 1"].Result.Status == "Failed",
RunState.Sequence.Main["Step 2"].Result.Status == "Failed")
Regarding your comment about when to use callbacks. It is hard at first but after a while you get a feel for it. In general it is OK to override any callbacks available. That is why they are there. I answer these questions before I override a callback:
What is the default behavior? How will overriding affect it?
Who is calling it and when does it get called?
What are the parameters? This generally gives a clear indication of what it was intended for.
If it's a model callback then I read the comments for the sequence.
If it's an engine callback I look in the TestStand reference manual.
Hope this helps,