File Writer¶
Characteristics¶
The File Writer writes data to a file in CSV, JSON, or XML format.
The data can be written to the file in either append mode or overwrite mode.
The File Writer can be used for different file formats like CSV, JSON and XML
Information Model Requirements¶
The first Node after the root node must be of type Event .
CSV¶
CSV columns are represented by the Node Type Variable . Note that the order of the Variables in the Information Model determines the order of the columns in the produced CSV file.
Here is an example of the Information Model and how the data is written to the CSV file:
JSON¶
The key-value pairs are represented by the Node Type Variable .
Objects require Variables of Custom Data Type.
Writing list structures to a JSON file requires a List .
Here is an example of the Information Model and how the data is written to the JSON file:
XML¶
Attributes of the XML file are represented by the Node Type Property .
In order to assign attributes to elements in the Information Model, the element Node Type must be a Custom Data Type.
Writing list structures to a XML file requires a List in the Information Model.
Here is an example of the Information Model and how the data is written to the XML file:
Configuration¶
Ensure the root model node is selected in the Information Model.
Enter a path for the location where the file should be written.
Note
If a path is entered without any slashes, it is interpreted as the name of a directory to be created within the deployed Instance.
Select the Event node in the Information Model.
Enable the checkbox Event context
(Optional) Enable Append to append data to the file. If this option is disabled, the existing file will be overwritten.
Enter a Formatter for the file name. Placeholders can be used to dynamically name the file. A placeholder can be a value from the variable itself, such as
${Timestamp}
, or it can be a direct timestamp format, such asT{yyyy-MM-dd_HH-mm}
.
Note
If the file name changes, a new file will be created. For example, if the minute changes and a timestamp is part of the formatter, a new file will be generated.