Excel to use hierarchical data with more than one level, how to use ParentIndex correctly

paolabspaolabs Posts: 14

I have been using this information to create my excel data source with hierarchical data:
https://docs.parasoft.com/display/SOAVIRT9104/Performing+Functional+Tests+Using+Data+Sources

In my service I have the following structure:

  <SetupProducts>
   <shortId></shortId>
   <products>
    <ProductDTO>
     <AssignedChannels>
      <ChannelAssignmentDTO>
       <ChannelId></ChannelId>
      </ChannelAssignmentDTO>
     </AssignedChannels>
     <RateCode></RateCode>
    </ProductDTO>
   </products>
  </SetupProducts>

Having the correct structure was doing weird things, so I took the example exactly and tried to make sense of it. Running this, I would expect to have Grandpa as the shortid, daddy as the rate code, and then have two ChannelAssignmentDTO, where channel ids will be FirstSon and SecondSon. Instead this was what it generated for me, which is mostly ok except that Second son is missing.

  <SetupProducts>
   <shortId>Grandpa</shortId>
   <products>
    <ProductDTO>
     <AssignedChannels>
      <ChannelAssignmentDTO>
       <ChannelId>FirstSon</ChannelId>
      </ChannelAssignmentDTO>
     </AssignedChannels>
     <RateCode>Daddy</RateCode>
    </ProductDTO>
   </products>
  </SetupProducts>

And the Grandma case is even worse:

  <SetupProducts>
   <shortId>Grandma</shortId>
   <products>
    <ProductDTO>
     <AssignedChannels>
      <ChannelAssignmentDTO>
       <ChannelId>FirstDaughter</ChannelId>
      </ChannelAssignmentDTO>
      <ChannelAssignmentDTO>
       <ChannelId/>
      </ChannelAssignmentDTO>
      <ChannelAssignmentDTO>
       <ChannelId>FirstCousin</ChannelId>
      </ChannelAssignmentDTO>
     </AssignedChannels>
     <RateCode>Mommy</RateCode>
    </ProductDTO>
    <ProductDTO>
     <AssignedChannels>
      <ChannelAssignmentDTO>
       <ChannelId>FirstDaughter</ChannelId>
      </ChannelAssignmentDTO>
      <ChannelAssignmentDTO>
       <ChannelId>SecondDaughter</ChannelId>
      </ChannelAssignmentDTO>
     </AssignedChannels>
     <RateCode>First Aunt</RateCode>
    </ProductDTO>
    <ProductDTO>
     <AssignedChannels/>
     <RateCode>Second Aunt</RateCode>
    </ProductDTO>
   </products>
  </SetupProducts>

As you can see, the Mommy node has first daughter, empty and first cousin, so second daughter is missing; First aunt has data when it shouldn't have (wrong data at that) and Second aunt has nothing.

I think this is a matter of parent index in the third gen, it doesn't quite match properly. Anyone has seen something like this?

Tagged:

Comments

  • jakubiakjakubiak Posts: 334 ✭✭✭

    Hierarchical data in Excel can be difficult to set up. Data repository handles hierarchical data for payloads much more easily - I would consider using that instead.

Sign In or Register to comment.