08-18-2022 09:37 AM
Following the DotNet XML translator example, we are programmatically creating new Steps in a Sequence using the API. We are inserting SequenceCall StepTypes. We are calling pre-defined Sequences which have Parameters defined that must be passed to the pre-defined Sequences.
When we create our new Step to call the pre-defined Sequence, how do we set the Arguments which get passed to the pre-defined Sequence?
This is what we have so far:
Step newStep = engine.NewStep(AdapterKeyNames.SequenceAdapterKeyName, StepTypes.StepType_SequenceCall);
newStep.Name = "NewStep";
// this is where we need to set the step arguments...
sequence.InsertStep(newStep, sequence.GetNumSteps(stepGroupMain), stepGroupMain);
Thanks for any help in advance.
08-19-2022 11:27 AM
If you are dynamically generating the sequence files based on an XML file it is probably best to already have a sequence file with examples of the steps you will be creating. Then copy them over and map the XML information correctly. That is much easier than trying to create them from scratch like you are doing. Mostly because the proper subproperties already exist and you are just setting values at that point. Another advantage to doing it this way is that the prototypes will be set up properly.
However, if you are set on creating the step/s from scratch then you'll have to dynamically add the parameters into the step and then set the values. The parameter values are stored here: Step.TS.SData.ActualArgs.
I've attached a simple sequence file that demonstrates how to add a step via the API. Look in the InsertCall sequence. In fact you should be able to run just it and it will inject a step in the MainSequence.
Let me know if you have any questions,