In DI Studio we have nice tool for different kind of iterations in a job: Loop transformation.
You can put some process steps in a loop, or you can drop a job into a loop. If you drop a job, you may define also job parameters which are delivered from the main job to the sub job via loop transformation logic. The details to do this kind of implementation can be found from the DI Studio documentation. But how to make testing of this kind of sub job as easy as possible? You would like to test the sub job independently at modular level without any main job. And when the main job is missing, there are not any call parameters coming in.
Those parameters are macro variable values, so the easiest way is to add some code to initialize the macro variable values. But that code should be in use only in module testing and excluded from the run in all the other cases. The best way is to put one User Written Code Step into the job. Please find below some screenshots of Santa’s Sample to jobs.
Main Job
Parameters defined in the Parameters Tab of the Sub Job
Testing with parameters without main job
Test Parameters Step is in use only when testing the sub job without any main job. It has only the macro variable initialization commands.
Test Parameters Step should be excluded from run when testing the main job or when promoting to production.