Output Control File
The rules defined in the output control file are applied after the data is generated. This allows auxiliary features to be applied before generating the output data files. It’s particularly useful when Unicode or special characters are used in the user’s data model.
The output control file provides the user with two capabilities: replacing names and hiding properties. To define an output control file, you can apply the following properties:
- name: [required] A string used as an identifier for the output control file.
- entities: [required] A list of entities to be finalized.
- extra: A optional plugin configuration to generate an additional output file.
Entities In Output Control File
For each entity, an alias can be defined in the output control file. Additionally, an alias can be defined for any property within the entity. Furthermore, properties can be hidden in the output files. Each entry for entities includes the following properties:
- name: [required] The name of the entity.
- alias: An alternative name for the entity.
- properties: A list of property specifications that drill down into the rules applying to individual properties.
The entry for properties includes the following properties:
- name: [required] The name of the target property.
- hide: A boolean value (default is false). When set, the data of target property is excluded in the output files.
- alias: An alternative name for the property.
- Name Replacement
- Property Hiding
# Replace the entity name ‘businessAccount’ with ‘account’
# Replace the property name ‘extId’ with ‘external_id’
name: "name_replacement"
entities:
- name: "businessAccount"
alias: "account"
properties:
- name: "extId"
alias: "external_id"
# Hide the property ‘accountRefId’ in the entity ‘contact’
name: "property_hiding"
entities:
- name: "contact"
properties:
- name: "accountRefId"
hide: true
Extra Output File
Text Configuration
The value of extra
property is a text configuration. Please make sure have a pipe |
at the start of its value.
Post Processed
The extra file generation is through a post process plugin. All the hidden and alias defined in the previous section aren't honored in the extra file.
Apart from the files presenting the generated data, an extra output file can be generated by defining an extra
property.
The extra file may contain any data generated or user uploaded. Through configuration, one of the following two files can be created:
- extra.csv: A CSV file containing partial of full data of an entity and user defined constants. It's typically used to generate
my_data
file of another data order. - extra.json: A JSON file containing partial of full data of one and more entities and user defined constants. It's typically used to generate json payload of API endpoints.
Property extra
contains the following properties:
- type: [required] The type of the extra file to be generated. It can be either
csv
orjson
. - content: [required] content to be included in the extra file. It contains a list of content items.
- Sample CSV Format Extra File Config
- Sample JSON Format Extra File Config
# Generate two column csv file with the same row of entity entity1
# Sample output
# firstName, constant1
# James, hello
# Kitty, hello
extra: |
type: csv
content:
- label: "constant1"
valueType: "text"
value: "hello"
- value: "entity1"
valueType: "entity"
properties:
- name: "first_name"
label: "firstName"
# Generate JSON object with the following structure:
# {
# "data": {
# "status": "active",
# "names": [
# {
# "firstName": "James"
# },
# {
# "firstName": "Kitty"
# }
# ]
# }
# }
extra: |
type: json
content:
- label: "data.names"
valueType: "entity"
value: "entity1"
properties:
- name: "first_name"
label: "firstName"
- label: "data.status"
valueType: "text"
value: "active"
Content Item
Each content item includes the following properties:
- label: The label of content item. It's used only for user defined value or json entity value.
- valueType: The type of the value. For user defined constant values the type can be
text
,boolean
andnumber
. For entity values, the type has to beentity
required. - value: The value applied to the content item. For user defined constant value, it is the string format of the value. For entity values, it's the entity name.
- properties: used only when defining entity values. It contains a list of properties which are included in the extra file.
Label
For csv file output, the label is used as column header. For entity type data, since each property name will be used as column header, its label value is ignored.
For json file output, the label is used to define hierarchy of the json object. The parent and child relationship is defined through dot operator. For example label parent.child
will create a json object parent
with a child object child
.
Properties
It used to list properties to be included in the extra file. By default, all the properties of the given entity are included in the extra file. However, if only a subset of properties are required, they can be defined in the properties
list.
Each item of the properties
list includes the following properties:
- name: [required] The name of the target property.
- label: The label to be used for this property in the extra file. If not provided, the property name is used.