BEA Logo BEA WebLogic XML/Non-XML Translator Release 1.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WebLogic XML/Non-XML Translator Doc Home   |   WebLogic XML/Non-XML Translator Samples Guide   |   Previous Topic   |   Next Topic   |   Contents   |  

Running the WebLogic Process Integrator Sample Applications

 

The BEA WebLogic XML/Non-XML Translator software includes two sample applications designed to illustrate the integration of XML Translator with BEA WebLogic Process Integrator. This section describes these samples and gives you step-by-step instructions for running the samples. The following topics are discussed:

 


Prerequisite Considerations

There are certain software applications that must be installed and tasks that must be performed prior to running the Purchase Order sample. Please refer to the BEA WebLogic XML/Non-XML Translator Release Notes for more information.

Note: The instructions presented in this section assume that you have a good working knowledge of BEA WebLogic Process Integrator and BEA WebLogic Server. You should have successfully installed WebLogic Process Integrator and run a sample workflow.

 


Running the WebLogic Process Integrator Servlet Sample

This sample application implements a Web Archive (WLPI_Sample.war) that installs a servlet to accept requests for conversion of binary data to XML. The servlet is accessed via a browser and responds by displaying the generated XML data. In addition, a generated XML file may be posted to a JMS topic to act as a starting event for a WebLogic Process Integrator workflow.

Note: This sample does not require the interface to WebLogic Process Integrator; however, in order to start the workflow, WebLogic Process Integrator is required.

What is Included in the Servlet Sample

The following table provides a listing and description of the files included in the WebLogic Process Integrator Servlet sample application. This sample application can be found in the samples\wpli\servlet directory.

Table 2-1 List of Servlet Sample Application Files

Directory

File

Description

\servlet\source

WLPI_sample.java

The source code for the servlet used to present the HTML screen and process binary data to XML. This XML may then, optionally, be placed onto the WebLogic Process Integrator JMS topic.

\servlet

SampleData.mfl

The Message Format Language description of the sample binary data file used to start the sample WebLogic Process Integrator workflow.

\servlet

SampleData.data

The sample data file used as input to start the sample WebLogic Process Integrator workflow.

\servlet

SampleWorkflow.xml

The exported WebLogic Process Integrator workflow used in the sample. This workflow should be imported via the WebLogic Process Integrator Studio GUI to setup the workflow tasks involved in the sample.

\servlet

WLPI_sample.war

A Web Archive file containing all executable sample code and configuration files.

\servlet\images

bealogo.jpg

The BEA logo image displayed on the HTML page rendered by the sample servlet.

\servlet\WEB-INF

hello.html

The HTML page used by the sample servlet to obtain input data from the user.

\servlet\WEB-INF

web.xml

The J2EE configuration file defining deployment information for the sample servlet.

\servlet\WEB-INF

weblogic.xml

The BEA configuration file defining WebLogic-specific information for the sample servlet.

\servlet\WEB-INF\lib

*.jar

Utility libraries, including XML Translator, that are used in the execution of the sample code.

How to Run the Servlet Sample

Follow the steps below to run the servlet sample. For instructions on the tasks specific to WebLogic Server and WebLogic Process Integrator, refer to the documentation that accompanies those applications.

To run the servlet sample stand-alone (without WebLogic Process Integrator):

  1. Copy the license-group section from the XML Translator license file (license.bea) to the WebLogic Process Integrator license file. For details on this procedure, refer to the BEA WebLogic XML/Non-XML Translator Release Notes and the WebLogic Process Integrator documentation.

  2. Using a text editor, add the following line to the end of your weblogic.properties file:

    weblogic.httpd.webApp.WLXT=<path to war file>/WLPI_sample.war

    Note: If you have both WebLogic Server and WebLogic Process Integrator installed, you may have two instances of the weblogic.properties file. Make sure you edit the file in the WebLogic Process Integrator directory for this sample exercise.

  3. Start WebLogic.

  4. Start a web browser and enter the following URL:

    http://<weblogic server>:<weblogic port>/WLXT/WLXTTest

  5. Select an MFL file and a data file from your local machine.

  6. Click Submit. The server response displays the generated XML data.

The following additional steps can be run to start the workflow if you are integrating with WebLogic Process Integrator:

  1. Using a text editor, open the weblogic.properties file in the wlpi\Server directory.

  2. Modify the mail.host parameter to contain the address of your SMTP server.

  3. Start WebLogic Process Integrator.

  4. Start the WebLogic Process Integrator Studio and login.

  5. Select Templates in the left pane, click the right mouse button, and choose Create to create a new template.

  6. Select the newly created template, click the right mouse button, and choose Import Template Definition.

  7. Select the file \samples\wlpi\SampleWorkFlow.xml.

  8. Select the newly imported workflow, click the right mouse button, and choose Properties. The Properties dialog displays.

  9. Select Active and click OK.

  10. Select the workflow, click the right mouse button, and choose Save.

  11. Using a text editor, open the file \samples\wlpi\SampleData.data. Replace the text user@bea.com with a valid email address. This is the address the workflow uses to deliver the email message.

  12. Open a browser and go to the following URL:

    http://<weblogic server/port>/WLXT/WLXTTest

  13. Enter the following as the MFL file:

    samples\wlpi\SampleData.xml

  14. Enter the following as the data file:

    samples\wlpi\SampleData.data

  15. Select the option to invoke WebLogic Process Integrator and click Submit. A short email message is sent to the address you supplied in the data file.

 


Running the WebLogic Process Integrator EJB Sample

This sample simulates a dataflow from an HR system to a payroll system, initiated by the entry of payroll data. The employee data is obtained from a legacy payroll system that uses binary data. The data is translated to XML in order to perform a calculation to determine the employee's pay information. The result of the calculation is translated back to binary and sent on to the payroll system.

What is Included in the EJB Sample

The following table provides a listing and description of the files included in the WebLogic Process Integrator EJB sample application. This sample application can be found in the samples\wpli\ejb directory.

Table 2-2 List of EJB Sample Application Files

Directory

File

Description

\ejb

Makefile

Make file for building the sample source to a .jar file.

\ejb

WLXTExample.xml

Exported sample workflow from WebLogic Process Integrator

\ejb

HR.mfl

MFL file for binary data returned from the Sample HR Bean

\ejb

Payroll.mfl

MFL file for binary data passed to the Sample Payroll Bean

\ejb

Autopay.cmd

NT command script to initiate the workflow from the command line

\ejb

Autopay.sh

Unix shell script to initiate the workflow from a command prompt.

\ejb\lib

WLXTEJB.jar

Executables for the sample application

\ejb\source

XMLnonXML Translator.java

EJB wrapper class for WLXT

\ejb\source

XMLnonXML TranslatorHome.java

EJB wrapper class for WLXT

\ejb\source

XMLnonXML TranslatorBean.java

EJB wrapper class for WLXT

\ejb\source

Payroll.java

Sample EJB to represent legacy payroll system

\ejb\source

PayrollHome.java

Sample EJB to represent legacy payroll system

\ejb\source

PayrollBean.java

Sample EJB to represent legacy payroll system

\ejb\source

HR.java

Sample EJB to represent legacy HR system

\ejb\source

HRHome.java

Sample EJB to represent legacy HR system

\ejb\source

HRBean.java

Sample EJB to represent legacy HR system

\ejb\source

AutoPay.java

Program to place a pre-formatted message on the WLPI Event Topic to start the sample workflow

\ejb\source

HexDump.java

Utility class used by the sample EJBs

\ejb\source

EmployeeRecord.java

Employee data class used by the sample HR EJB

How to Run the EJB Sample

Follow the steps below to run the EJB sample. For specific instructions on performing the tasks in WebLogic Process Integrator and WebLogic Server, please refer to the documentation that accompanies those applications.

Step 1. Configure and Run WebLogic Process Integrator

  1. Copy the license-group section from the XML Translator license file (license.bea) to the WebLogic Process Integrator license file. For details on this procedure, refer to the BEA WebLogic XML/Non-XML Translator Release Notes and the WebLogic Process Integrator documentation.

  2. Deploy the sample beans by adding an entry to the WebLogic Properties file. For example:

    weblogic.ejb.deploy=d:/beahome/wlxt1.0/samples/ejb/lib/WLXTEJB.jar

  3. Add the full path and file name of the following .jar files to the server.cmd file used to start the WebLogic Process Integrator Server.

    xmlx.jar
    dom2.jar
    sax2.jar
    ebase.jar
    wlxt.jar

  4. In the WebLogic Process Integrator home directory, create a subdirectory called mflrepos.

  5. Copy the two sample .mfl files included with this sample (Payroll.mfl and HR.mfl) to the new subdirectory.

  6. Start the WebLogic Process Integrator Server.

  7. Run WebLogic Process Integrator Studio.

Step 2. Create the Business Operations for the Workflow

You need to create seven business operations for the sample. These business operations are referenced by the sample workflow; therefore, their names must exactly match the list below.

Notes: The names of these operations must exactly match the above list. Business operation names are case-sensitive.

To create the business operations:

  1. Choose Configure—>Business Operations and click Add.

  2. Enter the information for each business operation as shown in each of the seven dialog illustrations that follow.

  3. After you enter the information in the dialog, click OK.

  4. Repeat steps 1 through 3 for each business operation.

    Figure 2-1 Create XML/nonXML Translation Bean Business Operation

    Figure 2-2 Create Example HR Bean Business Operation

    Figure 2-3 Get Employee Info Business Operation

    Figure 2-4 Translate Binary to XML Business Operation

    Figure 2-5 Create Example Payroll Bean Business Operation

    Figure 2-6 Post Payroll Data Business Operation

    Figure 2-7 Translate XML to Binary Business Operation

    The following dialog shows a list of the completed business operations.

    Figure 2-8 List of Completed Business Operations

  5. Click Done when you have finished creating the Business Operations.

Step 3. Create the Template and Import the Template Definition

  1. Create a new template called WLXT Example.

  2. Select the template from the tree view in the left pane and click the right mouse button.

  3. Choose Import Template Definition.

  4. Select the definition file WLXTExample.xml. A message informing you that the business operations you just created will be executed during this workflow.

    Figure 2-9 Import Message

  5. Click OK to close the message box.

Step 4. Open and Activate the Template

  1. Select the WLXT Example template definition imported in the previous step from the tree view and click the right mouse button.

  2. Choose Open. The workflow created for this sample application displays.

    Figure 2-10 Workflow for WLXT Example

  3. Select the WLXTExample template definition again from the tree view and click the right mouse button.

  4. Choose Properties. The Template Definition properties dialog displays.

    Figure 2-11 Template Definition

  5. Click Active to activate the template and click OK.

  6. Select the WLXTExample template definition a third time from the tree view and click the right mouse button again.

  7. Choose Save to save the template definition with the changes you made.

Step 5. Start the Workflow

There are two ways to start the workflow created in the sample:

From the WebLogic Process Integrator Worklist

  1. Start WebLogic Process Integrator Worklist and choose Workflow—>Start a Workflow.

  2. Select WLXT Example. The template opens and the tasks are displayed.

    Figure 2-12 WLXT Example Worklist

  3. Select the Enter Payroll Data task and click the right mouse button.

  4. Choose Execute. The Enter Payroll Data dialog displays.

    Figure 2-13 Enter Payroll Data

  5. Enter the payroll data and click OK. The task is started and the workflow runs.

    Note: For this example, the employee numbers 1 through 4 are valid. You can enter any period ending date and any number of hours worked.

From the Command Line

To start the sample workflow from a command line prompt:

  1. Open the script file (Autopay.cmd on NT systems; Autopay.sh on Unix systems) in a text editor and check the location of the WebLogic Process Integrator Server. By default, the location is localhost and port:7001.

  2. Change the location information to match the host and port for your system.

  3. Run the command scripts for your system (NT or Unix), passing the same parameters shown in Figure 2-13. For example:

    Autopay 1 2000-11-30 60

Figure 2-14 shows the WebLogic Process Integrator output from executing the workflow.

Figure 2-14 WebLogic Process Integrator Server Console