File XML Input Adapter

Adapter type: xml_in. The File XML Input adapter reads a file in XML format.

This adapter polls for new data appended to a file, and supports schema discovery.

If you use the CCL ATTACH ADAPTER statement to attach an adapter, you must supply the adapter type.

Sample record format for the data file:
<Trades Id="0" Symbol="EBAY" TradeTime="2000-05-04T12:00:00" Price="140.0" Shares="50" />
<Trades Id="1" Symbol="EBAY" TradeTime="2000-05-04T12:00:01" Price="150.0" Shares="500" />
Sample record format for the data file with an opcode:
<Trades ESP_OPS="i" Id="0" Symbol="EBAY" TradeTime="2000-05-04T12:00:00" Price="140.0" Shares="50" />
Note: To insert a record, specify ESP_OPS="i". To update a record, specify ESP_OPS="u". To delete a record, specify ESP_OPS="d". If no opcode is specified, the record is interpreted as an upsert.
Property Label Description
Directory

Property ID: dir

Type: directory

(Required for adapter use and schema discovery) Specify the absolute path to the data files you want the adapter to read. For example, <username>/<folder name>. No default value.

Use a forward slash for both UNIX and Windows paths.

File (in Directory)

Property ID: file

Type: tables

(Required) File to which the adapter writes data. No default value.

Match Stream Name

Property ID: matchStreamName

Type: boolean

(Optional) If true, XML element name is matched against the stream name. Unmatched messages are discarded. Default value is false.

Repeat Count

Property ID: repeatCount

Type: uint

(Optional) Number of times the input data is repeated. If set to -1, the input data is repeated indefinitely. Default value is 0.
Note: You can use this parameter to test a continuous streaming source.
Repeat Field

Property ID: repeatField

Type: string

(Optional) Determines which numeric field's values are bumped on each repeat. Default value is a hyphen (-).
  • If repeatCount has a nonzero value, specify the stream column name.
  • If the repeatColumn is a key column in the stream, ensure there are no duplicates when specifying multiple rows in the input file.
  • If the adapter is attached to a window, the repeatField must be a key column.
Directory (runtime)

Property ID: runtimeDir

Type: runtimeDirectory

(Advanced) Location of the data files at runtime, if different from discovery time. No default value.

File Pattern

Property ID: filePattern

Type: string

(Advanced) Pattern used to look up files for discovery. Default value is *.xml

.
Poll Period (seconds)

Property ID: pollperiod

Type: uint

(Advanced) Period for polling new contents, in seconds. Default value is 0.

Convert to Safe Opcodes

Property ID: safeOps

Type: boolean

(Advanced) Converts the opcodes INSERT and UPDATE to UPSERT. Converts DELETE to SAFEDELETE. Default value is false.

Skip Deletes

Property ID: skipDels

Type: boolean

(Advanced) Skips the rows with opcodes DELETE or SAFEDELETE. Default value is false.

Date Format

Property ID: dateFormat

Type: string

(Advanced) Format string for parsing data values. Default value is %Y-%m-%dT%H:%M:%S.

Timestamp Format

Property ID: timestampFormat

Type: string

(Advanced) Format string for parsing timestamp values. Default value is %Y-%m-%dT%H:%M:%S

.
Block Size

Property ID: blockSize

Type: int

(Advanced) Determines the number of records to block into one pseudotransaction. Default value is 1

.

Use Envelopes

Property ID: useEnvelopes

Type: boolean

(Advanced) Specify the block type the adapter uses to pass data to the engine. If you specify a blockSize property greater than zero, by default, the adapter packages rows into transaction blocks to send to the engine. To get the adapter to package rows into envelope blocks instead, set this property to true. Default value is false.

Field Mapping

Property ID: permutation

Type: permutation

Mapping between Event Stream Processor and external fields, for example:

<esp_columnname>=<database_columnname>:<esp_columnname>=<database_columnname>. No default value.

PropertySet

Property ID:propertyset

Type: string

(Advanced) Specifies the name of the property set. Property sets are reusable sets of properties that are stored in the project configuration file. Using these sets allows you to move adapter configuration properties out of the CCL file and into the CCR file. If you specify the same properties in the project configuration file and the ATTACH ADAPTER statement, the values in the property set override the values defined in the ATTACH ADAPTER statement. No default value.

Known limitations:

Related reference
Adapter Support for Schema Discovery