Topics: |
How to: |
A preparser is designed to convert incoming messages into processable documents. The preparsed document then passes through the standard transformation services to reach the designated processing service. An example of a preparser is a class that accepts an EDI-formatted document and converts it to XML for further processing. For more information on the methodology used in writing preparsers, see the iWay Service Manager Programmer's Guide.
Each preparser uses a class file that must be located in a directory which is in the Java classpath. iWay Service Manager includes preparsers that have been preconfigured.
A Service Manager flow can include multiple preparsers and more than one preparser can handle a document. For example, a document can be processed by preparser A and then, subsequently, by preparser B.
Important: A preparser is run prior to a process flow. Further message processing can be handled in an iWay process flow.
To add a preparser:
The Preparsers pane opens.
The Preparser Type pane opens.
You can also manually type the class name of a preparser that is packaged in a .jar file, which is in the CLASSPATH.
The configuration parameters pane for the CICS preparser opens.
The Name and Description pane opens.
The preparser is added to the list in the Preparsers pane.
After a preparser is added to iWay Service Manager, you can assign a preparser to an inlet that is used to construct a channel. For more information, see Configuring Channels.
Topics: |
To handle large files, iWay Service Manager provides a streaming interface. You can use the streaming preparser only with the HTTP, File, FTP, Sonic, SFTP, nHTTP, MQ, and JMS listeners. To use a streaming preparser in conjunction with other preparsers, you must define it as the first preparser in the chain.
Examples of available streaming preparsers are:
How to: |
Reference: |
iWay Service Manager includes a line-oriented preparser designed to accept an input stream and create smaller input files from the original large file. You can configure the preparser to specify the character that indicates a new record.
The following incoming document can be subdivided into three individual documents, based on the delimiter:
What is your name? Where do you live? When were you born?
This document can be divided into three individual documents.
What is your name?
Where do you live?
When were you born?
The preparsers pass the individual documents to the remainder of the flow. The transaction extends for all records in the stream, as per standard iWay Service Manager transaction control. Each record, however, is independent for processing purposes.
To define a line-oriented preparser:
The Preparsers pane opens.
The configuration parameters pane for Flat Stream preparser opens.
The preparser is added to the list in the Preparsers pane.
The Flat Stream PreParser splits non-XML messages on a recognized character. The configuration specifies the split character. The default is the end of line for the platform. The character can be specified as any character, a special character, or a hexadecimal character.
A standard use of this preparser is to handle individual lines of a large, delimited file. The following table lists and describes the character representations.
Character Representation |
Description |
---|---|
X |
Any character |
\n |
New line |
\t |
Tab |
\r |
Carriage return |
\xab |
Ab are hexadecimal characters such as 0A. |
How to: |
Reference: |
iWay Service Manager includes a preparser designed to accept input files containing multiple XML documents and create single XML documents from the original input file.
The preparser processes the following batch of XML documents:
<?xml version="1.0" encoding="UTF-8"?> <hi>This is my document</hi> <hi>This is my document</hi> <hi>This is my document</hi> <hi>This is my document</hi>
To define a concatenated XML document preparser:
The Preparsers pane opens.
The preparser is added to the list in the Preparsers pane.
The incoming XML document is divided into smaller documents, broken at a specified repeating child, for example:
<a> <b> <c>one</c> <b> <b> <c>two</c> </b> </a>
With a split specified as a/b, it results in three passes through the configured flow.
Pass 1
<a> <b> <c>one</c> </b> </a>
Pass 2
<a> <b> <c>two</c> </b> </a>
Pass 3
No data.
How to: |
iWay Service Manager includes a tag-oriented XML splitter preparser designed to accept an input XML document and create smaller XML files from the original large file. You can configure the preparser to specify the tags or combination of tags to use to split the document.
The preparser supports the last level of the XML splitter preparser as the wildcard, *. This feature causes each entry below the fixed levels to be split off from the input XML document.
The following incoming document with the split parameters of A,B,* can be subdivided into two individual documents.
Incoming Document |
Individual Document 1 |
Individual Document 2 |
---|---|---|
<A> <B> <C1/> <C2> <D1/> </C2> </B> </A> |
<A> <B> </B> </A> |
<A> <B> <C2> <D1/> </C2> </B> </A> |
To add an XML splitter preparser:
The Preparsers pane opens displaying a list of configured preparsers. You can modify these preparsers or add a new one.
The Configuration Parameters pane opens.
/ConfirmBOD
The Preparsers pane opens with your new preparser added to the list.
The following incoming document must be split into two smaller documents:
<?xml version="1.0" encoding="ISO-8859-1"?> <Root> <ConfirmBOD lang="en-US"> <ApplicationArea> <Sender> <LogicalId>3000</LogicalId> </Sender> </ApplicationArea> <DataArea> <Confirm>Failure</Confirm> </DataArea> </ConfirmBOD> <ConfirmBOD lang="en-US"> <ApplicationArea> <Sender> <LogicalId>4000</LogicalId> </Sender> </ApplicationArea> <DataArea> <Confirm>Success</Confirm> </DataArea> </ConfirmBOD> </Root>
The document must be split on the ConfirmBOD tag. The preparser should act on the document and create two documents that look similar to the following:
<Root> <ConfirmBOD lang=...> .... </ConfirmBOD> </Root>