Creating complex test data using tRowGenerator, tFlowToIterate, tMap, and sequences
This recipe shows how a more complex set of test data can be created. In this example, we will build a set of CSV data ready to be loaded into a database which has the following structure:
- Customer has 1 or more orders
- Order has 1 or more order items
Getting ready
- Open the
jo_cook_ch10_0110_complexTestData
job. - You will see a section of code that has been deactivated. Do not activate this code until later in the exercise.
- Run the job, and you will see that the customer file is created.
How to do it...
The steps for creating complex test data using tRowGenerator, tFlowTolterate, tMap, and sequences are as follows:
- Activate components
tFixedFlowInput_2
,tMap_2
, andtFileOutputDelimited_2
. These are exact copies of the customer create components. - Change these newly activated components detailed as follows:
- Open
tFixedFlowInput_2
and change Number of rows toNumeric.random(1,5)
. - Open
tMap_2
. Change the name of the variable...
- Open