BEA eLink Adapter for XML Overview

# BEA eLink Adapter for XML Overview

This chapter contains the following topics:

- BEA eLink Solution Overview

- BEA eLink Adapter Feature Overview

- FML and XML Data Formats

## BEA eLink Solution Overview

BEA Enterprise Application Integration (EAI) provides an open solution that allows applications throughout organizations to communicate seamlessly. Using EAI, you gain the long-term flexibility and investment protection you need to keep up with today's ever-changing business environment.

Typically, companies use packaged applications to automate internal operations, such as financial, manufacturing, human resources, etc. While they successfully address the needs of these specific areas, these proprietary platforms do not work together. To compete today, you need a much greater exchange of information. Systems need to communicate at both a database and a process level, within your own organization as well as with customer's and supplier's systems. BEA eLink Platform is the underlying basis of BEA eLink, a family of off-the-shelf enterprise application integration (EAI) products that leverage BEA's transaction platform to integrate existing legacy applications with customer-focused and business-to-business e-commerce initiatives.

BEA eLink Platform provides a proven, rock-solid infrastructure for integrating applications within the enterprise and across the Web. BEA eLink Platform ensures high-performance, secure transactions and transparent access to mission-critical applications and information throughout the enterprise and across the Web. Figure 1-1 illustrates the eLink logical architecture and shows where the eLink Adapters fit into the process.

> Figure 1-1 BEA eLink Solution Illustration

### The BEA eLink Platform

The BEA eLink Platform (in addition to all options and adapters) is highly scalable. Multiple instances of BEA eLink Platforms can collaborate so that work is divided between eLink instances and domains. BEA eLink includes SNMP integration for enterprise management. The BEA eLink Platform features compliance with the Open Group's X/Open standards including support of the XA standard for Two-phase commit processing, the X/Open ATMI API, and XPG standards for language internationalization. C, C++ and Java (via Jolt) are supported. The BEA eLink Platform connects to any RDBMS, OODBMS, file manager or queue manager. The following components operate with BEA eLink Platform:

- The Data Integration Option translates data models used by different applications into a common data format. It provides a cost-effective alternative to writing or generating programs to perform this function. It also handles complex translation with greater power and scalability than rules engines and formatters.

- The Business Process Option extends the eLink environment of business rules and processes and dynamically responds to business events and exceptions. It also helps automate tasks in the business process, and dynamically responds to business events and exceptions.

- The eLink Adapter provides the interface between the BEA eLink Platform and external applications, with out-of-the-box functionality (no programming required).

## BEA eLink Adapter Feature Overview

The eLink Adapter for XML is an FML to XML conversion product designed to allow applications using a TUXEDO platform to convert data between Field Manipulation Language (FML) and Extensible Markup Language (XML) formats. Applications built using BEA TUXEDO can define interfaces that use FML field tables. This product allows these FML interfaces to be expressed in XML format. In order to use the eLink Adapter for XML, the adapter must be installed, configured, and executed as part of the TUXEDO system. End-user applications then may invoke the adapter to convert data from one format to another. Figure 1-1 displays the relationship of the adapter to the TUXEDO system.

> Figure 1-2 Relationship of the Adapter to the TUXEDO System

- This section contains overview information for each of these topics:

- FML and XML Data Formats

  - What is FML?

  - What is XML?

  - How Does the eLink Adapter Convert XML/FML?

## FML and XML Data Formats

This section provides an overview and examples of FML data and XML data and demonstrates the difference between the two types of data formats.

### What is FML?

Field Manipulation Language (FML) is a core part of the eLink platform and TUXEDO. FML allows applications to exchange binary data using defined field names. It also provides endian and character translations between different machine types in a distributed computing environment. Listing 1-1 shows an example of FML data.

> Listing 1-1 Example of FML

>     FML32 data
>     FIRST_NAME[0]  Jane
>     FIRST_NAME[1]  John
>     FIRST_NAME[2]  Fred
>     LAST_NAME[0]   Doe
>     LAST_NAME[1]   Doe
>     LAST_NAME[2]   Smith

### What is XML?

Extensible Markup Language (XML) is a meta-markup language that provides a format for describing structured data. Using XML, you can define an unlimited number of tags that can be used to display data in various styles across any platform. It provides a data standard that can encode the content, semantics, and schemata for types of data and can be merged from different sources regardless of their organization. XML maintains the separation of the user interface from the structured data. The separation of data from presentation enables the seamless integration of data from diverse sources because the data is marked up so that it becomes self described. Listing 1-2 shows an example of XML Data. The following XML example is an excerpt from sample XML data provided by the Open Applications Group.

> Listing 1-2 Example of XML Data

>     <?xml version="1.1"
>     <!--
>     This is an example of XML data
>     -->
>     <CONFIRM_BOD>
>          <CNTROLAREA>
>                <VERB>UPDATE</VERB>
>                <NOUN>INVENTORY</NOUN>
>          </CNTROLAREA>
>          <STATUSLVL>00</STATUSLVL>
>          <DESCRIPTN>THIS BOD HAS BEEN PROCESSED WITHOUT ERRORS</ </DESCRIPTN>
>     <ORIGREF>RCPT#12550699</ORIGREF>
>     <USERAREA>USER1=FOO</USERAREA>
>     <USERAREA>USER2=FOOFOO</USERAREA>
>     <CONFIRMMSG>
>                <DESCRIPTN>SYSTEM X SCREEN 123 OK O.234SEC</DESCRIPTN>
>                <REASONCODE>MISC</REASONCODE>
>          </CONFIRMMSG>
>     </CONFIRM_BOD>

### How Does the eLink Adapter Convert XML/FML?

The eLink Adapter provides three conversion services: XML2FML, FML2XML and FMLMTI2XML.

- FML2XML service converts FML data to XML.

- XML2FML service converts XML data to FML.

- FMLMTI2XML service converts FML to XML using Meta-Type Information to preserve hierarchical groupings.

End-user applications invoke these services using service names defined in the adapter configuration file.

#### The XML2FML Service

The XML2FML service converts data in XML format to FML format. End-user applications invoke these services using service names defined in the adapter configuration file. Figure 1-3 shows an end-user application invoking the XML2FML service.

> Figure 1-3 The Invocation of the XML2FML Service

The XML2FML Service accepts XML data that is contained in a TUXEDO FML32 type buffer. This FML buffer must contain a single FML field named ELINK_XML_DATA that contains the XML data that is to be converted. The XML2FML service ignores all XML tags that are not followed by a value, and as a result all hierarchical structural information is ignored. XML tags that are followed by a value are added to an FML32 buffer using the XML tag name as the FML field name. If multiple occurrences of an XML tag-value pair exist in the XML data, they are added to the FML buffer in the same order as in the XML data. Listing 1-3 shows the contents of the ELINK_XML_DATA field. Notice that the hierarchical XML tags INPUT DATA, EMPLOYEES, and NAME are not represented in the resulting FML data.

> Listing 1-3 Contents of ELINK_XML_DATA field sent in tpcall or tpacall request:

>     XML input data:

>     <Input_Data>
>     <Employees>
>     <Name>
>     	<FIRSTNAME>Jane</FIRSTNAME>
>     	<LASTNAME>Doe</LASTNAME>
>     </Name>
>     <Name>
>      	<FIRSTNAME>John</FIRSTNAME>
>     	<LASTNAME>Doe</LASTNAME>
>     </Name>
>     <Name>
>     	<FIRSTNAME>Fred</FIRSTNAME>
>     	<LASTNAME>Smith</LASTNAME>
>     </Name>
>     </Employees>
>     </InputData>

>     FML field table:
>     *base 1200
>     # name		number    type     flags   comments
>     FIRSTNAME	     1	         string   -       -
>     LASTNAME      2         string   -       -

>     resulting FML Data:

>     FML32 data
>     FIRSTNAME[0] Jane
>     FIRSTNAME[1] John
>     FIRSTNAME[2] Fred
>     LASTNAME[0] Doe
>     LASTNAME[1] Doe
>     LASTNAME[2] Smith

The XML2FML conversion ignores the XML constructs shown in Listing 1-4

> Listing 1-4 XML Constructs Ignored for XML2FML Conversion

>     Comments
>     Document Type Definitions
>     CDATA Sections
>     Attribute Declarations
>     Prologs
>     Language Identification
>     Notations
>     Entity Declarations
>     Processing Instructions
>     Empty element tags

Listing 1-5 shows the XML constructs that are not supported:

> Listing 1-5 XML Constructs Not Supported

>     Unicode characters
>     Nested XML tags
>     Example:
>     <A> This is an example of a <B>nested XML value</B> that is not supported</A>

Note: For additional information on XML constructs see the XML specification at http://www.w3.org

#### The FML2XML Service

The FML2XML service converts TUXEDO FML data to XML data. Figure 1-4 shows an example invocation of the FML2XML Service:

> Figure 1-4 The Invocation of the FML2XML Service

The FML2XML Service accepts an FML32 type buffer. An FML32 type buffer is returned with a single FML field ELINK_XML_DATA. This string field contains the generated XML data.

XML data is created with a single top level tag named MESSAGE. Below this tag is an XML list tag denoting the start of a list for an FML Field Name. The XML list tag name consists of the FML Field Name with the configured LIST_TAG_SUFFIX value appended to it. After the XML list tag is created, an XML tagged value is generated for each occurrence of the FML field. Once all occurrences of the FML field are converted to XML, the process repeats with the next FML field name. Listing 1-6 shows an example of an FML field table, FML data, and the resulting XML data.

> Listing 1-6 FML field table:

>     FML field table:
>     *base 1200
>     # name          number   type    Flags    comments
>     FIRSTNAME       1        string  -        -
>     LASTNAME        2        string  -        -

>     Example of FML Data:

>     FML32 data
>     FIRSTNAME[0] Jane
>     FIRSTNAME[1] John
>     FIRSTNAME[2] Fred
>     LASTNAME[0] Doe
>     LASTNAME[1] Doe
>     LASTNAME[2] Smith

>     resulting XML:

>     <Message>
>     <FIRSTNAME_SET>
>     <FIRSTNAME>Jane</FIRSTNAME>
>     <FIRSTNAME>John</FIRSTNAME>
>     <FIRSTNAME>Fred</FIRSTNAME>
>     </FIRSTNAME_SET>
>     <LASTNAME_SET>
>     <LASTNAME>Doe</LASTNAME>
>     <LASTNAME>Doe</LASTNAME>
>     <LASTNAME>Smith</LASTNAME>
>     </LASTNAME_SET>
>     </Message>

#### The FMLMTI2XML Conversion Service

The FMLMTI2XML service converts TUXEDO FML data to XML data using Meta-Type Information to preserve implicit groupings. FML Group Format (FGF) is a small language that is used to describe how FML fields should be grouped together when extracted into a hierarchical structure. Listing 1-7 shows an FML Group Format (FGF) file and the associated FML Field Definition file.

> Listing 1-7 FGF File:

>     #  Comments begin with a pound symbol
>     #  Another comment
>     GROUP OuterMostGroup
>     GROUP InnerGroup OCCURS 3
>     	 	string	FIRSTNAME
>     		string	LASTNAME
>     	END
>     END

>     FML field table:
>     *base 1200
>     # name          number   type    flags    comments
>     FIRSTNAME       1        string  -        -
>     LASTNAME        2        string  -        -

The FML Group Format file has to be converted into a Meta-Type Information (MTI) format file that the adapter can read at run time. The FGF2MTI utility takes the FGF file and the FML Field Definition file as inputs and generates the MTI file. Figure 1-5 illustrates this process of creating an MTI file from a FGF`` file and FML Field Definition file.

> Figure 1-5 Converting the FGF file to an MTI file

The FMLMTI2XML service accepts a FML32 type buffer. Using the MTI file configured for a given business function the adapter produces an FML32 buffer containing the FML data in XML format. Figure 1-6 shows the invocation of the FMLMTI2XML service using the MTI file.

> Figure 1-6 Converting FML32 Data to XML Using the MTI File

Listing 1-8 shows an example of the FML data that is converted to XML using the FMLMTI2XML service:

> Listing 1-8 Example of FML Data Sent in Request to FMLMTI2XML Service

>     FGF file:
>     #  Comments begin with a pound symbol
>     #  Another comment
>     GROUP OuterMostGroup
>     GROUP InnerGroup OCCURS 3
>     	 	string	FIRSTNAME
>     		string	LASTNAME
>     	END
>     END

>     FML field table:
>     *base 1200
>     # name          number   type    flags    comments
>     FIRSTNAME       1        string  -        -
>     LASTNAME        2        string  -        -

>     Example of FML Data:

>     FML32 data
>     FIRSTNAME[0] Jane
>     FIRSTNAME[1] John
>     FIRSTNAME[2] Fred
>     LASTNAME[0] Doe
>     LASTNAME[1] Doe
>     LASTNAME[2] Smith

>     resulting XML:

>     <Message>
>     <OuterMostGroup>
>     <InnerGroup>
>     	<FIRSTNAME>Jane</FIRSTNAME>
>     	<LASTNAME>Doe</LASTNAME>
>     </InnerGroup>
>     <InnerGroup>
>      	<FIRSTNAME>John</FIRSTNAME>
>     	<LASTNAME>Doe</LASTNAME>
>     </InnerGroup>
>     <InnerGroup>
>     	<FIRSTNAME>Fred</FIRSTNAME>
>     	<LASTNAME>Smith</LASTNAME>
>     </InnerGroup>
>     </OuterMostGroup>
>     </Message>

[Table of Contents] [Prev] [Next]