Description

The SegmentDataCreatorReceiver morphs a Domain's generated data into name/value pair XML segments. 


Segmented data is set-based and each XML segment represents a single Domain of test data.  Each segment can also reference a parent Domain from another segment to ensure referential integrity between parent/child relationships. 



The SegmentDataCreatorReceiver formats data generically, in XML format; this gives any GenRocket MergeReceiver  the ability to read XML segment files and merge the segmented data into complex nested output formats. The current GenRocket MergeReceivers that use segment generated XML files are the following:

  • DelimitedFileSegmentMergeReceiver
  • FixedFileSegmentMergeReceiver
  • HL7SegmentMergeReceiver
  • JSONSegmentMergeReceiver
  • PartitionFileMergeReceiver
  • SoapSegmentMergeReceiver
  • XMLSegmentMergeReceiver (Deprecated)
  • XMLSegmentMergeV2Receiver 

Parameters

The SegmentDataCreatorReceiver requires that the following parameters are defined:

  • outputPath - Defines the location to store the generated XML segment file.
  • subDirectory - Defines the name of a subdirectory defined as the value of the outputPath.
  • fileName - Defines the name of the generated segment file.
  • filesPerDirectory - Defines the number of files to be generated per output subdirectory.
  • recordsPerFile - Defines the number of segments to be generated per file.

Receiver Attribute Property Keys

The Receiver defines three property keys that can be modified on any of its associated Domain Attributes:

  • aliasName - Can be used to override the Attribute name.
  • parentId - Defines a reference to a parent segment.
  • include - Determines if the given Attribute will be included in the segment output.

File Name Convention

  • Though not strictly enforced, a segment file name should end with Segment.xml (e.g. UserSegment.xml) 

Example Scenario

A user has two Domains for which she wants data to be generated:  

  • Organization - generate test data for 3 Organizations.
  • Department - for each Organizations, generate 3 Departments.


Organization Segment Output

<segments>
  <segment id="1" setId="1">
    <attribute name="id"><![CDATA[1]]></attribute>
    <attribute name="name"><![CDATA[First American Financial Corporation]]></attribute>
    <attribute name="document-generation"><![CDATA[1]]></attribute>
  </segment>
  <segment id="2" setId="1">
    <attribute name="id"><![CDATA[2]]></attribute>
    <attribute name="name"><![CDATA[Office Depot, Inc.]]></attribute>
    <attribute name="document-generation"><![CDATA[1]]></attribute>
  </segment>
  <segment id="3" setId="1">
    <attribute name="id"><![CDATA[3]]></attribute>
    <attribute name="name"><![CDATA[Ingram Micro Inc.]]></attribute>
    <attribute name="document-generation"><![CDATA[1]]></attribute>
  </segment>
</segments>


Department Segment Output

Since the Department Domain is a child of the Organization Domain and there must be three departments for each Organization, the segments will be generated in groups of three with each group of three relating to a different Organization set 1, 2 and 3 respectively.


<segments>
  <segment id="1" setId="1">
    <attribute name="id"><![CDATA[1]]></attribute>
    <attribute name="phoneNumber"><![CDATA[(768) 356-5902]]></attribute>
    <attribute name="name"><![CDATA[Department1]]></attribute>
    <attribute name="departments"><![CDATA[1]]></attribute>
  </segment>
  <segment id="2" setId="1">
    <attribute name="id"><![CDATA[2]]></attribute>
    <attribute name="phoneNumber"><![CDATA[(563) 734-9528]]></attribute>
    <attribute name="name"><![CDATA[Department2]]></attribute>
    <attribute name="departments"><![CDATA[1]]></attribute>
  </segment>
  <segment id="3" setId="1">
    <attribute name="id"><![CDATA[3]]></attribute>
    <attribute name="phoneNumber"><![CDATA[(764) 547-2159]]></attribute>
    <attribute name="name"><![CDATA[Department3]]></attribute>
    <attribute name="departments"><![CDATA[1]]></attribute>
  </segment>
  <segment id="4" setId="2">
    <attribute name="id"><![CDATA[4]]></attribute>
    <attribute name="phoneNumber"><![CDATA[(531) 363-3543]]></attribute>
    <attribute name="name"><![CDATA[Department4]]></attribute>
    <attribute name="departments"><![CDATA[2]]></attribute>
  </segment>
  <segment id="5" setId="2">
    <attribute name="id"><![CDATA[5]]></attribute>
    <attribute name="phoneNumber"><![CDATA[(620) 421-5978]]></attribute>
    <attribute name="name"><![CDATA[Department5]]></attribute>
    <attribute name="departments"><![CDATA[2]]></attribute>
  </segment>
  <segment id="6" setId="2">
    <attribute name="id"><![CDATA[6]]></attribute>
    <attribute name="phoneNumber"><![CDATA[(294) 629-3232]]></attribute>
    <attribute name="name"><![CDATA[Department6]]></attribute>
    <attribute name="departments"><![CDATA[2]]></attribute>
  </segment>
  <segment id="7" setId="3">
    <attribute name="id"><![CDATA[7]]></attribute>
    <attribute name="phoneNumber"><![CDATA[(530) 667-9008]]></attribute>
    <attribute name="name"><![CDATA[Department7]]></attribute>
    <attribute name="departments"><![CDATA[3]]></attribute>
  </segment>
  <segment id="8" setId="3">
    <attribute name="id"><![CDATA[8]]></attribute>
    <attribute name="phoneNumber"><![CDATA[(771) 738-5758]]></attribute>
    <attribute name="name"><![CDATA[Department8]]></attribute>
    <attribute name="departments"><![CDATA[3]]></attribute>
  </segment>
  <segment id="9" setId="3">
    <attribute name="id"><![CDATA[9]]></attribute>
    <attribute name="phoneNumber"><![CDATA[(323) 597-7747]]></attribute>
    <attribute name="name"><![CDATA[Department9]]></attribute>
    <attribute name="departments"><![CDATA[3]]></attribute>
  </segment>
</segments>