Friday, 6 February 2015

Oracle B2B 12c Positional Flat File and Charset Configuration

Oracle B2B supports the processing of various protocols and types of messages, however, sometimes extra configurations are needed to support special cases. For each protocol type there is a charset file associated to it, containing the allowed characters.

In my case, we were receiving Position Flat File (PFF) messages with the German char “ß” in it, which is not part of the default PFF charset. Fortunately B2B is flexible enough to allow the modification of said charsets.

In this post I will tackle the two tasks needed to able to add this PFF document to Oracle B2B 12c, namely Generating the ECS parser schema and modifying, if needed, the default PFF charset on B2B.
Oracle Document Editor is an indispensable tool to create message definitions for Oracle B2B documents and will have an important part in both tasks.

First I will quickly describe how to generate the parser schema for your PFF document on Document Editor and add it to B2B and, afterwards, I will describe the steps required to modify the default PFF charset used by B2B.

  1. Generate ECS parser schema
When you define a PFF document you need to create a parser schema and add it to the XEngine.
To do that start by opening your message definition on Oracle Document Editor and navigate in the menu to Edit -> Generate Parser Schema and generate the parser as seen bellow.

If you receive more than one message per file and want to process them as one just remove the check from "First record in the guideline starts a new message".

Next navigate in your server’s folder structure to {Middleware_home}/soa/soa/thirdparty/edifecs/XEngine/config and:
  1. Add your parser ecs file in the “schema” folder;

  2. Edit the XERegistry.xml file and add an entry as shown below under “Positional flat parser schemas”

To conclude restart the SOA server.

  1. Modify the PFF charset

In case the PFF messages going through your B2B system use characters not included in the default charset, you will have to add them to the list of allowed characters. This is done by creating a custom charset for the specified Guideline Type (you can also specify the Standard and Version) which will override the default charset for the corresponding documents.
To accomplish this you will need to create a custom charset on Oracle Document Editor as follows:

  1. Open Oracle Document Editor and navigate in the menu to Tools -> Environment -> Character Set Registry as seen here bellow

  1. Duplicate or Create a charset, in this case I duplicated the Delimited Flat File CS as it had almost everything I needed and changed the Guideline Type combo box “Positional”

  2. Make the needed changes, as for example in the picture bellow

  1. Export your newly created charset.

Afterwards, navigate in your server’s folder structure and:
  1. Add your custom charset to {Middleware_home}/soa/soa/thirdparty/edifecs/XEngine/config/charsets

  2. Add an entry on {Middleware_home}/soa/soa/thirdparty/edifecs/Common/Modules/XEngine.dat as seen bellow

Finally, restart the SOA server.

No comments:

Post a Comment