I'd like to change step runmode (to skip) in the code module call by this step.
I tried function SetRunModeEx with no error. But when I read runmode in post step callback, the runmode is "normal"
And in report, the status is "passed"
does it be possible?
Thanks for your help
Solved! Go to Solution.
Can you post a code snippet? I have used SetRunModeEx successfully.
The code snippet below works for me. Hopefully, you're getting the step reference correctly elsewhere in your code. I have also found that wiring the Execution reference to the executionParam input fixed a bug related to multithreading.
Of course, you can use a boolean as a precondition. That would be much more straightforward. I use setrunmodeex because I give my users the option to skip a number of steps.
I made a mistake, it's working now.
I'd like to get run mode with C++ code but I don't know how.
step->GetRunModeEx needs a t_variant_t for executionParam
I Tried this :
step->GetRunModeEx(_variant_t(seqContext->Execution)) == _bstr_t("Skip")
but I get a runtime error.
Do you have an idea please?
I haven't tried this with C++ code before, but your code looks reasonable to me. I would doublecheck how you're getting step. Also, the executionParam parameter is optional; maybe you could try the code without that.
Step object is ok.
The issue is on context argument which should be a variant. If i dont specify argument, the fonction returns "normal"
That makes sense since I'm guessing in your sequence, it's set to Normal, but you're trying to see if the precondition is normal or skipped during run time. Unless you're somehow getting Execution incorrectly, your code looks like it should work.
Can you check getting Execution by checking something like ThisContext.Execution.GetSequenceFile().Path? (That's (pseudo) TestStand code.) If that works, I'm not sure what else to suggest.
I managed to fix the issue with this modification :
step->GetRunModeEx(_variant_t(seqContext->Execution, false)) == _bstr_t(L"Skip")
It's working now, thanks