BusinessDocument Project

The BusinessDocument project contains two adapter configurations: transferReader.adfilesmodel and transferWriter.adfilesmodel. The sample project shows how the adapter groups objects together and transfers each grouped object as a single message.

Grouping objects helps to speed the transfer process. A business object acts as a container for objects. By default, each object is published separately. When using a business document, objects are placed in a container, and the container is published in a single message. The number of objects in the business document is set in the Grouping Factor field. When setting the grouping factor to 2, Publication Service places two objects in the business document, and then publishes the business document.

In transferReader.adfilesmodel, Publication Service parses the oneMegaByteFile.txt file and publishes each line in the file as a separate message. Publication Service configuration and processing parameters are defined in a similar way as those in other examples. Unlike other examples, in the Advanced tab, the Data Format field is Business Document, and the Grouping Factor field is 2. The Business Document Name field is set to transferSample.

In transferWriter.adfilesmodel, Subscription Service receives each message, formats it by changing the delimiter character used between fields and changing the type assigned to some fields, and appends it to the outtransfer.txt file. In the Configuration tab, the Wip Creation Mode field is set to Append messages to file, close on Business Document Lot End. The subscriber waits until all objects placed in the business document are received before closing the output file.

The write schema assigned to Subscription Service defines how lines are formatted before being written to the output file. A semicolon is used as the delimiter character. For the Quantity, Price and field4 fields, a positive sign (+ character) is prepended. Scientific notation is enabled for the Price and field4 fields.

For example, the line in the input file (Item, GigaWidget, 60, 75, 00000) is changed as (Item;GigaWidget;+60;+7.500000E+001;+0.000000E+000) in the output file.