File Read Service (com.ibi.agents.XDFileReadAgent)

Syntax:

com.ibi.agents.XDFileReadAgent

iIT Service Object:

file: File Read Agent

read: File Read Agent

Description:

The local file input accepts a request to read a file from the local file system and outputs this request as an XDTextDocument. The transform business service and standard output can accept and operate upon this output. The input business service can operate on flat or XML data, and can emit data in either form.

Parameters:

Parameter

Description

File Name Tag *

Tag of input document whose value is the file name to read. The input document must be:

<filename>pathToFile</filename>

This assumes that the tagname is set to filename. If the input format is XML or an entag parameter is used, the output is in XML form. Otherwise, the output is a flat document.

Note: The File Read Service assumes that the input data format is flat by default, or if the entag option is set to any value even if the XML input data format is selected.

Base Path

Optional directory to be used if the incoming name is not absolute.

Input Data Format

Format of the input data. Select one of the following options from the drop-down list:

  • flat (default)
  • XML

Enclose Tag

The name of the tag in which to enclose that data that is read. If omitted, no tagging is performed. If used, the output is XML.

Encoding

Encoding to be performed on the input. Can be as is or base64. If omitted, no encoding is performed.

Delete After Read

Determines whether the file is deleted after it is read. Select one of the following options from the drop-down list:

  • true (default)
  • false

Edges:

The following table lists the available line edges for the File Read Service (com.ibi.agents.XDFileReadAgent).

Line Edge

Description

OnError

Error

OnSuccess

Success

OnFailure

Failure

OnCustom

  • OnError
  • OnSuccess
  • OnFailure
  • locked
  • directory
  • notfound
  • fail_parse
  • fail_operation

Example:

To configure a File Read service, you must specify the tag name that contains the path to the file you want to read. The following is an example of configuration settings for a File Read service object in iIT Designer. This example assumes that the path to the file is contained within the <Test> tag of the incoming document:

Run this service with a document such as the following:

<Test>c:/out/input.xml</Test>

The contents of the input.xml file will be received as the output.