File Emit Service (com.ibi.agents.XDFileEmitAgent)

Syntax:

com.ibi.agents.XDFileEmitAgent

iIT Service Object:

emit: File Emit Agent

file: File Emit Agent

Description:

This service writes the contents of the current document or other specified information to the file system. The source specification can be blank or can specify any iWay expression, including XPATH(). If the document is XML and the xpath() function is specified, each value meeting the XPATH() criteria is written as a file. The assigned names are allocated sequentially based on the entered pattern.

Parameters:

Parameter

Description

Source of Data

Determines the source of data to emit. If you require a document to be emitted, then enter the corresponding system path for this document. If no value is specified, then the current document is used by default. You can also specify an iWay expression, including the xpath() function to specify a data source location (for example, if an XML document is used).

Target Directory *

The target output directory.

File Pattern *

The file name pattern. In the pattern, an asterisk (*) character is replaced by the current timestamp. So T*.out might become T2002-06- 25_12:02:24:43.out. A # character is considered a unique number. The number of # characters controls the length.

Avoid Preemitter

If a preemitter exists on this route for output, this allows it to be bypassed for this emit operation. Perform this action to enable the output file to include non-processed (raw) information. Select one of the following options from the drop-down list:

  • true (default)
  • false

Return

Select one of the following options from the drop-down list:

  • status (default). Status document will be the output document.
  • input. Input document will become the output document.
  • swap. As input, but replace written data in the source nodes with the file name to which the data was written.

Base64 Decode

If set, the value is assumed to be in base64 notation. Only applicable if a specific write value is specified. Select one of the following options from the drop-down list:

  • true
  • false (default)

Respect Transactionality *

If set, the emit respects the transactionality of the channel. If not set, the file is always written. Select one of the following options from the drop-down list:

  • true
  • false (default)

Call at EOS?

In a streaming environment, EOS (End of Stream) is the short message that is sent after the last document, which signifies the EOS. This parameter determines whether this service should be called for the EOS message. The default value is false.

Edges:

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

Line Edge

Description

OnError

Error

OnSuccess

Success

OnFailure

Failure

OnCustom

  • OnError
  • OnSuccess
  • OnFailure
  • fail_parse
  • fail_operation
  • notfound

Example:

The following is an example of configuration settings for a File Emit service object in iIT Designer:

If your connection parameters are valid, after running a process flow with the File Emit service, you will find the incoming document from your process flow copied to the target directory (for example, c:/out), with its name formatted according to the value that was specified for the File Pattern parameter (for example, testsvc[date/time mask].xml). The return document of the process flow would be an update from running the service, which indicates that the File Emit service worked successfully. For example:

<?xml version="1.0" encoding="UTF-8" ?>
<emitstatus status="0">
<protocol>FILE</protocol>
<parms>
  <parm name="directory">c:/out</parm>
  <parm name="return">status</parm>
  <parm name="wanteos">false</parm>
  <parm name="pattern">testsrvc*.xml</parm>
  <parm name="b64">false</parm>
  <parm name="trans">false</parm>
  <parm name="nopreemit">true</parm>
</parms>
<timestamp>2009-05-04T22:16:39.566Z</timestamp>
<status>0</status>
<count>1</count>
<name>c:\out\testsrvc2009-05-04T22_16_39.551Z.xml</name>
</emitstatus>