File Definition Within Crosswalk
Creating a file definition using a JSON object allows creating structure to outbound files or defining the type of file that we expect from inbound files.
Generating
A JSON file can be used to define the file structure for our outbound files. This can be done using the Crosswalk function and the Merge and Translate to File widget.
Create a JSON object defining the file structure required.
Example:
{ "Delimiter": ",", "Columns": [ { "name": "code", "header": "Code", "dataType": "string" }, { "name": "codeType", "header": "Code Type", "dataType": "string" }, { "name": "codeDescription", "header": "Code Description", "dataType": "string" } ], "RowDelimiter": "LF" }
Add a Crosswalk to enter the file definition created (JSON). For further details on how to add a Crosswalk, refer to Section : “Adding a Crosswalk”.
In the flow, insert the Merge and Translate to File widget.
Fill in the configuration fields with the information from the generated crosswalk.
fileDefinitionEntityType: Enter String.
fileDefinitionId: Enter the crosswalk Definition ID.
fileDefinitionVersion: Enter the Definition Version.
Fill the the other configuration fields and click Save.
The file generated will output in the Merged port.
Ingesting
A JSON file can be used to define the type of file we will expect from a specific stakeholder. This can be done using the Crosswalk function and the Parse With File Definition widget.
Create a JSON object defining the file type expected.
Example:
{ "Delimiter": ",", "Columns": [ { "name": "code", "header": "Code", "dataType": "string" }, { "name": "codeType", "header": "Code Type", "dataType": "string" }, { "name": "codeDescription", "header": "Code Description", "dataType": "string" } ], "RowDelimiter": "LF" }
Add a Crosswalk to enter the file definition created (JSON). For further details on how to add a Crosswalk, refer to Section : “Adding a Crosswalk”.
In the flow, insert the Parse With File Definition widget.
Fill in the configuration fields with the information from the generated crosswalk.
fileDefinitionEntityType: Enter String.
fileDefinitionId: Enter the crosswalk Definition ID.
fileDefinitionVersion: Enter the Definition Version.
Fill the the other configuration fields and click Save.