Description

The JSONSegmentMergeReceiver merges data from two or more segmented data files, generated from the SegmentDataCreatorReceiver, into one or more nested JSON formatted files. 


Note: The format of the JSON output is determined by reading a configuration file and one or more segments referenced from within the configuration file.


In This Article


When should this Receiver be used? 

  • Any time you want to generate nested JSON output.


When should this Receiver not be used? 

  • Any time you want to generate another type of nested output.


Are any additional items required to use this Receiver? 

  • SegmentDataCreatorReceiver- Must be assigned to each Domain, except the Merge Domain.
    • Note: The JSONSegmentMergeReceiver should only be assigned to the Merge Domain that merges the generated segments.

  • Configuration File - Used to determine the XML output format. This is typically named "config.xml", but can be named differently if needed. 
    • Note: When named differently, the name will also need to be changed for the configName parameter within the Receiver.


List of Steps to Generate Nested JSON Format

  1. Set up a Project with Domains, Parent-Child Relationships, and Scenarios.
  2. For each Domain except the Merge Domain, complete the following: 
  3. Create a Merge Domain with just an id Attribute 
    • Note: This may have already been done if Domains were imported.
  4. Add the JSONSegmentMergeReceiver to the Merge Domain and configure it, as discussed in this article. 
  5. Create a Scenario Chain with all Domain Scenarios. Make sure the Merge Scenario is in the last position.
  6. Create a Configuration File as discussed in this article. 
  7. Download the Scenario Chain to your local computer.
  8. Download the Configuration file to your local computer.  It will need to be placed in the location defined here (see the image below):


Receiver Parameters

The JSONSegmentMergeReceiver requires that the following parameters are defined. Items with an asterisk* are required.

  • outputPath* - Defines the location to store the newly generated nested JSON file(s).
  • outputSubDirectory* - Defines the prefix name of subdirectories that are auto created under the outputPath and then appended with a number.
  • configPath *- Defines where the configuration file is to be stored.
  • configSubDir - Defines the subdirectory under the configPath directory where the configuration file is to be stored.
  • configName* - Defines the name of the configuration file.
  • includeRootName* - Defines whether to include the root domain name or not.
  • filesPerOutputSubDir* - Defines the number of files to be generated per output subdirectory.
  • segmentPath* - Defines the path to the Segment directory where all segment subdirectories can be found.
  • segmentSubDirectory* - Defines the subdirectory under the segmentPath where segment files can be found.
  • overrideFileName - Defines the fileName, which will override the fileName provided in the configuration file.
  • nullValue* - Defines the value for null.
  • deleteOutputSubDir - Defines whether to delete the generated or an existing outputSubDirectory during the execution of the Scenario.
  • outputFormatType - Defines whether the Output file format is Expanded or Collapsed.
  • recordsPerFile - Defines the number of records in each output file. The default value is 1.
  • deleteSegmentDir* - Defines whether to delete the segments directory or not.


recordsPerFile Parameter

This recordsPerFile parameter can control the number of records (Root Domain Records) to be distributed in each generated output file. The number of output files generated depends on both the Loop Count of the Root Domai and the recordsPerFile parameter within the JSONSegmentMergeReceiver.  

  • Root Domain Loop Count - Represents the total number of records generated in all Output Files.
  • recordsPerFile Parameter - Controls distribution of generated Root Records in each file.

 

Case 1: 50 Records with 5 Records per File

For this case, the Loop Count of the Root Domain is 50, and the recordsPerFile parameter is set to 5. The Loop count of the Root Domain is a perfect division with the recordsPerFile value.


In this case, 50 records are distributed as 5 records each per file. This means that 10 output files will be generated in this configuration.




Case 2: 50 Records with 8 Records per File

In this case, the Loop Count of the Root Domain is 50, and the recordsPerFile parameter is set to 8. The Loop count of the Root Domain is not a perfect division with the recordsPerFile value.


50 records are distributed as 8 records per file in this case. This means that 7 output files will be generated in this configuration. 


In this example, 6 of the 7 output files will have 8 records, which totals 48 records. The remaining 2 records will be generated in the 7th output file. 




Case 3: Loop Count of Root Domain is less than recordsPerFile Parameter Value

For this example, the Loop Count of the Root Domain is 3, and the recordsPerFile parameter value is 5. In this case, only 1 output file will be generated with only 3 records in it.




Receiver Attribute Property Keys

There are no property keys necessary for this Receiver.


File Config and Directory Config Tabs

The File Config and Directory Config Tabs are used to configure what event will trigger file/directory creation and the naming configuration for generated files/directories. Please click here for more information on how to use the File and Directory Config Tabs.



Cross-Referencing Hidden Attributes for Dynamic File or Directory Name

Additional steps are required when a user needs to hide an Attribute from the output and cross-reference the Attribute for the Dynamic File or Dynamic Directory Name. 

 



These additional steps are required for the Attribute to remain hidden and be used in the file or directory name:  

  1. Make the Attribute Visible in the Attribute Dashboard.
  2. Hide the Attribute within the Config.xml file.


Note: To see a full example of how to set this up for a hidden Attribute and the JSONSegmentMergeReceiver, click here


Example User Story

In this simple use case, a user wants to generate N number of User records for each Department and N number of Departments for each Organization.


So, the examples given below will be based on the generation of segmented data for four Domains. Four Domains represent the following hierarchy in parent-child relationships:

  • OrganizationDomain is the root Domain
  • DepartmentDomain is a child of the OrganizationDomain
  • UserDomain is a child of the DepartmentDomain
  • AddressDomain is a child of the UserDomain


Each Domain will use a SegmentCreatorReceiver to generate segmented data output with referential integrity regarding parent-child relationships. The last Domain, Merge, will use a JSONSegmentMergeReceiver to merge the segmented data generated for each Domain into one or more nested JSON output files. 

Five Scenarios will be created, out of which Four Scenarios will contain the instruction on how much segmented data to generate for each Domain, and the last Scenario will merge the segments together to generate the output. 

Lastly, the Scenarios can be chained together so that they can be run with one command instead of five separate commands.





Configuration File

The JSONSegmentMergeReceiver requires a configuration file (e.g., config.xml) to properly merge the generated segments. In most cases, this will need to be manually created within the GenRocket web platform. For some Domain Imports, this configuration file is created automatically for you.


A Configuration File is required to generate nested JSON. It defines the following elements of information:

  1. fileNameSegments - contains sub-elements that define how file names are created for each nested JSON generated.

  2. segmentFiles - contains sub-elements that define the file names of the segment data files to merge.

  3. elements - contains nested subelements that define the format of the JSON output.


Steps to Create Configuration File

  • Select the Configuration Management tab from the Management pane.
  • Click on the New Configuration button.


  • Select the JSON radio button in the Select Configuration Type window.



  • Enter the required parameters to create a configuration file.
    • Name: Defines the unique name for the JSON configuration.
    • Config File Name: Defines the name of the configuration file that JSONSegmentMergeReceiver will read to create a JSON file.
    • Output File Name Format: Defines the format for the name of the output file.
    • Segment Files: Defines the various segment files that will be used to build nested JSON.



  • Select a Domain to add/remove elements. (complete for each Domain)


  • Users can select one of three options for how selected Domain objects are shown: 
    • List - Domain object always shows in a list. 
    • List Only When Greater Than 1 - Domain object shows as a list only when the loop count is greater than one. 
    • List of Literals - The Domain data displays as a list of literals. Only one Attribute within the Domain can be selected when this option is selected.


  • Use the checkboxes to select one or more Attributes for the selected Domain and alter the Name.
  • Users can also optionally check the "Use Quotes" checkbox for one or more Attributes within a Domain.
  • Click Save and Next to save changes and go to the next Domain.


    Note: These steps will need to be completed for each Domain.

  • Click the Save button on the last Domain.


  • Arrange the Segments in a hierarchy by dragging/dropping the segments.
  • Click Done when finished.



  • Remember to download this file using the Cloud icon and place it in the path specified within this Receiver.

Example Configuration File

This example configuration file is defined to allow four segment files to be merged into one or more JSON nested output files. The format of the segmented data must produce nested output that meets the following rules:

  • There must be three organizations generated, and each to its own nested JSON file.
  • Each organization must have three departments
  • Each department must have three users
  • Each user must have one address   


The XML configuration file

To generate multiple organizations in a separate file, the multiFile parameter is set to true; otherwise, only one nested JSON file would be generated containing all organizations. 


<config>
    <fileNameSegments multiFile="true">
        <fileNameSegment segmentType="Constant" value="Order-"/>
        <fileNameSegment segmentType="TimeStamp" value="yyyyMMddHHmmss"/>
        <fileNameSegment segmentType="Constant" value="-"/>
        <fileNameSegment segmentType="Counter" value="1"/>
        <fileNameSegment segmentType="Constant" value=".json"/>
    </fileNameSegments>
    <segmentFiles>
        <segmentFile fileName="OrganizationSegment.xml" domain="organization"/>
        <segmentFile fileName="DepartmentSegment.xml" domain="department"/>
        <segmentFile fileName="UserSegment.xml" domain="user"/>
        <segmentFile fileName="AddressSegment.xml" domain="address"/>
    </segmentFiles>
    <elements>
        <element name="organization" isList="true" domain="organization">
            <attributes>
                <attribute name="id" tag="@id" useQuotes="true"/>
                <attribute name="name" tag="@name" useQuotes="true"/>
                <attribute name="address" tag="@address" useQuotes="true"/>
                <attribute name="city" tag="@city" useQuotes="true"/>
                <attribute name="state" tag="@state" useQuotes="true"/>
                <attribute name="zipCode" tag="@zipCode" useQuotes="false"/>
                <attribute name="webAddress" tag="@webAddress" useQuotes="true"/>
            </attributes>
            <elements>
                <element name="departments" isList="true" domain="department">
                    <elements>
                        <element name="department" isList="false" domain="department">
                            <attributes>
                                <attribute name="id" tag="@id" useQuotes="true"/>
                                <attribute name="name" tag="@name" useQuotes="true"/>
                                <attribute name="emailAddress" tag="@emailAddress" useQuotes="true"/>
                            </attributes>
                            <elements>
                                <element name="users" isList="true" domain="user">
                                    <elements>
                                        <element name="user" isList="false" domain="user">
                                            <attributes>
                                                <attribute name="id" tag="@id" useQuotes="true"/>
                                                <attribute name="firstName" tag="@firstName" useQuotes="true"/>
                                                <attribute name="lastName" tag="@lastName" useQuotes="true"/>
                                                <attribute name="middleInitial" tag="@middleInitial" useQuotes="true"/>
                                                <attribute name="password" tag="@password" useQuotes="true"/>
                                                <attribute name="emailAddress" tag="@emailAddress" useQuotes="true"/>
                                            </attributes>
                                            <elements>
                                                <element name="address" isList="false" domain="address">
                                                    <attributes>
                                                        <attribute name="id" tag="@id" useQuotes="true"/>
                                                        <attribute name="address" tag="@address" useQuotes="true"/>
                                                        <attribute name="city" tag="@city" useQuotes="true"/>
                                                        <attribute name="state" tag="@state" useQuotes="true"/>
                                                        <attribute name="zipCode" tag="@zipCode" useQuotes="true"/>
                                                    </attributes>
                                                </element>
                                            </elements>
                                        </element>
                                    </elements>
                                </element>
                            </elements>
                        </element>
                    </elements>
                </element>
            </elements>
        </element>
    </elements>
</config>


The example configuration file defines the following information.


FileNameSegments

The subelements will produce a file naming convention that looks like the following:

  • Order-20170316171247-1.json
  • Order-20170316171259-2.json
  • Order-20170316171259-3.json


SegmentFiles

The following segment files will be loaded, and their data will be used in the merge process.

  • OrganizationSegment.xml

  • DepartmentSegment.xml

  • UserSegment.xml

  • AddressSegment.xml


Elements

The elements and subelements are configured to produce the following nested JSON structure.


{
  "organization": [
     {
       "departments": [
          {
            "department": { 
               "users": [
                  {
                    "user": {
                       "address": { 


Example Files

All of the example files below were generated by GenRocket.


Example merged nested JSON file

The following is an example of a merged JSON file for the first organization generated.


{
    "organization": [
        {
            "id": "1",
            "name": "Organization 1",
            "address": "1000 N Washington Dr",
            "city": "Harrisburg",
            "state": "PA",
            "zipCode": 17101,
            "webAddress": "www.org1.com",
            "departments": [
                {
                    "department": {
                        "id": "1",
                        "name": "Department 1",
                        "emailAddress": "zelma.lao@yahoo.com",
                        "users": [
                            {
                                "user": {
                                    "id": "1",
                                    "firstName": "Penny",
                                    "lastName": "Calvert",
                                    "middleInitial": "L",
                                    "password": "356a192b7913b04c54574d18c28d46e6395428ab",
                                    "emailAddress": "user1@email.com",
                                    "address": {
                                        "id": "1",
                                        "address": "1000 N Washington Dr",
                                        "city": "Sacramento",
                                        "state": "CA",
                                        "zipCode": "94203"
                                    }
                                }
                            },
                            {
                                "user": {
                                    "id": "2",
                                    "firstName": "Sudie",
                                    "lastName": "Schleicher",
                                    "middleInitial": "U",
                                    "password": "da4b9237bacccdf19c0760cab7aec4a8359010b0",
                                    "emailAddress": "user2@email.com",
                                    "address": {
                                        "id": "2",
                                        "address": "1001 S Adams Sq",
                                        "city": "Annapolis",
                                        "state": "MD",
                                        "zipCode": "21401"
                                    }
                                }
                            },
                            {
                                "user": {
                                    "id": "3",
                                    "firstName": "Minh",
                                    "lastName": "Crenshaw",
                                    "middleInitial": "M",
                                    "password": "77de68daecd823babbb58edb1c8e14d7106e83bb",
                                    "emailAddress": "user3@email.com",
                                    "address": {
                                        "id": "3",
                                        "address": "1002 E Jefferson Ct",
                                        "city": "Boston",
                                        "state": "MA",
                                        "zipCode": "02108"
                                    }
                                }
                            }
                        ]
                    }
                },
                {
                    "department": {
                        "id": "2",
                        "name": "Department 2",
                        "emailAddress": "elisha.cardinal@yahoo.com",
                        "users": [
                            {
                                "user": {
                                    "id": "4",
                                    "firstName": "Griselda",
                                    "lastName": "Laporte",
                                    "middleInitial": "L",
                                    "password": "1b6453892473a467d07372d45eb05abc2031647a",
                                    "emailAddress": "user4@email.com",
                                    "address": {
                                        "id": "4",
                                        "address": "1003 W Madison St",
                                        "city": "Jackson",
                                        "state": "MS",
                                        "zipCode": "39201"
                                    }
                                }
                            },
                            {
                                "user": {
                                    "id": "5",
                                    "firstName": "Lelia",
                                    "lastName": "Godinez",
                                    "middleInitial": "N",
                                    "password": "ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4",
                                    "emailAddress": "user5@email.com",
                                    "address": {
                                        "id": "5",
                                        "address": "1004 NS Monroe Rd",
                                        "city": "Baton Rouge",
                                        "state": "LA",
                                        "zipCode": "70801"
                                    }
                                }
                            },
                            {
                                "user": {
                                    "id": "6",
                                    "firstName": "Twana",
                                    "lastName": "Giroux",
                                    "middleInitial": "L",
                                    "password": "c1dfd96eea8cc2b62785275bca38ac261256e278",
                                    "emailAddress": "user6@email.com",
                                    "address": {
                                        "id": "6",
                                        "address": "1005 NE Adams Ave",
                                        "city": "Montpelier",
                                        "state": "VT",
                                        "zipCode": "05061"
                                    }
                                }
                            }
                        ]
                    }
                },
                {
                    "department": {
                        "id": "3",
                        "name": "Department 3",
                        "emailAddress": "oliver.mark@email.com",
                        "users": [
                            {
                                "user": {
                                    "id": "7",
                                    "firstName": "Donnie",
                                    "lastName": "Vandusen",
                                    "middleInitial": "W",
                                    "password": "902ba3cda1883801594b6e1b452790cc53948fda",
                                    "emailAddress": "user7@email.com",
                                    "address": {
                                        "id": "7",
                                        "address": "1006 NW Jackson Blvd",
                                        "city": "Tallahassee",
                                        "state": "FL",
                                        "zipCode": "32301"
                                    }
                                }
                            },
                            {
                                "user": {
                                    "id": "8",
                                    "firstName": "Angele",
                                    "lastName": "Hennings",
                                    "middleInitial": "G",
                                    "password": "fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f",
                                    "emailAddress": "user8@email.com",
                                    "address": {
                                        "id": "8",
                                        "address": "1007 SE Van Buren Wy",
                                        "city": "Olympia",
                                        "state": "WA",
                                        "zipCode": "98501"
                                    }
                                }
                            },
                            {
                                "user": {
                                    "id": "9",
                                    "firstName": "Gayla",
                                    "lastName": "Yeung",
                                    "middleInitial": "Q",
                                    "password": "0ade7c2cf97f75d009975f4d720d1fa6c19f4897",
                                    "emailAddress": "user9@email.com",
                                    "address": {
                                        "id": "9",
                                        "address": "1008 SW Harrison Ln",
                                        "city": "Providence",
                                        "state": "RI",
                                        "zipCode": "02901"
                                    }
                                }
                            }
                        ]
                    }
                }
            ]
        }
    ]
}


Example Segment Files

The following are four example segmented data files used to generate the merged nested JSON files.


OrganizationSegment.xml 

This file will contain three segments, each having one data element containing the organization attributes, a loopCount equal to one, and no parentId since the organization is the root Domain and does not have a parent Domain.


<segments>
  <segment loopCount="1">
    <data>
      <attribute name="id">1</attribute>
      <attribute name="name">Organization 1</attribute>
      <attribute name="address">1000 N Washington Dr</attribute>
      <attribute name="city">Harrisburg</attribute>
      <attribute name="state">PA</attribute>
      <attribute name="zipCode">17101</attribute>
      <attribute name="webAddress">www.org1.com</attribute>
    </data>
  </segment>
  <segment loopCount="1">
    <data>
      <attribute name="id">2</attribute>
      <attribute name="name">Organization 2</attribute>
      <attribute name="address">1001 S Adams Sq</attribute>
      <attribute name="city">Boise</attribute>
      <attribute name="state">ID</attribute>
      <attribute name="zipCode">83701</attribute>
      <attribute name="webAddress">www.org2.com</attribute>
    </data>
  </segment>
  <segment loopCount="1">
    <data>
      <attribute name="id">3</attribute>
      <attribute name="name">Organization 3</attribute>
      <attribute name="address">1002 E Jefferson Ct</attribute>
      <attribute name="city">Atlanta</attribute>
      <attribute name="state">GA</attribute>
      <attribute name="zipCode">30301</attribute>
      <attribute name="webAddress">www.org3.com</attribute>
    </data>
  </segment>
</segments>


DepartmentSegment.xml

This file will contain three segments, each having three data elements containing the department attributes, a loopCount equal to three, and a parentId given each set of departments referential integrity to an organization defined within OrganizationSegment.xml.


<segments>
  <segment parentId="1" loopCount="3">
    <data>
      <attribute name="id">1</attribute>
      <attribute name="name">Department 1</attribute>
      <attribute name="manager">Zelma Q. Lao</attribute>
      <attribute name="emailAddress">zelma.lao@yahoo.com</attribute>
      <attribute name="organization">1</attribute>
    </data>
    <data>
      <attribute name="id">2</attribute>
      <attribute name="name">Department 2</attribute>
      <attribute name="manager">Elisha Z. Cardinal</attribute>
      <attribute name="emailAddress">elisha.cardinal@yahoo.com</attribute>
      <attribute name="organization">1</attribute>
    </data>
    <data>
      <attribute name="id">3</attribute>
      <attribute name="name">Department 3</attribute>
      <attribute name="manager">Oliver G. Mark</attribute>
      <attribute name="emailAddress">oliver.mark@email.com</attribute>
      <attribute name="organization">1</attribute>
    </data>
  </segment>
  <segment parentId="2" loopCount="3">
    <data>
      <attribute name="id">4</attribute>
      <attribute name="name">Department 1</attribute>
      <attribute name="manager">Piedad I. Liggett</attribute>
      <attribute name="emailAddress">piedad.liggett@yahoo.com</attribute>
      <attribute name="organization">2</attribute>
    </data>
    <data>
      <attribute name="id">5</attribute>
      <attribute name="name">Department 2</attribute>
      <attribute name="manager">Beatrice L. Lafferty</attribute>
      <attribute name="emailAddress">beatrice.lafferty@yahoo.com</attribute>
      <attribute name="organization">2</attribute>
    </data>
    <data>
      <attribute name="id">6</attribute>
      <attribute name="name">Department 3</attribute>
      <attribute name="manager">Alva X. Vanmeter</attribute>
      <attribute name="emailAddress">alva.vanmeter@gmail.com</attribute>
      <attribute name="organization">2</attribute>
    </data>
  </segment>
  <segment parentId="3" loopCount="3">
    <data>
      <attribute name="id">7</attribute>
      <attribute name="name">Department 1</attribute>
      <attribute name="manager">Rodger T. Catania</attribute>
      <attribute name="emailAddress">rodger.catania@yahoo.com</attribute>
      <attribute name="organization">3</attribute>
    </data>
    <data>
      <attribute name="id">8</attribute>
      <attribute name="name">Department 2</attribute>
      <attribute name="manager">Lara V. Groce</attribute>
      <attribute name="emailAddress">lara.groce@gmail.com</attribute>
      <attribute name="organization">3</attribute>
    </data>
    <data>
      <attribute name="id">9</attribute>
      <attribute name="name">Department 3</attribute>
      <attribute name="manager">Roosevelt V. Hudgens</attribute>
      <attribute name="emailAddress">roosevelt.hudgens@email.com</attribute>
      <attribute name="organization">3</attribute>
    </data>
  </segment>
</segments>


UserSegment.xml

This file will contain nine segments, each having three data elements containing the user attributes, a loopCount equal to three, and a parentId given each set of users referential integrity to a given department defined within DepartmentSegment.xml.


<segments>
  <segment parentId="1" loopCount="3">
    <data>
      <attribute name="id">1</attribute>
      <attribute name="firstName">Penny</attribute>
      <attribute name="lastName">Calvert</attribute>
      <attribute name="middleInitial">L</attribute>
      <attribute name="password">356a192b7913b04c54574d18c28d46e6395428ab</attribute>
      <attribute name="emailAddress">user1@email.com</attribute>
      <attribute name="phoneNumber">(231) 635-2231</attribute>
      <attribute name="department">1</attribute>
    </data>
    <data>
      <attribute name="id">2</attribute>
      <attribute name="firstName">Sudie</attribute>
      <attribute name="lastName">Schleicher</attribute>
      <attribute name="middleInitial">U</attribute>
      <attribute name="password">da4b9237bacccdf19c0760cab7aec4a8359010b0</attribute>
      <attribute name="emailAddress">user2@email.com</attribute>
      <attribute name="phoneNumber">(538) 707-7030</attribute>
      <attribute name="department">1</attribute>
    </data>
    <data>
      <attribute name="id">3</attribute>
      <attribute name="firstName">Minh</attribute>
      <attribute name="lastName">Crenshaw</attribute>
      <attribute name="middleInitial">M</attribute>
      <attribute name="password">77de68daecd823babbb58edb1c8e14d7106e83bb</attribute>
      <attribute name="emailAddress">user3@email.com</attribute>
      <attribute name="phoneNumber">(330) 574-4702</attribute>
      <attribute name="department">1</attribute>
    </data>
  </segment>
  <segment parentId="2" loopCount="3">
    <data>
      <attribute name="id">4</attribute>
      <attribute name="firstName">Griselda</attribute>
      <attribute name="lastName">Laporte</attribute>
      <attribute name="middleInitial">L</attribute>
      <attribute name="password">1b6453892473a467d07372d45eb05abc2031647a</attribute>
      <attribute name="emailAddress">user4@email.com</attribute>
      <attribute name="phoneNumber">(457) 169-3395</attribute>
      <attribute name="department">2</attribute>
    </data>
    <data>
      <attribute name="id">5</attribute>
      <attribute name="firstName">Lelia</attribute>
      <attribute name="lastName">Godinez</attribute>
      <attribute name="middleInitial">N</attribute>
      <attribute name="password">ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4</attribute>
      <attribute name="emailAddress">user5@email.com</attribute>
      <attribute name="phoneNumber">(364) 591-8958</attribute>
      <attribute name="department">2</attribute>
    </data>
    <data>
      <attribute name="id">6</attribute>
      <attribute name="firstName">Twana</attribute>
      <attribute name="lastName">Giroux</attribute>
      <attribute name="middleInitial">L</attribute>
      <attribute name="password">c1dfd96eea8cc2b62785275bca38ac261256e278</attribute>
      <attribute name="emailAddress">user6@email.com</attribute>
      <attribute name="phoneNumber">(650) 268-6508</attribute>
      <attribute name="department">2</attribute>
    </data>
  </segment>
  <segment parentId="3" loopCount="3">
    <data>
      <attribute name="id">7</attribute>
      <attribute name="firstName">Donnie</attribute>
      <attribute name="lastName">Vandusen</attribute>
      <attribute name="middleInitial">W</attribute>
      <attribute name="password">902ba3cda1883801594b6e1b452790cc53948fda</attribute>
      <attribute name="emailAddress">user7@email.com</attribute>
      <attribute name="phoneNumber">(310) 623-5789</attribute>
      <attribute name="department">3</attribute>
    </data>
    <data>
      <attribute name="id">8</attribute>
      <attribute name="firstName">Angele</attribute>
      <attribute name="lastName">Hennings</attribute>
      <attribute name="middleInitial">G</attribute>
      <attribute name="password">fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f</attribute>
      <attribute name="emailAddress">user8@email.com</attribute>
      <attribute name="phoneNumber">(330) 683-8070</attribute>
      <attribute name="department">3</attribute>
    </data>
    <data>
      <attribute name="id">9</attribute>
      <attribute name="firstName">Gayla</attribute>
      <attribute name="lastName">Yeung</attribute>
      <attribute name="middleInitial">Q</attribute>
      <attribute name="password">0ade7c2cf97f75d009975f4d720d1fa6c19f4897</attribute>
      <attribute name="emailAddress">user9@email.com</attribute>
      <attribute name="phoneNumber">(510) 216-7902</attribute>
      <attribute name="department">3</attribute>
    </data>
  </segment>
  <segment parentId="4" loopCount="3">
    <data>
      <attribute name="id">10</attribute>
      <attribute name="firstName">Mirta</attribute>
      <attribute name="lastName">Garibay</attribute>
      <attribute name="middleInitial">D</attribute>
      <attribute name="password">b1d5781111d84f7b3fe45a0852e59758cd7a87e5</attribute>
      <attribute name="emailAddress">user10@email.com</attribute>
      <attribute name="phoneNumber">(350) 700-8081</attribute>
      <attribute name="department">4</attribute>
    </data>
    <data>
      <attribute name="id">11</attribute>
      <attribute name="firstName">Tressie</attribute>
      <attribute name="lastName">Pardo</attribute>
      <attribute name="middleInitial">U</attribute>
      <attribute name="password">17ba0791499db908433b80f37c5fbc89b870084b</attribute>
      <attribute name="emailAddress">user11@email.com</attribute>
      <attribute name="phoneNumber">(644) 647-3454</attribute>
      <attribute name="department">4</attribute>
    </data>
    <data>
      <attribute name="id">12</attribute>
      <attribute name="firstName">Zelda</attribute>
      <attribute name="lastName">Heiser</attribute>
      <attribute name="middleInitial">H</attribute>
      <attribute name="password">7b52009b64fd0a2a49e6d8a939753077792b0554</attribute>
      <attribute name="emailAddress">user12@email.com</attribute>
      <attribute name="phoneNumber">(257) 662-6266</attribute>
      <attribute name="department">4</attribute>
    </data>
  </segment>
  <segment parentId="5" loopCount="3">
    <data>
      <attribute name="id">13</attribute>
      <attribute name="firstName">Sherlyn</attribute>
      <attribute name="lastName">Gurule</attribute>
      <attribute name="middleInitial">Q</attribute>
      <attribute name="password">bd307a3ec329e10a2cff8fb87480823da114f8f4</attribute>
      <attribute name="emailAddress">user13@email.com</attribute>
      <attribute name="phoneNumber">(779) 495-3772</attribute>
      <attribute name="department">5</attribute>
    </data>
    <data>
      <attribute name="id">14</attribute>
      <attribute name="firstName">Mirta</attribute>
      <attribute name="lastName">Humphrey</attribute>
      <attribute name="middleInitial">I</attribute>
      <attribute name="password">fa35e192121eabf3dabf9f5ea6abdbcbc107ac3b</attribute>
      <attribute name="emailAddress">user14@email.com</attribute>
      <attribute name="phoneNumber">(689) 215-1868</attribute>
      <attribute name="department">5</attribute>
    </data>
    <data>
      <attribute name="id">15</attribute>
      <attribute name="firstName">Colette</attribute>
      <attribute name="lastName">Karl</attribute>
      <attribute name="middleInitial">T</attribute>
      <attribute name="password">f1abd670358e036c31296e66b3b66c382ac00812</attribute>
      <attribute name="emailAddress">user15@email.com</attribute>
      <attribute name="phoneNumber">(628) 206-1416</attribute>
      <attribute name="department">5</attribute>
    </data>
  </segment>
  <segment parentId="6" loopCount="3">
    <data>
      <attribute name="id">16</attribute>
      <attribute name="firstName">Cheryl</attribute>
      <attribute name="lastName">Lima</attribute>
      <attribute name="middleInitial">R</attribute>
      <attribute name="password">1574bddb75c78a6fd2251d61e2993b5146201319</attribute>
      <attribute name="emailAddress">user16@email.com</attribute>
      <attribute name="phoneNumber">(677) 271-3523</attribute>
      <attribute name="department">6</attribute>
    </data>
    <data>
      <attribute name="id">17</attribute>
      <attribute name="firstName">Billie</attribute>
      <attribute name="lastName">Hook</attribute>
      <attribute name="middleInitial">U</attribute>
      <attribute name="password">0716d9708d321ffb6a00818614779e779925365c</attribute>
      <attribute name="emailAddress">user17@email.com</attribute>
      <attribute name="phoneNumber">(548) 191-9544</attribute>
      <attribute name="department">6</attribute>
    </data>
    <data>
      <attribute name="id">18</attribute>
      <attribute name="firstName">Lisa</attribute>
      <attribute name="lastName">Faircloth</attribute>
      <attribute name="middleInitial">M</attribute>
      <attribute name="password">9e6a55b6b4563e652a23be9d623ca5055c356940</attribute>
      <attribute name="emailAddress">user18@email.com</attribute>
      <attribute name="phoneNumber">(751) 524-8556</attribute>
      <attribute name="department">6</attribute>
    </data>
  </segment>
  <segment parentId="7" loopCount="3">
    <data>
      <attribute name="id">19</attribute>
      <attribute name="firstName">Leanna</attribute>
      <attribute name="lastName">Guerrero</attribute>
      <attribute name="middleInitial">S</attribute>
      <attribute name="password">b3f0c7f6bb763af1be91d9e74eabfeb199dc1f1f</attribute>
      <attribute name="emailAddress">user19@email.com</attribute>
      <attribute name="phoneNumber">(587) 397-5540</attribute>
      <attribute name="department">7</attribute>
    </data>
    <data>
      <attribute name="id">20</attribute>
      <attribute name="firstName">Kathie</attribute>
      <attribute name="lastName">Blackshear</attribute>
      <attribute name="middleInitial">D</attribute>
      <attribute name="password">91032ad7bbcb6cf72875e8e8207dcfba80173f7c</attribute>
      <attribute name="emailAddress">user20@email.com</attribute>
      <attribute name="phoneNumber">(287) 794-3482</attribute>
      <attribute name="department">7</attribute>
    </data>
    <data>
      <attribute name="id">21</attribute>
      <attribute name="firstName">Daryl</attribute>
      <attribute name="lastName">Oneal</attribute>
      <attribute name="middleInitial">Q</attribute>
      <attribute name="password">472b07b9fcf2c2451e8781e944bf5f77cd8457c8</attribute>
      <attribute name="emailAddress">user21@email.com</attribute>
      <attribute name="phoneNumber">(780) 102-3806</attribute>
      <attribute name="department">7</attribute>
    </data>
  </segment>
  <segment parentId="8" loopCount="3">
    <data>
      <attribute name="id">22</attribute>
      <attribute name="firstName">Orpha</attribute>
      <attribute name="lastName">Kohn</attribute>
      <attribute name="middleInitial">L</attribute>
      <attribute name="password">12c6fc06c99a462375eeb3f43dfd832b08ca9e17</attribute>
      <attribute name="emailAddress">user22@email.com</attribute>
      <attribute name="phoneNumber">(689) 488-1634</attribute>
      <attribute name="department">8</attribute>
    </data>
    <data>
      <attribute name="id">23</attribute>
      <attribute name="firstName">Hermelinda</attribute>
      <attribute name="lastName">Loya</attribute>
      <attribute name="middleInitial">D</attribute>
      <attribute name="password">d435a6cdd786300dff204ee7c2ef942d3e9034e2</attribute>
      <attribute name="emailAddress">user23@email.com</attribute>
      <attribute name="phoneNumber">(760) 167-7553</attribute>
      <attribute name="department">8</attribute>
    </data>
    <data>
      <attribute name="id">24</attribute>
      <attribute name="firstName">Emilia</attribute>
      <attribute name="lastName">Fogarty</attribute>
      <attribute name="middleInitial">F</attribute>
      <attribute name="password">4d134bc072212ace2df385dae143139da74ec0ef</attribute>
      <attribute name="emailAddress">user24@email.com</attribute>
      <attribute name="phoneNumber">(375) 684-3181</attribute>
      <attribute name="department">8</attribute>
    </data>
  </segment>
  <segment parentId="9" loopCount="3">
    <data>
      <attribute name="id">25</attribute>
      <attribute name="firstName">Leonore</attribute>
      <attribute name="lastName">Gooch</attribute>
      <attribute name="middleInitial">P</attribute>
      <attribute name="password">f6e1126cedebf23e1463aee73f9df08783640400</attribute>
      <attribute name="emailAddress">user25@email.com</attribute>
      <attribute name="phoneNumber">(774) 188-3329</attribute>
      <attribute name="department">9</attribute>
    </data>
    <data>
      <attribute name="id">26</attribute>
      <attribute name="firstName">Nieves</attribute>
      <attribute name="lastName">Lombardo</attribute>
      <attribute name="middleInitial">M</attribute>
      <attribute name="password">887309d048beef83ad3eabf2a79a64a389ab1c9f</attribute>
      <attribute name="emailAddress">user26@email.com</attribute>
      <attribute name="phoneNumber">(633) 235-2587</attribute>
      <attribute name="department">9</attribute>
    </data>
    <data>
      <attribute name="id">27</attribute>
      <attribute name="firstName">Shanita</attribute>
      <attribute name="lastName">Viramontes</attribute>
      <attribute name="middleInitial">A</attribute>
      <attribute name="password">bc33ea4e26e5e1af1408321416956113a4658763</attribute>
      <attribute name="emailAddress">user27@email.com</attribute>
      <attribute name="phoneNumber">(660) 193-7293</attribute>
      <attribute name="department">9</attribute>
    </data>
  </segment>
</segments>


AddressSegment.xml

This file will contain twenty-seven segments, each having one data element containing address attributes, a loopCount equal to 1, and a parentId given each address referential integrity to a given user-defined within UserSegment.xml.


<segments>
  <segment parentId="1" loopCount="1">
    <data>
      <attribute name="id">1</attribute>
      <attribute name="address">1000 N Washington Dr</attribute>
      <attribute name="city">Sacramento</attribute>
      <attribute name="state">CA</attribute>
      <attribute name="zipCode">94203</attribute>
      <attribute name="user">1</attribute>
    </data>
  </segment>
  <segment parentId="2" loopCount="1">
    <data>
      <attribute name="id">2</attribute>
      <attribute name="address">1001 S Adams Sq</attribute>
      <attribute name="city">Annapolis</attribute>
      <attribute name="state">MD</attribute>
      <attribute name="zipCode">21401</attribute>
      <attribute name="user">2</attribute>
    </data>
  </segment>
  <segment parentId="3" loopCount="1">
    <data>
      <attribute name="id">3</attribute>
      <attribute name="address">1002 E Jefferson Ct</attribute>
      <attribute name="city">Boston</attribute>
      <attribute name="state">MA</attribute>
      <attribute name="zipCode">02108</attribute>
      <attribute name="user">3</attribute>
    </data>
  </segment>
  <segment parentId="4" loopCount="1">
    <data>
      <attribute name="id">4</attribute>
      <attribute name="address">1003 W Madison St</attribute>
      <attribute name="city">Jackson</attribute>
      <attribute name="state">MS</attribute>
      <attribute name="zipCode">39201</attribute>
      <attribute name="user">4</attribute>
    </data>
  </segment>
  <segment parentId="5" loopCount="1">
    <data>
      <attribute name="id">5</attribute>
      <attribute name="address">1004 NS Monroe Rd</attribute>
      <attribute name="city">Baton Rouge</attribute>
      <attribute name="state">LA</attribute>
      <attribute name="zipCode">70801</attribute>
      <attribute name="user">5</attribute>
    </data>
  </segment>
  <segment parentId="6" loopCount="1">
    <data>
      <attribute name="id">6</attribute>
      <attribute name="address">1005 NE Adams Ave</attribute>
      <attribute name="city">Montpelier</attribute>
      <attribute name="state">VT</attribute>
      <attribute name="zipCode">05061</attribute>
      <attribute name="user">6</attribute>
    </data>
  </segment>
  <segment parentId="7" loopCount="1">
    <data>
      <attribute name="id">7</attribute>
      <attribute name="address">1006 NW Jackson Blvd</attribute>
      <attribute name="city">Tallahassee</attribute>
      <attribute name="state">FL</attribute>
      <attribute name="zipCode">32301</attribute>
      <attribute name="user">7</attribute>
    </data>
  </segment>
  <segment parentId="8" loopCount="1">
    <data>
      <attribute name="id">8</attribute>
      <attribute name="address">1007 SE Van Buren Wy</attribute>
      <attribute name="city">Olympia</attribute>
      <attribute name="state">WA</attribute>
      <attribute name="zipCode">98501</attribute>
      <attribute name="user">8</attribute>
    </data>
  </segment>
  <segment parentId="9" loopCount="1">
    <data>
      <attribute name="id">9</attribute>
      <attribute name="address">1008 SW Harrison Ln</attribute>
      <attribute name="city">Providence</attribute>
      <attribute name="state">RI</attribute>
      <attribute name="zipCode">02901</attribute>
      <attribute name="user">9</attribute>
    </data>
  </segment>
  <segment parentId="10" loopCount="1">
    <data>
      <attribute name="id">10</attribute>
      <attribute name="address">1009 EW Tyler Cir</attribute>
      <attribute name="city">Columbia</attribute>
      <attribute name="state">SC</attribute>
      <attribute name="zipCode">29201</attribute>
      <attribute name="user">10</attribute>
    </data>
  </segment>
  <segment parentId="11" loopCount="1">
    <data>
      <attribute name="id">11</attribute>
      <attribute name="address">1010 N Polk Pk</attribute>
      <attribute name="city">Nashville</attribute>
      <attribute name="state">TN</attribute>
      <attribute name="zipCode">37201</attribute>
      <attribute name="user">11</attribute>
    </data>
  </segment>
  <segment parentId="12" loopCount="1">
    <data>
      <attribute name="id">12</attribute>
      <attribute name="address">1011 S Taylor Pkwy</attribute>
      <attribute name="city">Topeka</attribute>
      <attribute name="state">KS</attribute>
      <attribute name="zipCode">66601</attribute>
      <attribute name="user">12</attribute>
    </data>
  </segment>
  <segment parentId="13" loopCount="1">
    <data>
      <attribute name="id">13</attribute>
      <attribute name="address">1012 E Fillmore Dr</attribute>
      <attribute name="city">Carson City</attribute>
      <attribute name="state">NV</attribute>
      <attribute name="zipCode">89701</attribute>
      <attribute name="user">13</attribute>
    </data>
  </segment>
  <segment parentId="14" loopCount="1">
    <data>
      <attribute name="id">14</attribute>
      <attribute name="address">1013 W Pierce Sq</attribute>
      <attribute name="city">Jefferson City</attribute>
      <attribute name="state">MO</attribute>
      <attribute name="zipCode">65101</attribute>
      <attribute name="user">14</attribute>
    </data>
  </segment>
  <segment parentId="15" loopCount="1">
    <data>
      <attribute name="id">15</attribute>
      <attribute name="address">1014 NS Buchanan Ct</attribute>
      <attribute name="city">Phoenix</attribute>
      <attribute name="state">AZ</attribute>
      <attribute name="zipCode">85001</attribute>
      <attribute name="user">15</attribute>
    </data>
  </segment>
  <segment parentId="16" loopCount="1">
    <data>
      <attribute name="id">16</attribute>
      <attribute name="address">1015 NE Lincoln St</attribute>
      <attribute name="city">Springfield</attribute>
      <attribute name="state">IL</attribute>
      <attribute name="zipCode">62701</attribute>
      <attribute name="user">16</attribute>
    </data>
  </segment>
  <segment parentId="17" loopCount="1">
    <data>
      <attribute name="id">17</attribute>
      <attribute name="address">1016 NW Johnson Rd</attribute>
      <attribute name="city">Austin</attribute>
      <attribute name="state">TX</attribute>
      <attribute name="zipCode">73301</attribute>
      <attribute name="user">17</attribute>
    </data>
  </segment>
  <segment parentId="18" loopCount="1">
    <data>
      <attribute name="id">18</attribute>
      <attribute name="address">1017 SE Grant Ave</attribute>
      <attribute name="city">Saint Paul</attribute>
      <attribute name="state">MN</attribute>
      <attribute name="zipCode">55101</attribute>
      <attribute name="user">18</attribute>
    </data>
  </segment>
  <segment parentId="19" loopCount="1">
    <data>
      <attribute name="id">19</attribute>
      <attribute name="address">1018 SW Hayes Blvd</attribute>
      <attribute name="city">Denver</attribute>
      <attribute name="state">CO</attribute>
      <attribute name="zipCode">80002</attribute>
      <attribute name="user">19</attribute>
    </data>
  </segment>
  <segment parentId="20" loopCount="1">
    <data>
      <attribute name="id">20</attribute>
      <attribute name="address">1019 EW Garfield Wy</attribute>
      <attribute name="city">Providence</attribute>
      <attribute name="state">RI</attribute>
      <attribute name="zipCode">02901</attribute>
      <attribute name="user">20</attribute>
    </data>
  </segment>
  <segment parentId="21" loopCount="1">
    <data>
      <attribute name="id">21</attribute>
      <attribute name="address">1020 N Arthur Ln</attribute>
      <attribute name="city">Atlanta</attribute>
      <attribute name="state">GA</attribute>
      <attribute name="zipCode">30301</attribute>
      <attribute name="user">21</attribute>
    </data>
  </segment>
  <segment parentId="22" loopCount="1">
    <data>
      <attribute name="id">22</attribute>
      <attribute name="address">1021 S Cleveland Cir</attribute>
      <attribute name="city">Augusta</attribute>
      <attribute name="state">ME</attribute>
      <attribute name="zipCode">04330</attribute>
      <attribute name="user">22</attribute>
    </data>
  </segment>
  <segment parentId="23" loopCount="1">
    <data>
      <attribute name="id">23</attribute>
      <attribute name="address">1022 E Harrison Pk</attribute>
      <attribute name="city">Tallahassee</attribute>
      <attribute name="state">FL</attribute>
      <attribute name="zipCode">32301</attribute>
      <attribute name="user">23</attribute>
    </data>
  </segment>
  <segment parentId="24" loopCount="1">
    <data>
      <attribute name="id">24</attribute>
      <attribute name="address">1023 W Cleveland Pkwy</attribute>
      <attribute name="city">Oklahoma City</attribute>
      <attribute name="state">OK</attribute>
      <attribute name="zipCode">73101</attribute>
      <attribute name="user">24</attribute>
    </data>
  </segment>
  <segment parentId="25" loopCount="1">
    <data>
      <attribute name="id">25</attribute>
      <attribute name="address">1024 NS McKinley Dr</attribute>
      <attribute name="city">Phoenix</attribute>
      <attribute name="state">AZ</attribute>
      <attribute name="zipCode">85001</attribute>
      <attribute name="user">25</attribute>
    </data>
  </segment>
  <segment parentId="26" loopCount="1">
    <data>
      <attribute name="id">26</attribute>
      <attribute name="address">1025 NE T. Roosevelt Sq</attribute>
      <attribute name="city">Montpelier</attribute>
      <attribute name="state">VT</attribute>
      <attribute name="zipCode">05061</attribute>
      <attribute name="user">26</attribute>
    </data>
  </segment>
  <segment parentId="27" loopCount="1">
    <data>
      <attribute name="id">27</attribute>
      <attribute name="address">1026 NW Taft Ct</attribute>
      <attribute name="city">Trenton</attribute>
      <attribute name="state">NJ</attribute>
      <attribute name="zipCode">08601</attribute>
      <attribute name="user">27</attribute>
    </data>
  </segment>
</segments>