|
|
Using the XML Translator Plug-In
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. 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.
In addition to this data translation capability, the XML Translator Plug-In provides a binary data event handler, in-memory caching of MFL documents and translation object pooling to boost performance, a BinaryData variable type to edit and display binary data, and execution within a WebLogic Server clustered environment.
This section provides information about the following topics:
Data Translation with the XML Translator Plug-In
The XML Translator Plug-In provides XML and non-XML translation capabilities from within WebLogic Process Integrator. To perform one of these translation actions, follow the steps below. For more information on the actions specific to WebLogic Process Integrator, refer to the WebLogic Process Integrator documentation.
Figure 2-1 Task Properties Dialog
Figure 2-2 Add Action dialog
Translate XML to Binary
To perform an XML to binary translation:
Figure 2-3 Translate XML to Binary Dialog
Translate Binary to XML
To perform a binary to XML translation:
Figure 2-4 Translate Binary to XML Dialog
Processing Event Data
The XML Translator Plug-In provides functionality that allows binary data to trigger WebLogic Process Integrator workflows by converting the binary data to XML, or pre-processing it at the front end of WebLogic Process Integrator event processing. This functionality is referred to as the "event handler." Publishing JMS messages to a topic causes the event handler to run.
There are three JMS properties required for the message to be pre-processed by the XML Translator Plug-In:
The first two JMS message properties are constant for all messages addressed to the event handler. The third property contains the name of the MFL document that describes the binary data in the message.
Note: This MFL document must be stored in the repository.
Listing 2-1 is a sample of the code used to build a message that is to be processed by the XML Translator event handler.
Listing 2-1 Sample Event Handler Code
byte[] bindata = ... the binary data ...
pub = sess.createPublisher(topic);
BytesMessage msg = sess.createBytesMessage();
msg.writeBytes(bindata);
msg.setStringProperty("WLPIPlugin", "com.bea.wlxt.WLXTPlugin");
msg.setStringProperty("WLPIContentType",
"binary/x-application/wlxt");
msg.setStringProperty("WLPIEventDescriptor", "mymfldoc");
pub.publish(msg);
This process is illustrated in the servlet sample application (see Running the WebLogic Process Integrator Servlet Sample).
Enhancing Data Translation Performance
The XML Translator Plug-In provides a configuration panel to administer and monitor the MFL document in-memory cache and enable or disable event handler debugging. Using this panel, you can adjust the in-memory cache and translation object pool to enhance the performance of your data translations.
Note: You must clear the MFL document in-memory cache in order for any updates you make to an MFL document to take effect.
To access the configuration panel, follow the steps below. For more information on the actions specific to WebLogic Process Integrator, refer to the WebLogic Process Integrator documentation.
Figure 2-5 Plugin Configuration Dialog
Figure 2-6 Configuration Dialog for XML Translator Plug-In
The XML Translator Plug-in provides additional display and edit capabilities over the standard WebLogic Process Integrator functionality. These capabilities are provided by the Hex Editor component of Format Tester for displaying and editing binary data.
Variable Types and the XML Translator Plug-In
The XML Translator Plug-In provides a BinaryData variable type, that you can use to edit and display binary data. The BinaryData variable acts as a container for a logical group of binary data with additional display capabilities. The BinaryData variable is used by programs that call the actions provided by the XML Translator Plug-In to pass and receive binary data. It is also used by the Workflow instance monitor to display and edit the contents of a binary variable.
Custom Data Types and the XML Translator Plug-In
XML Translator includes a User Defined Type feature that allows you to create custom data types specific to your unique data type requirements. The User Defined Type feature allows these custom data types to be plugged in to the XML Translator runtime engine. Once a user defined data type is plugged-in, it is indistinguishable from a built-in data type in both features and function.
Configuring User Defined Data Types
User Defined data types used by the XML Translator Plug-In are stored in the XML Translator repository as CLASS documents. At runtime, the XML Translator Plug-In loads user defined type classes from the repository as required. In addition, the XML Translator Plug-In will export the MFL and class files required to support the active template allowing a template to be imported on another Process Integrator instance intact. Class documents may be placed in the repository using one of the following methods:
Using Format Builder
Perform the following steps to publish a user defined type to the repository using Format Builder.
Figure 2-7 Login Window
Note: The Process Integrator Repository Login window allows up to three unsuccessful login attempts, after which, a login failure message is displayed. If you experience three login failures, choose Repository—>Log In to repeat the login procedure.
Figure 2-8 Add/Remove User Defined Types Dialog
With a repository connection established, the Add/Remove User Defined Types dialog box displays the status of each registered user defined type and allows for its publication to the repository. The user defined type repository status is reflected by an icon of a ball preceding the type name of each installed user defined type.
The color of the icon associated with each user defined type indicates its status:
Using the Repository Import Utility
Perform the following steps to use the repository import utility to import Java class files, including XML Translator user defined types.
wlxt.repository.url=<server url>
For example:
wlxt.repository.url=t3://localhost:7001
java com.bea.wlxt.repository.Import <file name>
For example, the following command imports all the class files in the current directory:
java com.bea.wlxt.repository.Import *.class
Note: Any Java class file may be imported to the repository using the Repository Import utility, not just user defined types. This is useful if a user defined type relies on additional class files that do not extend the com.bea.wlxt.bintype.Bintype class.
WebLogic Server Clustering Support
The XML Translator Plug-in can operate successfully in a WebLogic Server clustered environment. In a clustered environment, the plug-in administrator is connected to only one node of the cluster at any given time. Any commands issued by the administrator must be propagated to the other nodes in the cluster.
Communication among the various servers in a cluster is handled through the use of a JMS topic. The topic is used for communication between XML Translator components on different nodes in a cluster.
Configuring the XML Translator Plug-in for Clustering
If you want to take advantage of the clustering capability, you must configure the XML Translator Plug-In as follows:
com.bea.wlxt.cluster.BroadcastTopic
Note: Refer to the WebLogic Server documentation for more information on creating JMS topics.
Note: The config directory contains separate subdirectories for each domain you have created. Each of these subdirectories contains its own config.xml file. Make sure you open the file under the correct domain.
<EJBComponent Name="wlxt-cluster"
DeploymentOrder="99"
Targets="[server_name]"
URI="wlxtmb.jar"
/>
Note: You must restart the server in order for the change to the config.xml file to be recognized.
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|