Modifying file input/output processing
The File I/O receiver stamps the outgoing XML messages
with a unique message group identification, YantraMessageGroupID
before
it is sent to the next component in the service definition framework.
Once the end of the file is reached, an EOF message is created with
the same message group ID. This EOF message is useful if special processing
needs to be done at the end of each file.
Rules for creating EOF messages:
If you are using the Sterling Order Management System Software File IO adapter component, the same unique message group ID is added and the message header is appended to each message by default.
The following are the rules for creating EOF messages when using a third party component and integrating with Sterling Order Management System Software:
- The EOF message must be of the format:
<EOF YantraMessageGroupID="Mandatory" />
- The XML root node name must be
EOF
and theYantraMessageGroupId
is a required attribute. This attribute is essential in identifying all messages that belong to a group. - When Sterling Order Management System Software
is writing the EOF messages to a JMS queue or a Database, then a message header with
MessageType="EOF"
is created by the framework.Note: If you are using a third party component for writing EOF messages into JMS queues or Database, then you should make sure that the EOF message has a header ofMessageType="EOF".
Example scenario for creating EOF messages
The steps involved in creating EOF messages and processing the messages in a JMS queue or a database is explained in detail with a sample XML file as an input to the File I/O adapter.
The following figure shows the service framework with a File IO component.

- The input file can be a delimited file, text file
or an XML file. In this example we consider an XML file.
Figure 1. Sample input file from file I/o node <Items Attr1="Value1" Attr2="Value2" Attr3="Value3" > <Item ItemId="Item1" /> <Item ItemId="Item2" /> <Item ItemId="Item3" /> </Items>
- The parsed input XML file of each child node is then passed into the JMS queue or a Database as a separate message.
- The framework then appends all the input XML files
root node attributes to each of the message put in the queue. Note: If the input XML's root node does not contain a
YantraMessageGroupID
, the framework generates a unique ID and append to each message put into the queue.If the input files are non-XML files then the root node attributes does not get included in the EOF node. It would contain the attributes given below:
<EOF YantraMessageGroupID="file1.txt.001" FileName="" FileSize="" LastModifiedTime="" />
- The EOF element contains the attributes in the root element of the input XML file along with the file name, file size (in bytes) and the last modified time of the file.