Description

The JSONFileV2Receiver receives data from a given GenRocket Domain and writes the data out to a file in JSON format.


Note: This particular JSON Receiver does not allow for nested elements.


Parameters

The following parameters can be defined for the JSONFileV2Receiver. Items with an asterisk (*) are required. 

  • path* - Defines the location to store the newly generated JSON output file.
  • subDir - Defines the subdirectory where the output file will be stored.
  • fileName* - Defines the name of the output file.
  • rootElementName - Defines the root element of the JSON structure.


Receiver Attribute Property Keys

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

  • Column Name - Defines the column name of the JSON attribute.
  • Include - Determines if the column should be included or excluded from the insert statement.
  • useQuotes - Determines if a value should be quoted. Sometimes a numeric value should be quoted (e.g. SSN).


The example image below shows the property key view for the set of Attributes of a Domain using the JSONFileV2Receiver. 



Example Stories

The example stories below, show different use cases where the JSONFileV2Receiver is used to write data out to a file in JSON format. In some cases, the parameters or property key values determine the behavior of the Receiver and how or if this data is written to the generated JSON file. 


Story 1 - Generating a JSON Output File

This story demonstrates how to output data to a JSON file for a User Domain with the following Attributes:
 


Parameter Configuration

For this example, only the required parameters (resourcePath and fileName) will be configured. The parameter configuration will appear as shown below: 



Example Output

The following is an example JSON output file for the User Domain, Attributes, and Parameter Configuration shown above.


{
  "users" : [
    {
      "id" : "1",
      "firstName" : "Alexa",
      "lastName" : "Topete",
      "middleInitial" : "G",
      "username" : "user1",
      "password" : "C4CA4238A0B923820DCC509A6F75849B",
      "phoneNumber" : "(308) 575-6657"
    },
    {
      "id" : "2",
      "firstName" : "Sibyl",
      "lastName" : "Epstein",
      "middleInitial" : "T",
      "username" : "user2",
      "password" : "C81E728D9D4C2F636F067F89CC14862C",
      "phoneNumber" : "(739) 798-3806"
    },
    {
      "id" : "3",
      "firstName" : "Norman",
      "lastName" : "Marini",
      "middleInitial" : "P",
      "username" : "user3",
      "password" : "ECCBC87E4B5CE2FE28308FD9F2A7BAF3",
      "phoneNumber" : "(616) 545-8376"
    }
  ]
}
Text