Description

The SegmentDataCreatorReceiver morphs a Domain's generated data into name/value pair XML segments. It 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. 


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. 


 

In This Article


When Should This Receiver Be Used? 

  • Any time a user needs to generate segments of data for individual Domains and merge those segments to generate a nested file output (e.g., JSON, XML, Delimited Files, Fixed Files, etc.).

  • This Receiver is automatically added to the required Domains when using specific import methods (e.g., JSON, XSD, Spark Schema).

  • This Receiver is automatically added to created EDI Project Domains for merging with the EDISegmentMergeReceiver.

How Does this Receiver Work? 

  1. Add the SegmentDataCreatorReceiver to any Domain that needs to generate segments of data. 
  2. Create a Merge Domain and add the desired SegmentMergeReceiver (see next section).
  3. Create a Configuration File and any other files required by the added SegmentMergeReceiver.
  4. Download the required files and run the command at the command line to generate test data.

What Merge Receivers Work with this Receiver?

Here are the current GenRocket MergeReceivers that use segment-generated XML files:


Merge Receiver Name

Description

AvroSegmentMergeReceiverMerges data from two or more Domains into nested Avro file format
CEFFileSegmentMergeReceiver
Merges data from two or more Domains into one or more Common Event Format (CEF) files. 
DelimitedFileSegmentMergeReceiverMerges the data from two or more domains into a single delimited file. 
FixedDelimitedSegmentMergeReceiverMerges data from two or more Domains into one or more Fixed file delimited formatted output files.
FixedFileSegmentMergeReceiver
Merges the data from two or more Domains into one or more Fixed file formatted output files.
HL7SegmentMergeReceiverMerges data from two or more Domains into HL7 formatted output.
JSONSegmentMergeReceiver
Merges data from two or more Domains into one or more nested JSON formatted files.
ParquetSegementMergeReceiver
Merges data from two or more Domains to generate complex nested Parquet output. 
ParquetSegmentMergeV2Receiver
Merges data from two or more Domains to generate complex nested Parquet output.
SOAPSegmentMergeReceiver
Merges from two or more Domains into a complex nested XML payload that is sent to an endpoint via SOAP request. 
SWIFTSegmentMergeReceiverMerges two or more Domains into one or more SWIFT format files. 
XMLSegmentMergeReceiver
Merges from two or more Domains into one or more nested XML formatted files.
EDISegmentMergeReceiverMerges multiple segment data into EDI formatted output. 
PartitionFileMergeReceiverMerges non-nested partitioned data from many files into one file. 



Receiver 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 they want data to be generated:  

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


The user adds the SegmentDataCreatorReceiver to each Domain to generate the data segments. Within a Merge Domain, the user adds a SegmentMergeReceiver (e.g., XML, JSON, Delimited File), which will then merge those data segments into a nested output format. 


Below are example segment files that will be merged:


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>