03-22-2010 12:49 AM
Hi Ppl,
I want to get the name of the execution entry point that is currently executing the client sequence. I'm currently using the property "RunState.Root.Sequence.Name" property to get this. I want to be sure that this property could be used in any point of the sequences, process model, report generation sequences etc.
Thanks,
Sathish
03-22-2010 03:23 AM
Sathish,
i haven't found a variable which simply tells you: This is the active Entry Point of the current execution.
But you can get to this from whatever sequence you are in by a recursive search in the call stack.
If you are in the MainSequence, the call stack will be part of the RunState. RunState.Caller gives you the possibility to dig down into the call stack.
So, now the only question: How do you know that you have reached the process model? Simple answer: The RunState of the process model does not contain a variable called "Caller". So do your search on "Does RunState.Caller exist?". If yes, go into the caller and repeat the search. If not, you are in the process model, to be exact: In the Execution Entry Point of the process model. Now you can simply read out the name of that sequence.
See attached example for a possible approach. Please note that i have not tested different names of the Execution Entry Point. So maybe localizing TestStand could result in inconsistent names here.....
hope this helps,
Norbert
PS: The sequence file attached is TS 4.2
03-22-2010 03:56 AM
Norbet,
I
Your solution works fine. I was wondering if was missing some obvious straight forward property. Hope I'm not missing any such property.
Thanks
03-22-2010 05:35 AM
Hi,
If the property RunState.ProcessModelClient exist, then this tells you that the top level sequence is running using the Process Model.
Regards
Ray
03-22-2010 05:47 AM
YEah,
But neither the execution nor the run state directly point to the entry point name. I have multiple entrypoints calling the same sequence. I want to skip certain steps in the sequence depending on the entry point thats calling the sequence.
Thanks
03-22-2010 05:50 AM
If you have multiple entry points, i assume that you changed the process model.
If you did, you can define a new parameter for MainSequence in which you pass the name of the entry point.....
Norbert
03-22-2010 06:27 AM
If you did NameOf(RunState.Caller) in your top level sequence this will return the name of the Entry Point Sequence Name. eg Test UUT's
If you wanted to check this at differring levels, then depending on the level (n) you would append n number of RunState before the Caller.
Regards
Ray Farmer