Description

When a Scenario is run, the generated output will be in a single file that contains every record for most configured Receivers. The Dynamic File and Directory Configuration feature allows you to customize the following for select Receivers: 

  • The number of records in each generated Output file.
  • The number of files in each generated Output Subdirectory.
  • The naming convention of the Output File.
  • The naming convention of the Output Subdirectory.



What are the File and Directory Configuration Tabs?

These configuration tabs can be used to dynamically configure the number of records per generated file and the number of files within each generated directory when a Scenario is run. The number of generated files and directories depends on the following: 

  • loopCount value for the Domain
  • File and Directory Tab Configurations


Apart from that, you can also configure the naming of your output file and output sub-directory.


When should you use the File and Directory Configuration Tabs? 

  • These configuration tabs should be used when you want the generated records to be placed in multiple files and the files to be placed in one or more directories. 

  • These configuration tabs should be used when you want the name of the output files and output sub-directories to be dynamic.


How do you use the File and Directory Configuration Tabs? 

  1. Select the File or Directory Configuration Tab
  2. Select a creation event (no event, random, constant, or reference) 
  3. Configure the Parameters for the creation event 
  4. Configure the Naming Convention for the file or directory
  5. Download and Run the Scenario


Note: This feature has not been implemented for all Receivers at this time. The following Receivers currently have this functionality:

  • XMLFileReceiver
  • JSONFileReceiver
  • DelimitedFileReceiver
  • ExcelFileReceiver
  • SQLFileInsertReceiver
  • FixedFileReceiver
  • ParquetFileReceiver


In This Article


File and Directory Configuration Options

The File and Directory Config Tabs are used to configure what event will trigger file/directory creation and the naming configuration for generated files/directories. Four options are provided for the creation event: 

  • No Event - The value defined within the Receiver Parameters will be used.
  • Random - Each time the count reaches the chosen random value, it triggers the creation event and afterwards determines a new random value. 
    • startRange - The lowest number of records/files that will be in a file/directory. 
    • endRange - The highest number of records/files that will be in a file/directory.
    • seed - The same number of files/directories will be generated each time when a seed value is entered.

  • Constant - Each time the count reaches the defined value, it triggers the creation event and afterward starts the counter again.
    • count - The create event is triggered each time the number of records/files matches the entered value.
  • Reference - References an Attribute that must return a true/false value to trigger the creation event.
    • booleanReference - The create event is triggered each time "true" is returned. 


The image below shows a Random Dynamic File Configuration:


File and Directory Name Configuration Options

File and Directory Names can have up to 10 items within the configuration. The following options are provided for each configuration line: 

  • Constant - A constant value that will be part of the file/directory name. 
  • Counter - A value that increases by 1 for each file/directory that is created.
  • Timestamp - A timestamp that will be part of the file/directory name. 
  • Reference - References a Domain Attribute that will be part of the file/directory name.



Important: The final configuration line for files must be the File Extension. In the example below it is .txt because delimited files are being created.



Example File and Directory Configurations

For each of the examples in this section, the loopCount for a User Domain has been set to 10,000 records.



The DelimitedFileReceiver will be used for all provided examples.



Example 1: 100 to 200 Records per File and 10 Files per Directory

In this example the Random radio button has been selected. The range is between 100 and 200 records, which means that each file will have a number of records between this set number range.


The file name will have this naming convention: sample-1.txt, sample-2.txt, sample-3.txt,...


In this example, the Constant radio button has been selected for the directory configuration. Each File Directory will contain 10 files and be named accordingly: Users-1, Users-2, Users-3,...., Users-9, and Users-10. 



Sample Output

7 File Directories are created with this naming convention: Users-1, Users-2, etc.



Users-1 contains 10 files with this naming convention: Sample-1.txt, Sample-2.txt, etc..



Sample-1.txt contains 149 records. Each file will have somewhere between 100 and 200 records according to the startRange and endRange Parameters within the file configuration. 



The last directory (Users-7) will hold the remaining files, which is 9 files in this example. 




Example 2: 200 Records per File and 5 to 10 Files per Directory

In this example the Constant radio button has been selected for the file configuration and a value of 200 has been entered. Each time the count reaches the defined value, it triggers the creation event and afterward starts the counter again. 



The Random radio button has been selected for the directory configuration. The range has been configured to be between 5 and 10 directories. 



Sample Output

For this example, 8 file directories were created and contain a total of 50 files.


The Users-1 directory contains 8 files:


The Users-6 directory contains 6 files:


The Users-8 directory contains 2 files. The last directory will contain the remaining or left over files.


Each file contains 200 records and the last file will contain the remaining record count. Sample-1.txt is shown below:


Example 3: Reference Boolean True/False Attribute and 200 Files per Directory

In this example the Reference radio button has been selected. It will reference a Boolean Attribute titled "booleanValue". With this option, the file creation event will be triggered when a record has a "True" value. 



The Constant radio button has been selected for the directory configuration. A new directory will be created for ever 200 files. 



Sample Output


In this example, 25 Users directories are created. 



Each directory will contain 200 files with the final directory containing the remaining files and records: 



The Reference file configuration option will trigger file creation each time a "True" value is generated by the referenced Attribute. Sample-1.txt has 2 records in it. 



The record that triggers file creation will be in the next file. Sample-2.txt is shown below: 



The fourth record also had a "True" Boolean value and is in Sample-3.txt: