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 rootNode must be of type Event eventNode.

CSV

  • CSV columns are represented by the Node Type Variable variableNode. 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:

Example Model to CSV

JSON

Here is an example of the Information Model and how the data is written to the JSON file:

Example Model to JSON

XML

  • Attributes of the XML file are represented by the Node Type Property propertyNode.

  • In order to assign attributes to elements in the Information Model, the element Node Type variableNode must be a Custom Data Type.

  • Writing list structures to a XML file requires a List listNode in the Information Model.

Here is an example of the Information Model and how the data is written to the XML file:

Example Model to XML

Configuration

  1. Ensure the root model node is selected in the Information Model.

  2. 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.

CSVConfiguration
  1. Select the Event node in the Information Model.

  2. Enable the checkbox Event context

  3. (Optional) Enable Append to append data to the file. If this option is disabled, the existing file will be overwritten.

  4. 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 as T{yyyy-MM-dd_HH-mm}.

CSVConfiguration

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.