Available Iterators

In this section:

 

There are many available iterators, each performing some process and then passing the appropriate document into the loop and to the end of the loop. The following table lists and describes the most commonly used iterators.

Iterator

Description

Attachment

Passes each attachment to the document (perhaps from an incoming HTTP or mail message) through the loop.

Chunk

Splits the input document into equally sized chunks.

Condition

Evaluates an iWay Functional Language (iFL) expression as either a do-while or do-until construction.

Counter

Passes a document through the loop a specified number of times.

Delimited Value (DelVal)

Generates one row of XML at a time from a delimited value input (for example, a comma separated value file.)

FTP Emit

Emits through the FTP protocol to a specified host:port using various FTP commands.

Island

Iterates a loop for each EDA island within the document and inserts the response text.

Iter RVI Relay

Relays messages for external execution.

Line

Pass each line of a text format input one at a time through the iterator. Lines end on terminator characters.

SQL Batch Insert

Reads SQL rows one at a time and inserts results from the process flow.

SQL Select

Each row from an SQL select operation is passed through the loop. The iterator can perform a batch update operation providing an Extract/Transform/Load operation within the process flow.

Sibling

Iterates a loop for each sibling document.

Test

Similar to the test node in a process flow and the condition iterator, it acts as a condition Do-While or Do-Until. It offers an extended range of comparisons, such as is empty or is equal ignore case.

XMLSplit

An incoming XML message is split on an XPath and each split portion is passed through the loop. It is commonly used to extract repeating elements from the incoming document, such that each can be processed individually.

Other iterators perform specialized operations, such as handling portions of very large documents and passing portions of messages to other processors (configurations) through the Gateway protocol.


Top of page

x
Attachment Iterator (com.ibi.agents.XDIterAttachments)

Syntax:

com.ibi.agents.XDIterAttachments

Description:

The Attachment Iterator handles each attachment of the current document iteratively.

Parameters:

Parameter

Description

Handling Option

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

  • delete. Removes each attachment from the current document after processing.
  • replace. Replaces the original attachment with the modified document.
  • leave. Leaves the original attachments unchanged. This option is selected by default.

Start Index

Index of first attachment to process in the mail object. The first attachment to the main document has index 0.

Header Namespace

Special register namespace where MIME headers for the current attachment will be stored. If the replace option is selected for the Handling Option parameter, then registers in this namespace will be added to the replaced attachment.

Main Body Part Header Namespace

If the current attachment is itself a Multipart, this is the special register namespace where the MIME headers for the main body part will be stored.

Keep Document Flat

Determines whether to keep the body of the document as an array of bytes. This parameter is set to false by default.


Top of page

x
Chunk Iterator (com.ibi.agents.XDIterChunk)

Syntax:

com.ibi.agents.XDIterChunk

Description:

The Chunk Iterator splits the input document into equally sized chunks. The input stream may come from one of the streaming components, for example, a File listener set for streaming, or a File Read service configured with a stream format. The chunk is passed as a flat document containing bytes, which can be manipulated within the process flow.

Parameters:

Parameter

Description

Chunk Size

The size of the chunk in bytes. The default value is 8192.


Top of page

x
Condition Iterator (com.ibi.agents.XDIterCond)

Syntax:

com.ibi.agents.XDIterCond

Description:

The Condition Iterator is used to iterate a loop while (or until) a specified condition is met.

Parameters:

Parameter

Description

Conditional Expression

Expression controlling the termination of the loop.

Iterate Rule

Determines the loop logic between do-while or do-until. This parameter is set to true by default.

Interim Document

The document emitted at each iteration is the original document or the result of the previous iteration. By default, transient is selected.

Output Document

Final document emitted is a status document, the original document, the result of the last iteration or an accumulation. Accumulations are memory intensive. By default, status is selected.


Top of page

x
Counter Iterator (com.ibi.agents.XDIterCount)

Syntax:

com.ibi.agents.XDIterCount

Description:

The Counter Iterator is used to iterate a loop a specified number of times. This number can be constant or computed at run time, for instance, with an XPath expression, as in this example. The inner part of the loop can be used to generate multiple outputs, read multiple inputs from a source, or perform any other operation repeatedly. The Counter Iterator can also be used with conditional logic to add retry functionality to an adapter that does not natively support retry. The number of iterations of the loop is not dependent on the structure of the input document, nor does the count iterator parse the document before injecting it into the loop.

Parameters:

Parameter

Description

Iterations

The number of times this iterator loop is to be repeated. The default value is 1.

Interim Document

The document emitted at each iteration is the original document or the result of the previous iteration. By default, transient is selected.

Output Document

Final document emitted is a status document, the original document, the result of the last iteration or an accumulation. Accumulations are memory intensive. By default, status is selected.

Example:

The Counter Iterator in this example passes the input document into the loop the number of times specified by the <count> XML tag in the input document.

Input Document:

<IterCountTest>
   <count>3</count>
</IterCountTest>

Output Document(s):

In this example, three documents are output by the FileWrite object:

<?xml version="1.0" encoding="UTF-16"?>
<IterCountTest>
   <count>3</count>
</IterCountTest>

Top of page

x
Delimited Value Iterator (com.ibi.agents.XDIterDelVal)

Syntax:

com.ibi.agents.XDIterDelVal

Description:

Accepts a delimited value input from a stream or flat document, and emits an XML document representing one row at a time to the flow. The first row may be a header row (often called a DIF header) containing names to be applied to the elements of the row representing the column of data in the file.

Parameters:

Parameter

Description

Root name

The element name of the XML root. In the example in this section, the root name was set to myroot.

Dif

Determines whether the first row is a header row. If not (false), then the first row contains data and generated names are used for the elements. If set to true, then the first row holds the names, and the data starts at the second row.

This parameter is set to false by default.

Delimiter

Determines the delimiter to be used. Select, enter one character or a single hex value as \xvv, where vv is a hex value. By default, comma is selected as the delimiter.

Trim values

Determines whether all values should be trimmed. This parameter is set to false by default.

Quotes

Determines whether surrounding quotes should be eliminated. This parameter is set to false by default.

Empty elements

Determines whether empty elements at the right should be eliminated. This parameter is set to false by default.

Output Document

Final document emitted is a status document, the original document, the result of the last iteration or an accumulation. Accumulations are memory intensive. By default, status is selected.

Example:

Consider the following input file:

acol,bcol,ccol
aa1,bb1,cc1
aa2,bb2,cc2,
aa3,bb3,cc3

Three iterations will be emitted. The first will be:

<myroot>
  <row>
     <acol>aa1</acol>
     <bcol>bb1</bcol>
     <ccol>cc1</ccol>
  </row>
</myroot>

The element names are derived from the header row.


Top of page

x
FTP Emit Iterator (com.ibi.agents.XDIterNFTPEmitStdAgent)

Syntax:

com.ibi.agents.XDIterNFTPEmitStdAgent

Description:

The FTP Emit Iterator emits through the FTP protocol to a specified host:port using various FTP commands.

Parameters:

Parameter

Description

Host Parameters

Host Name

DNS name (or IP address) of the FTP server to which you want to connect. Use host:port if not standard port 21.

Remote Port

The port to connect to on the FTP site, blank for default port 21.

User Name

A valid user ID for the FTP server.

Password

A valid password for the FTP server.

Account Name

A valid account name for the FTP server.

Use Passive Command

Uses the PASV command if set to true, otherwise uses the PORT command. This parameter is set to false by default.

Timeout

The timeout interval for the socket in seconds. This parameter is set to 5 by default.

Retry Interval

The retry interval in seconds (allows for xxhxxmxxs format). Leave blank or specify 0 for no retry interval.

Connection Retry

The number of retry attempts after failed connections to the FTP server.

Agent Parameters

Block Size

The size of the transmission block to send. This parameter is set to 256 by default.

Input Source

Input from the document (default) or from an external source (MFT use). This parameter is set to document by default.

Input Expression

If the Input Source parameter is set to external, then specify the file name in this field. For document source, this parameter is ignored.

Remote Site Folder

The folder or directory on the FTP site that you want to use as a starting location after a connection is established. Leave blank for login directory.

File Pattern

The output file pattern (* = timestamp). For example, *.xml, *.txt, and so on. Note *.* is unsupported.

Transfer Mode

When files are transferred in ASCII mode, the transferred data is expected to contain only character formatted text. BINARY mode refers to transferring files as a binary stream of data. Where ASCII mode may use special control characters to format data, BINARY mode transmits the raw bytes of the file being transferred. In this way, the file is transferred in its exact original form. This parameter is set to ascii by default.

Put File Protection

Determines whether the PUT is protected by a rename of a temporary file name. Using the rename protection can result in reduced performance, but can protect against partial updates in the event of an error. This parameter is set to false by default.

Return

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

  • status. The status document will be the output document.
  • original. The original input document will be the output document.

SSL Parameters

Use SSL

If set, then the connection is secured through Secure Sockets Layer (SSL). This parameter is set to false by default.

Security Protocol

The Security protocol:

  • SSL. Supports some version of SSL; may support other versions. This value is selected by default.
  • SSLv2. Supports SSL version 2 and higher.
  • SSLv3. Supports SSL version 3; may support other versions.
  • TLS. Supports some version of TLS; may support other versions.
  • TLSv1. Supports TLS version 1; may support other versions.

This field is not required if the Keystore is a SSL Provider.

Secure Data Connection

Use a secure data connection, for example, to transfer data securely. This is used in conjunction with Secure Control Connection. This parameter is set to false by default.

Use 128-bit Encryption

Enforces the use of 128-bit encryption. This parameter is set to false by default.

SSL Security

The FTP Server connection type:

  • unknown. Defaults to Explicit Security then fails over to Implicit Security. This value is selected by default.
  • explicit. In order to establish the SSL link, explicit security requires that the FTP client issue a specific command to the FTP server after establishing a connection. The default FTP server port is used.
  • implicit. Implicit security automatically begins with an SSL connection as soon as the FTP client connects to an FTP server. In implicit security, the FTP server defines a specific port for the client (typically 990) to be used for secure connections.

Keystore File or Keystore Security Provider

The full path to the Keystore file (which provides certificate material to be used for SSL connections), the name of a Keystore Security Provider, or leave blank to use the configured default Keystore Security Provider.

Keystore Password

The password to access the Keystore file. This is not required if the Keystore File or Keystore Security Provider parameter is set to the name of a Keystore Security Provider.

Keystore Type

The type of Keystore. This is not required if the Keystore File or Keystore Security Provider parameter is set to the name of a Keystore Security Provider.

Site Parameters

Starting SITE command

The SITE command to issue before the transfer of data.

Successful SITE command

The SITE command to issue after the successful transfer of data.

Error SITE command

The SITE command to issue if the transfer of data fails.


Top of page

x
Island Iterator (com.ibi.agents.XDIterIsland)

Syntax:

com.ibi.agents.XDIterIsland

Description:

The Island Iterator is used to iterate a loop for each EDA island within the document and inserts the response text.

The Island Iterator is designed to perform document enhancement, that is, to replace parts of the input XML document with the results of a call to an agent or adapter. Any external data source can be targeted (web services, SQL data, and so on), but in this example embedded file names are replaced with the content of the named disk file. The replacement would behave identical regardless of the source, although the replacement data must be in XML format. Island replacement is iterated for as many tags as are present in the input document. The tags to be replaced may be homogeneous, as in this example, or heterogeneous by using multiple sequential Island iterators that target different sources.

Parameters:

Parameter

Description

Island Identifier

The XML tag, which identifies the island command string.

Snip and Replace

If set to true, the island is replaced with the incoming document arriving on the iteration loop for the island being processed. If set to false, the island node is kept and the incoming document is carried as the first child of the island node. This parameter is set to true by default.

Example:

Input Document

The primary input document is the document that contains the islands to be replaced. In this example, they are identified by the XML tag <file>.

<mydoc>
   <file>file1.txt</file>
   <file>file2.txt</file>
   <file>file3.txt</file>
</mydoc>

file1.txt

<content>Contents of file 1</content>

file2.txt

<content>
<line>Contents of file 2</line>
<line>There are 2 lines</line>
</content>

file3.txt

<content>Contents of file 3</content>

Output Document(s)

The input document and the island documents are combined according to the behavior of the iterator.

<?xml version="1.0" encoding="UTF-8" ?>
<mydoc>
   <content>Contents of file 1</content>
   <content>
      <line>Contents of file 2</line>
      <line>There are 2 lines</line>
   </content>
   <content>Contents of file 3</content>
</mydoc>

Top of page

x
Iter RVI Relay Iterator (com.ibi.agents.XDIterRVIRelay)

Syntax:

com.ibi.agents.XDIterRVIRelay

Description:

The Iter RVI Relay Iterator relays messages for external execution.

Parameters:

Parameter

Description

Service Name

The name of the service to execute the current message.

Tolerance

The amount of time (in seconds) to await circuit availability to access the named service. This parameter is set to 30 by default.

Timeout

The amount of time (in seconds) to await response from the gateway. This parameter is set to 30 by default.

Attempt Retry

If set to true, a retry exception is generated when no gateway connections are available, a message cannot be written to the gateway, or this service times out while awaiting a response. The retry exception will activate the channel’s pending system, when available. If set to false, this service will attempt to acquire a new connection if the message cannot be written to the gateway and, if a connection is available, will retry automatically. If no connections are available, or if the service times out or otherwise fails while reading the response, the service will return a failure edge. This parameter is set to true by default.

Output On Failure

If the relay operation is unsuccessful, this parameter determines whether the agent should return the standard error document, or return its input. If input is selected, then the error document will be stored in the rvi.status register [type: user]. By default, error is selected.

Method of compression to use

The form of compression that should be used on the input. By default, none is selected.


Top of page

x
Line Iterator (com.ibi.agents.XDIterLine)

Syntax:

com.ibi.agents.XDIterLine

Description:

The Line Iterator is used to iterate a loop for each line in the input document. The inner part of the loop can be used to generate multiple outputs, read multiple inputs from a source, or perform any other operation repeatedly. When using this iterator, the number of times through the loop and how the input is parsed is directly related to the structure of the input document, in particular, how many lines are present. It is recommended that non-XML, line-oriented input be read into the process flow with a File object rather than being passed through the Start node.

Parameters:

Parameter

Description

Keep blanks

If set to true, then pass empty (blank) input lines into the loop. This parameter is set to false by default.

Skip Header Lines

Sets the number of lines to be skipped for processing. Often a delimited file has a header row, which is not desired in the process. This parameter is set to 0 by default.

Output Document

Final document emitted is a status document, the original document, the result of the last iteration or an accumulation. Accumulations are memory intensive. By default, status is selected.

Example:

Input Document

This is the first line
This is line 2
Line 3

Output Document(s)

In this example, three documents are output:

This is the first line
This is line 2
Line 3

Top of page

x
SQL Batch Insert Iterator (com.ibi.agents.XDIterSQLBatchAdd)

Syntax:

com.ibi.agents.XDIterSQLBatchAdd

Description:

The SQL Batch Iterator reads SQL rows one at a time and inserts results from the process flow.

Parameters:

Parameter

Description

Source Parameters

Input Provider

The name of the Data Provider that will be used for accessing input.

Select SQL

The SQL Select statement to retrieve rows to pass into the process flow.

Transaction Isolation Level

The transaction isolation level to be set if possible. This parameter is set to asis by default.

Base 64 if Needed

If set to true, all fields are checked for base64. This option is resource-intensive. This parameter is set to false by default.

Input Encoding

The IANA character set to be used for the input database. Select from the standard list, or enter an encoding name. By default, leave is selected.

Format as SQLAgent

If set to true, the generated rows are formatted according to the SQLAgent field schema. This parameter is set to false by default.

Three Part Name

If set to true, the names will be presented as full three part names if supported by the database. This parameter is set to false by default.

Destination Parameters

Output Provider

The name of the Data Provider that will be used for inserting the output.

Output Insert

Output statement to be prepared. Use ?name notation for parameters.

Out Encoding

The IANA character set to be used for the output database. Select from the standard list, or enter an encoding name. By default, leave is selected.

Batch Size

The size of sub-batches. If greater than 0, commit on batch size is reached. This parameter is set to 0 by default.

Commit Sub-batches

If sub-batches are requested, determines whether they should be committed as they update. This parameter is set to false by default.

Fail First

If the first row of the first batch fails, terminate the operation with the fail_insert edge. This parameter is set to false by default.

Omit Test

iWay Functional Language (iFL), which if true, causes the current destination record to be omitted.

Main Parameters

Output document type

Determines whether the emitted output document should be the original input document (original) or a status document (status). By default, status is selected.


Top of page

x
SQL Select Iterator (com.ibi.agents.XDIterSQLSelect)

Syntax:

com.ibi.agents.XDIterSQLSelect

Description:

The SQL Select Iterator sends one row at a time to the process flow.

Parameters:

Parameter

Description

Input Provider

The name of the Data Provider that will be used for accessing input.

Note: You must specify the actual name of this Data Provider as defined during configuration. For example:

DataProviderSQL

Select SQL

The SQL Select statement to retrieve rows to pass into the process flow.

Transaction Isolation Level

The transaction isolation level to be set if possible. This parameter is set to asis by default.

Base 64 if Needed

If set to true, all fields are checked for base64. This option is resource-intensive. This parameter is set to false by default.

Input Encoding

The IANA character set to be used for the input database. Select from the standard list, or enter an encoding name. By default, leave is selected.

Output document type

Determines whether the emitted output document should be the original input document (original) or a status document (status). By default, status is selected.

Format as SQLAgent

If set to true, the generated rows are formatted according to the SQLAgent field schema. This parameter is set to false by default.

Three Part Name

If set to true, the names will be presented as full three part names if supported by the database. This parameter is set to false by default.

Inline xLOBs

If set to true, character and boolean large objects are inline in the select results. BLOBs are enclosed in base64() tags. This parameter is set to false by default.


Top of page

x
Sibling Iterator (com.ibi.agents.XDIterSibSplit)

Syntax:

com.ibi.agents.XDIterSibSplit

Description:

The Sibling Iterator is used to iterate a loop for each sibling document. By bundling sets of rows, siblings make the handling of very large result sets more practical. When used with the IterSibSplit operator, the logic inside the loop is executed once for each sibling document. One result row per sibling document is recommended for this iterator. Because the entire answer set is fetched prior to executing the loop, process flows using this technique may have high memory requirements.

Parameters:

Parameter

Description

Output Document

Final document emitted is a status document, the original document, the result of the last iteration or an accumulation. Accumulations are memory intensive. By default, status is selected.


Top of page

x
Test Iterator (com.ibi.agents.XDIterTest)

Syntax:

com.ibi.agents.XDIterTest

Description:

The Test Iterator is used to iterate a loop while (or until) a condition is met. This iterator repeats the body of the loop while a specified logical comparison evaluates to true. The predicate is reevaluated each time through the loop. The inner part of the loop can be used to generate multiple outputs, read input multiple times from a source, or perform any other operation repeatedly. Similar to the count iterator, the test iterator can be used to retry an operation until it is successful or other criteria are met.

Parameters:

Parameter

Description

Operand One

The first of two operands to compare.

Operation

The comparison operator. This parameter is set to equals case sensitive by default.

Operand Two

The second of two operands to compare when the operation is dyadic.

Iterate Rule

Determines the loop logic between do-while or do-until. This parameter is set to true by default.

Interim Document

The document emitted at each iteration is the original document or the result of the previous iteration. By default, transient is selected.

Output Document

Final document emitted is a status document, the original document, the result of the last iteration or an accumulation. Accumulations are memory intensive. By default, status is selected.


Top of page

x
XML Iterator (com.ibi.agents.XDIterXMLSplit)

Syntax:

com.ibi.agents.XDIterXMLSplit

Description:

The XML Iterator is used to iterate a loop for each portion of an XML document.

Parameters:

Parameter

Description

Snip levels

Determines how many tag levels to trim off of the new XML document, starting from the top (root) node.

A value of 0 preserve all levels. A value of 1 cuts off the root. A value of 2 cuts off the root and immediate child, and so on, down to the XPath location being iterated. The default value is 0, which will return all parent tags up to the root.

Note: Cross Section data may be lost depending on the snip level setting.

Expression

Describes the XPath location of the element on which to split. When the Evaluate Expression is not set (false), enter an XPath expression directly. When the Evaluate Expression is set (true), enter an expression that returns an XPath expression.

Evaluate Expression

When not set, the Expression parameter contains an XPath expression directly. When set, the Expression parameter is evaluated and the returned value is the XPath expression used for splitting. This parameter is set to false by default.

XML Namespace Map Provider

If the XPath expression depends on namespaces, then specify the name of an XML Namespace Map Provider that contains the required namespace prefixes and URLs.

Cross Section

If set to true, the iterated portion is included with the remainder of the non-iterated portion of the document. Otherwise, only the parental path is included. This parameter is set to false by default.

Iterating Document State

In addition to content, a document carries state. This parameter determines how the state should be managed at the iterations. This parameter is set to transient by default.

End Iteration Signal

Determines whether an extra iteration is added at the end to emit the End Iteration document. If applicable, the end of iteration signal will be emitted on the end_iteration edge. The default is not to emit the End Iteration document. This parameter is set to false by default.

Output document

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

  • status. The status document will be the output document.
  • original. The original input document will be the output document.
  • accumulations. Allow gathering of partial documents, but can be memory-intensive. Input is what passes from the iterator, and output is what is returned for each iteration.

XPath Syntax

Determines which syntax level of XPath should be used. The default option selects the syntax level as set in the console global settings. By default, this parameter is set to default.

Example:

Often, a single transaction document contains repeating groups of data, in this example, a simplified invoice with multiple line items. The XML Iterator extracts the repeating group specified by the XPath expression. The parsed document contains the indicated group and preserves its direct parental lineage of XML nodes. If the logic inside your loop needs data from a parallel XML path (the invoice number in this example), then you can set the Cross Section parameter to true. Cross Section will preserve the entire document above the node that is the target of the Expression parameter.

The body of the loop is repeated once for each occurrence of the indicated group. The inner part of the loop can be used to process the repeating groups, call a web service, insert the data into an SQL database, and so on. When using this iterator, the number of times through the loop and how the input is parsed depends on the structure of the input document and the XPath expression.

Input Document

<invoice>
   <invoice-number>1001</invoice-number>
   <line-item>
      <item-number>1</item-number>
      <item-desc>Red Widget</item-desc>
   </line-item>
   <line-item>
      <item-number>2</item-number>
      <item-desc>Blue Widget</item-desc>
   </line-item>
   <line-item>
      <item-number>3</item-number>
      <item-desc>Green Do-dad</item-desc>
   </line-item>
</invoice>

Output Document(s)

In this example, three documents are output by the FileWrite object:

<?xml version="1.0" encoding="UTF-16" ?>
<invoice>
   <line-item>
      <item-number>1</item-number>
      <item-desc>Red Widget</item-desc>
   </line-item>
</invoice>
<?xml version="1.0" encoding="UTF-16" ?>
<invoice>
   <line-item>
      <item-number>2</item-number>
      <item-desc>Blue Widget</item-desc>
   </line-item>
</invoice>
<?xml version="1.0" encoding="UTF-16" ?>
<invoice>
   <line-item>
      <item-number>3</item-number>
      <item-desc>Green Do-dad</item-desc>
   </line-item>
</invoice>

The following is an output document with the Cross Section parameter set to true.

<?xml version=”1.0” encoding=”UTF-16” ?>
<invoice>
   <invoice-number>1001</invoice-number>
   <line-item>
      <item-number>1</item-number>
      <item-desc>Red Widget</item-desc>
   </line-item>
</invoice>

The following is an output document when the Snip levels parameter is set to 1.

<?xml> version=”1.0” encoding=”UTF-16” ?>
<line-item>
   <item-number>1</item-number>
   <item-desc>Red Widget</item-desc>
</line-item

iWay Software