Transformations > Velocity transformation > Velocity transformation input format
  

Velocity transformation input format

You configure the format of the incoming data on the Input Format tab. Configure input format properties such as the input field and type, the format of the data that you want to convert, and the variable name that refers to the data in the template. If the data to be converted is binary data or is in a file, you also select the code page.
The following table describes the file input format properties:
Property
Description
Input Field
Field in the upstream transformation that contains the input for the Velocity transformation. The field that you select must contain either the data to be converted or the file path and name of the flat file that contains the data.
Since the input to the transformation must be character or binary data, this field displays only string, text, and binary fields from the upstream transformation.
Input Type
Type of data in the selected input field. Select one of the following input types:
  • - Buffer. Select this option when the input field contains the data that you want to convert such as a JSON BLOB or XML string.
  • - File. Select this option when the input field contains the path to a flat file that contains the data to be converted.
Format Type
Format type of the data that you want to process, either JSON or XML.
Variable Name in Template
The variable that you define in the template to refer to the data to be processed. Do not include a leading dollar sign or other special character.
For example, in the following template, the variable name "root" is used to refer to the data to be processed:
<xml>
#foreach ($child in $root.getRootElement().getChildren() )
<$child.getChild("name").getText()>
<id>$child.getChild("id").getText()</id>
<size>$child.getChild("size").getText()</size>
</$child.getChild("name").getText()>
#end
</xml>
The following table describes the file input format advanced property:
Property
Description
Code Page
Code page of the data that you want to convert. This field is enabled if the input type is File or if the input field contains binary data.
Select a code page if the code page of the data that you want to convert differs from the code page of the Secure Agent machine. Otherwise, select Default.

Source configuration for file sources

If you configure the Velocity transformation to read data from a file, configure the Source transformation to read data from a single, delimited flat file and configure the formatting options. The flat file must contain the file path on one line.
For example, the following text shows the contents of a source file that reads data from an XML file named Products.xml:
C:\IICS_XML_SourceFiles\Products.xml
To configure the Source transformation formatting options, complete the following steps:
  1. 1On the Source tab, select the file that contains the file path as the source object, and then click Formatting Options.
  2. 2In the Formatting Options dialog box, ensure that the flat file type is Delimited, and configure the following properties:
  3. Property
    Value
    Text Qualifier
    None
    Field Labels
    Auto-generate
    First Data Row
    1
  4. 3Click OK.