Linking steps

Linking steps in an export mapping file serves two purposes. You can make one step’s output element a child of another step’s, or you can drill down to related business objects.

For example, the address export mapping shown below defines a root <ADDRESS> element with two children: <Addr> and <Info>.

<DataExport Name="AddrExport" 
 RootElement="ADDRESS" 
 TargetBusinessObject="Hansen.Property.Address">
   <Steps>
      <Step Id="1" ElementName="Addr">
         <DataMappings>
            <DataMap Source="StreetNumber" Target="Number" />
            <DataMap Source="StreetName" Target="Street" />
            <DataMap Source="Suffix.Code" Target="Suffix" />
         </DataMappings>
      </Step>
      <Step Id="2" ElementName="Info">
         <DataMappings>
            <DataMap Source="Area.Code" Target="Area" />
            <DataMap Source="EffectiveDate" Target="Effective" />
         <DataMappings>
      </Step>
   </Steps>
</DataExport>

The output is shown below.

<ADDRESS>
   <Addr>
      <Number>11000</Number>
      <Street>Olson</Street>
      <Suffix>Dr</Suffix>
   </Addr>
   <Info>
      <Area>West</Area>
      <Effective>03/25/2011</Effective>
   </Info>
</ADDRESS>

To make the <Info> element a child of the <Addr> element, you can add a <Link> element to step 2, as shown below. The StepId attribute identifies step 1 as the parent step.

<DataExport Name="AddrExport" 
 RootElement="ADDRESS" 
 TargetBusinessObject="Hansen.Property.Address">
   <Steps>
      <Step Id="1" ElementName="Addr">
         <DataMappings>
            <DataMap Source="StreetNumber" Target="Number" />
            <DataMap Source="StreetName" Target="Street" />
            <DataMap Source="Suffix.Code" Target="Suffix" />
         </DataMappings>
      </Step>
      <Step Id="2" ElementName="Info">
         <Link Id="1" StepId="1" />
         <DataMappings>
            <DataMap Source="Area.Code" Target="Area" />
            <DataMap Source="EffectiveDate" Target="Effective" />
         </DataMappings>
      </Step>
   </Steps>
</DataExport>

The output is shown below.

<ADDRESS>
   <Addr>   
      <Number>11000</Number>
      <Street>Olson</Street>
      <Suffix>Dr</Suffix>
      <Info>
         <Area>West</Area>
         <Effective>03/25/2017</Effective>
      </Info>
   </Addr>
</ADDRESS>

Note that you can also use <DataMap> elements to add child elements to the output, but these will be simple elements, with no attributes or children of their own.