Wednesday 6 March 2013

convert flat structure into hierarchal using Table Looping Functoid



This tutorial describes how to convert flat structure schema to hierarchal schema using Table Looping functoid.

Input Schema: FlatStructure.xsd




















Target Schema:
 
















Map for conversion:

































Input Instance for Test:


<ns0:FlatStructure xmlns:ns0="http://Company.Demo.TableFunctoid.FlatStructure">
  <Name>Name</Name>
  <ResidentialAddressLine1>ResidentialAddressLine1</ResidentialAddressLine1>
  <ResidentialAddressLine2>ResidentialAddressLine2</ResidentialAddressLine2>
  <ResidentialAddressCity>ResidentialAddressCity</ResidentialAddressCity>
  <ResidentialAddressState>ResidentialAddressState</ResidentialAddressState>
  <OfficeAddressLine1>OfficeAddressLine1</OfficeAddressLine1>
  <OfficeAddressLine2>OfficeAddressLine2</OfficeAddressLine2>
  <OfficeAddressCity>OfficeAddressCity</OfficeAddressCity>
  <OfficeAddressState>OfficeAddressState</OfficeAddressState>
  <GaragedAddressLine1>GaragedAddressLine1</GaragedAddressLine1>
  <GaragedAddressLine2>GaragedAddressLine2</GaragedAddressLine2>
  <GaragedAddressCity>GaragedAddressCity</GaragedAddressCity>
  <GaragedAddressState>GaragedAddressState</GaragedAddressState>
</ns0:FlatStructure>



Output Instance :

<ns0:HierarchyStructure xmlns:ns0="http://Company.Demo.TableFunctoid.HierarchyStructure">
  <Addresses>
    <Address>
      <AddressType>Residential</AddressType>
      <Line1>ResidentialAddressLine1</Line1>
      <Line2>ResidentialAddressLine2</Line2>
      <State>ResidentialAddressState</State>
      <City>ResidentialAddressCity</City>
    </Address>
    <Address>
      <AddressType>Office</AddressType>
      <Line1>OfficeAddressLine1</Line1>
      <Line2>OfficeAddressLine2</Line2>
      <State>OfficeAddressState</State>
      <City>OfficeAddressCity</City>
    </Address>
    <Address>
      <AddressType>Garaged</AddressType>
      <Line1>GaragedAddressLine1</Line1>
      <Line2>GaragedAddressLine2</Line2>
      <State>GaragedAddressState</State>
      <City>GaragedAddressCity</City>
    </Address>
  </Addresses>
</ns0:HierarchyStructure>



Use of Gated Checkbox :

When you select this check box, you are specifying that the value of the data specified for column 1 controls whether any processing is performed for that row. When this is output from a logical functoid, if the value specified in column 1 evaluates to False, the associated row of the grid is skipped (meaning that the associated Table Extractor functoids are not invoked for that row).

Code Available Here

No comments:

Post a Comment