Dynamically adding table rows when publishing XML

book

Article ID: 142520

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

To produce the following XML where only one EmployerName tag row exists for each ‘Data Record’,

  • what is the TDM Publish - Table Count formula for ‘EmployerName’?
  • what is the TDM Data Painter formula for ‘EmployerNameText’?

 

<DataRecord>

     <DataRecord1>                                                                      

          <EmployeeNumber>123</EmployeeNumber>                                            

          <EmployerNumber>910</EmployerNumber>

          <EmployerName>

                 <EmployerNameText>Exxon</EmployerNameText>

          </EmployerName>  

     </DataRecord1>

     <DataRecord2>                                                                      

          <EmployeeNumber>456</EmployeeNumber>                                                           

          <EmployerNumber>750</EmployerNumber>

          <EmployerName>

                 <EmployerNameText>Chevron</EmployerNameText>

           </EmployerName>

     </DataRecord2>

</DataRecord> 

              

If the TDM Publish – Table Count formula for ‘EmployerName’ = 1, this is published XML (‘EmployerName’ tag is missing for Data Record2):

<DataRecord>

     <DataRecord1>                                                                      

          <EmployeeNumber>123</EmployeeNumber>                                            

          <EmployerNumber>910</EmployerNumber>

          <EmployerName>

                 <EmployerNameText>Exxon</EmployerNameText>

          </EmployerName> 

     </DataRecord1>

     <DataRecord2>                                                                      

          <EmployeeNumber>456</EmployeeNumber>                                                           

          <EmployerNumber>750</EmployerNumber>

     </DataRecord2>

</DataRecord> 

              

If the TDM Publish – Table Count formula for ‘Employer Name’ = 2, this is the published XML (‘EmployerName’ tag for Data Record2 is listed for DataRecord1 instead of DataRecord2):

<DataRecord>

     <DataRecord1>                                                                      

          <EmployeeNumber>123</EmployeeNumber>                                            

          <EmployerNumber>910</EmployerNumber>

          <EmployerName>

                 <EmployerNameText>Exxon</EmployerNameText>

          </EmployerName> 

          <EmployerName>

                 <EmployerNameText>Chevron</EmployerNameText>

           </EmployerName>

     </DataRecord1>

     <DataRecord2>                                                                      

          <EmployeeNumber>456</EmployeeNumber>                                                           

          <EmployerNumber>750</EmployerNumber>

     </DataRecord2>

</DataRecord> 

Environment

Release : 4.8

Component : CA Test Data Manager

Resolution

I found and fixed the issue by comparing the Generator with the hard coded table values, to the Generator with the dynamically added table values. I forgot to change the last field in the table from ^xxx.SHRED_ID(1)^ to ^xxx.SHRED_ID(~ROWNUM~)^.