BEA Logo BEA 

WebLogic Integration Release 2.1 Service Pack 1

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   WebLogic Integration Doc Home   |   DI Topics   |   Data Integration   |   Previous Topic   |   Next Topic   |   Contents   |   Index   |   View as PDF

Translating Data with WebLogic Integration Overview

 

Within most enterprise application integration (EAI) problem domains, data translation is an inherent part of an EAI solution. XML is quickly becoming the standard for exchanging information between applications and is invaluable in integrating disparate applications. However, most data transformation engines do not support translations between binary data formats and XML. WebLogic Integration provides for an exchange of information between applications by supporting data translations between binary formats from legacy systems and XML.

This section provides information about the following topics:

 


Understanding XML Translation

Data that is sent to or received from legacy applications is often platform-specific binary data that is in the native machine representation. Binary data is not self-describing, so in order to be understood by an application, the layout of this data (metadata) must be embedded within each application that uses the binary data.

XML is becoming the standard for exchanging information between applications because XML embeds a description of the data within the data stream, thus allowing applications to share data more easily. XML is easily parsed and can represent complex data structures. As a result, the coupling of applications no longer requires metadata to be embedded within each application.

When you translate binary to XML data, you convert structured binary data to an XML document so that the data can be accessed via standard XML parsing methods. You must create the metadata used to perform the conversion. The translation process converts each field of binary data to XML according to the metadata defined for each field of data. In the metadata you specify the name of the field, the data type, the size, and whether the field is always present or optional. It is this description of the binary data that is used to translate the binary data to XML. Figure 1-1 shows a sample of XML data translation.

Figure 1-1 XML Data Translation of: Tom;Jones;1345;19;


 

Applications developed on the WebLogic platform often use XML as the standard data format. If you want the data from your legacy system to be accessible to applications on the WebLogic platform, you may use WebLogic Integration to translate it from binary to XML or from XML to binary. If you need the XML in a particular XML dialect for end use, you must transform it using an XML data mapping tool.

 


What is Data Integration?

The data integration component of WebLogic Integration facilitates the integration of data from diverse enterprise applications by supporting data translations between binary formats from legacy systems and XML. Data integration normalizes legacy data into XML so it may be directly consumed by XML applications, transformed into a specific XML grammar, or used directly to start workflows in business process management. The data integration component of WebLogic Integration supports non-XML to XML translation and vice versa and is made up of three primary components:

To perform a translation, you create a description of your binary data using the design-time component (Format Builder). This involves analyzing binary data so that its record layout is accurately reflected in the metadata you create in Format Builder. You then create a description of the input data in Format Builder and save this metadata as a Message Format Language (MFL) document. Data integration includes importers that automatically create message format definitions.

You can then use data integration's run-time component to translate instances of binary data to XML. Figure 1-2 shows the event flow for non-XML to XML data translation. A plug-in to business process management (BPM) allows for easy access to configuring translations.

Figure 1-2 Event Flow for Translating Data


 

The Design-Time Component

Design-time in data integration is a Java application called Format Builder. You can create descriptions of binary data records, describe the layout and hierarchy of the binary data so it can be translated to or from XML. You can describe sequences of bytes as fields. Each field description includes the type of data (floating point, string, etc.), the size of the data, and the name of the field. You can further define groupings of fields (groups), repetition of fields and groups, and aggregation.

The description you create is saved in an XML grammar called Message Format Language (MFL). MFL documents are metadata used by the data integration run-time component and the plug-in to business process management to translate an instance of a binary data record to an instance of an XML document (or vice-versa). Format Builder will also create a DTD or XML Schema document that describes the XML document created from a translation. Figure 1-4 shows the process flow of binary and XML data through Format Builder during the design-time phase.

Figure 1-3 Design Time Process Flow Through Format Builder


 

You can also use Format Builder to retrieve, validate, and edit stored MFL documents and to test message format definitions with your own data. MFL documents may be stored using the file system or archived in the repository. The test feature allows you to select the option of testing the translation of XML data to binary format, or binary data to XML format. You may save the transformed data to a file for future testing.

The Run-Time Component

The data integration run-time component is a Java class with various methods used to translate data between binary and XML formats. This Java class can be deployed in an EJB using BEA WebLogic Server, invoked from a workflow in business process management, or integrated into any Java application. Figure 1-4 shows the run-time process flow for binary to XML translations and XML to binary translation.

Figure 1-4 Run-Time Process Flow


 

Binary to XML Translation

Listing 1-1 is a code sample that shows the parsing of a file containing binary data into an XML document object. The MFL file mymfl.mfl is used as the description of the binary data contained in the file mybinaryfile.

Listing 1-1 Sample Code for Binary to XML Translation

import com.bea.wlxt.*;
import org.w3.dom.Document;
import java.io.FileInputStream;
import java.net.URL;

try
{
WLXT wlxt = new WLXT();
URL mflDocumentName = new URL("file:mymfl.mfl");
FileInputStream in = new FileInputStream("mybinaryfile");

Document doc = wlxt.parse(mflDocumentName, in, null);
}
catch (Exception e)
{
e.printStackTrace(System.err);
}

XML to Binary Translation

Listing 1-2 is a code sample that shows the translation of the XML data contained in the file myxml.xml to the binary format specified by the MFL document mymfl.mfl. The binary data is written to the file mybinaryfile.

Listing 1-2 Sample Code for XML to Binary Translation

import com.bea.wlxt.*;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.net.URL;

try
{
WLXT wlxt = new WLXT();
URL mflDocumentName = new URL("file:mymfl.mfl");
FileInputStream in = new FileInputStream("myxml.xml");
FileOutputStream out = new FileOutputStream("mybinaryfile");
wlxt.serialize(mflDocumentName, in, out, null);
}
catch (Exception e)
{
e.printStackTrace(System.err);
}

The Plug-In to Business Process Management

Business process management (BPM) in WebLogic Integration automates workflow, business-to-business processes, and enterprise application assembly. It runs on the WebLogic Server and is a robust J2EE standards-based workflow and process integration solution.

Using an intuitive flowchart paradigm, business analysts use the process engine to define business processes that span applications or to automate human interaction with applications. Developers can use the process engine to assemble application components quickly without programming, execute them, and manage them.

The process engine has an extensible architecture that allows new functionality to be plugged in. WebLogic Integration includes a data integration plug-in that provides XML to binary and binary to XML translation that is accessible through a BPM action.

The Data Integration Plug-In for business process management (BPM) provides for an exchange of information between applications by supporting data translations between binary formats from legacy systems and XML. The Data Integration Plug-In provides BPM actions that allow you to access XML to Binary and Binary to XML translations.

In addition to this data translation capability, the Data Integration Plug-In provides event data processing in binary format, in-memory caching of MFL documents and translation object pooling to boost performance, a BinaryData variable type to edit and display binary data, exporting of entirely self-contained workflow definition packages, and execution within the WebLogic Server clustered environment.

The following illustration describes the relationship between data translation and BPM.

Figure 1-5 Data Integration and BPM Relationship


 

 


Post Translation Options and Considerations

After you have successfully translated your binary data to XML, or vice versa, you have numerous options for additional processing of the XML data. The XML data can be transformed to a specific XML dialect or to a display format. The XML data can be sent to other applications that consume XML such as business process management (BPM). Once your binary data has been put in a self-describing format such as XML, this data is available for use in other applications.

Once you have translated binary data into XML, you may need to transform the XML data to a different XML grammar, to a display format (HTML), or to another binary format. The process of transforming XML to another XML grammar is referred to in this document as XML transformation. XML transformation can be accomplished via the XML module of the WebLogic Server. BPM provides an action that allows you to access this module and transform XML documents using XSL style sheets. You might want to transform XML for several reasons:

XSL (extensible stylesheet language) is an XML language that describes a series of transformations that are to be performed on nodes of an XML document. A stylesheet is an XSL document that can be used to map an XML document to another XML dialect or to another text format (such as HTML or PDF). A stylesheet can also be used with the data translation run-time component of WebLogic Integration to transform XML.

Figure 1-6 demonstrates one XML grammar converted to another using an XSLT engine. The transformation metadata in this case is an XSL style sheet that describes how one XML grammar is mapped into another.

Figure 1-6 XML Data Transformation of: Tom;Jones,1345;19


 

 

back to top previous page next page