In reply to ssureshg_:
Thanks for the detailed proposal. While this does work, there is an important limitation. That is controlling this txn from a sequence. I need to be able to send a txn with a specific list of car brands and potentially specific values of each brand’s fields. The code in post_randomize breaks this. You also can’t move it to pre-randomize.
One more thing, if I understand your code correctly, all the toyotas in mycars_arr will be pointing to the same object (the last one that was created and randomized). I think you need to clone instead of assign
TOYOTA : begin toyota_ = toyota::new(); toyota_.randomize(); $cast(mycars_arr[i], toyota_.clone()); end
Any ideas to control the txn from the sequence?
-Bahaa