BEA Logo BEA WebLogic XML/Non-XML Translator 2.0

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

 

   XML Translator Documentation   |   XML Translator User Guide   |   Previous Topic   |   Next Topic   |   Contents   |   Index

BEA WebLogic XML/Non-XML Translator 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. BEA WebLogic XML/Non-XML Translator (hereafter referred to as XML Translator) 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 XML Translator 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 XML Translator?

XML Translator facilitates the integration of data from diverse enterprise applications by supporting data translations between binary formats from legacy systems and XML. XML Translator 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 BEA WebLogic Process Integrator. XML Translator 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. XML Translator includes importers that automatically create message format definitions.

You can then use XML Translator'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 Process Integrator allows for easy access to configuring translations.

Figure 1-2 Event Flow for Non-XML to XML Translation Using XML Translator


 

The Design-Time Component

The design-time component is a Java application called Format Builder. Format Builder is used to create descriptions of binary data records. Format Builder allows you to describe the layout and hierarchy of the binary data so that it can be translated to or from XML. With Format Builder, 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. Format Builder allows you to further define groupings of fields (groups), repetition of fields and groups, and aggregation.

The description you create in Format Builder is saved in an XML grammar called Message Format Language (MFL). MFL documents are metadata used by the run-time component of XML Translator and the plug-in to Process Integrator 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 Process Integrator 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 run-time component of XML Translator 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 BEA WebLogic Process Integrator, 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);
}

Run-Time Plug-In to WebLogic Process Integrator

BEA XML Translator Plug-In for WebLogic Process Integrator provides for an exchange of information between applications by supporting data translations between binary formats from legacy systems and XML. The XML Translator Plug-In provides Process Integrator actions that allow you to access XML to Binary and Binary to XML translations.

In addition to this data translation capability, the XML Translator 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 a WebLogic Server clustered environment.

The following illustration describes the relationship between XML Translator and Process Integrator.

Figure 1-5 XML Translator and Process Integrator 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 WebLogic Process Integrator. Once your binary data has been put in a self-describing format such as XML, this data is available for use in other applications.

Performing XML Transformation

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 WebLogic Server. WebLogic Process Integrator 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 run-time component of XML Translator 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


 

Working with BEA WebLogic Process Integrator

BEA WebLogic Process Integrator (Process Integrator) is a powerful workflow engine that automates workflow, business-to-business processes, and enterprise application assembly. WebLogic Process Integrator runs on BEA WebLogic Server and is a robust J2EE standards-based workflow and process integration solution.

Using an intuitive flowchart paradigm, business analysts use the WebLogic Process Integrator Studio to define business processes that span applications or to automate human interaction with applications. Developers can use WebLogic Process Integrator to assemble application components quickly without programming. The assembled applications are executed and managed by the WebLogic Process Integrator engine.

Process Integrator has an extensible architecture that allows new functionality to be plugged in. XML Translator includes a plug-in that provides XML to binary and binary to XML translation that is accessible through a Process Integrator action.

For detailed information about using the example workflow, see BEA WebLogic XML/Non-XML Translator Plug-In Guide.

 


Getting Started with the BEA WebLogic XML/Non-XML Translator

The steps outlined in Table 1-1 provide you with a high-level guideline to all of the tasks and processes that you must perform to install, configure, and work with the XML Translator. Think of these steps as a road map to guide you through the process and to point you to the resources available to help you.

Table 1-1 Steps for Working with the XML Translator

Task

Resource

    1. Read the BEA WebLogic XML/Non-XML Translator Release Notes.

BEA WebLogic XML/Non-XML Translator Release Notes.

    2. Make sure that all of the platform/environment prerequisites listed in the Installation and Configuration Guide and in the Release Notes have been met.

BEA WebLogic XML/Non-XML Translator Release Notes and BEA WebLogic XML/Non-XML Translator Installation and Configuration Guide.

    3. Install the BEA WebLogic XML/Non-XML Translator.

BEA WebLogic XML/Non-XML Translator Installation and Configuration Guide.

    4. Define the data format using Format Builder and generate translation metadata.

BEA WebLogic XML/Non-XML Translator User Guide.

    5. Test the translation

BEA WebLogic XML/Non-XML Translator User Guide.

    6. Install Process Integrator and verify correct operation of the repository.

BEA WebLogic Process Integrator Installation Guide.

    7. Save the format to the Process Integrator Repository.

BEA WebLogic XML/Non-XML Translator User Guide.

    8. Deploy the XML Translator plug-in using the Process Integrator plug-in manager.

BEA WebLogic Process Integrator Installation Guide.

    9. Add an XML to Binary or Binary to XML translation action to a task in a Process Integrator workflow.

BEA WebLogic Process Integrator Installation Guide.

 

back to top previous page next page