Tutorial: Building Your First Business Process

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Step 6: Invoke a Business Process Using a Process Control

Process controls are used to send requests to and receive responses from other business processes in the same domain using Java/RMI. This scenario demonstrates a typical use case for a Process control—to call a subprocess from a parent business process.

For this part of the tutorial, we are going to change the design of the business process you created in Part I to take advantage of a tax calculation service provided by a business process instead of using the tax calculation Web service you initially used. You can do so by first creating a Process control from the tax calculation business process. Then you simply change the Control nodes you designed in Part I in such a way that, instead of communicating with the tax calculation Web service via the Web Service control, they communicate with the tax calculation business process, via the new Process control.

The tasks in this step include:

To Create a Process Control
  1. Select TaxCalcProcess.java

The tutorial application provides you with a simple business process (TaxCalcProcess.java) that calculates the sales tax for a Request for Quote. (See \Tutorial_Process_ApplicationWeb\src\requestquote.services\TaxCalcProcess.java in the Package Explorer.) In this step, you learn how to create a Process control for the TaxCalcProcess.java business process.

Note: If the Data Palette is not visible in WebLogic Workshop, choose
WindowArrow symbolShow ViewArrow symbolData Palette from the menu bar. Instances of controls already available in your project are displayed in the Data Palette tab in the Controls folder.
  1. Select the Controls folder, and click to display a drop-down list of controls that represent the resources with which your business process can interact.
  2. Point to Integration Controls, then select Process to view the Insert Control:Process dialog box.
  3. Enter taxCalcProcess as the name for the instance of the Process control you are about to create in the Field Name field, and click Next.
  4. In the Create Control dialog box, enter TaxCalculationProcess in the Name field, and click Next.
  5. In the Insert Control - Process dialog box, click Browse beside the Process field, then choose TaxCalcProcess.java from the /Tutorial_Process_Application_WEB/src/requestquote.services folder.
  6. The Start Method field is populated with requestTaxRate, which is the start method for TaxCalcProcess.java.

  7. Click Finish. The Process control (TaxCalcProcess.java) is created and displayed in the Package Explorer pane. Also, an instance of the control (taxCalcProcess) is added to the Data Palette. The Controls tab on the Data Palette should now resemble the following figure:


To Change the Control Send Node in the Request Quote Business Process to Interact With the Process Control
  1. In the Data Palette, click + beside taxCalcProcess under the Controls folder to expand the list of methods on the control.
  2. Select the following method:
  3. void requestTaxRate (QuoteRequestDocument quoteRequest)
  4. Drag and drop the method onto the requestTaxRate node in your RequestQuote.java. The following message is displayed:
  5. The Control node is already associated with a control method. Do you wish to replace this control method?

  6. Click OK. The requestTaxRate node changes to reflect the change in the type of control with which it is associated. The node representation changes to:
  7. Double-click the requestTaxRate node to open its node builder on the General Settings pane.
  8. Confirm that taxCalcProcess is selected in the Control field and that the following method is selected in the Method field:
  9. void requestTaxRate(QuoteRequestDocument quoteRequest)
  10. Click the Send Data tab to open the second pane in the node builder. The Variable Assignment option is selected by default, and the Control Expects field is populated with QuoteRequestDocument to indicate the format and type of the message expected by the tax calculation process.
  11. Note: The tax calculation process expects to receive a message of XML type QuoteRequestDocument—the same type as the requestXML variable to which the XML message sent from a client to the RequestQuote.java process is assigned. Unlike the scenario for sending data to the tax calculation Web service in Step 4: Invoke a Web Service, no transformation is required on this node—you can create a direct variable assignment.
  12. Click the arrow in the Select variables to assign field, and select requestXML(QuoteRequest).


  13. Click Close to close the node builder.
  14. This step completes the procedure to remove the call from your Request for Quote business process to a tax calculation Web Service—changing it to a call to a tax calculation business process (via the Process control you created).

To Change the Control Receive Node in the Request Quote Business Process to Interact With the Process Control
  1. In Design view, from the Data Palette, select the following method on the taxCalcProcess:
  2. void returnTaxRate(float salesTaxRate)
  3. Drag and drop the method onto the returnTaxRate node in your RequestQuote.java.
  4. The following message is displayed:

    The Control node is already associated with a control method. Do you wish to replace this control method?

  5. Click OK. The returnTaxRate node changes to reflect the change in the type of control with which it is associated.
  6. Double-click the returnTaxRate node to open its node builder on the General Settings pane.
  7. Confirm that taxCalcProcess is selected in the Control field and that the following method is selected in the Method field:
  8. void returnTaxRate(float salesTaxRate)
  9. Click the Receive Data tab to open the second panel in the node builder. The Variable Assignment option is selected by default, and the Control Returns field is populated with float salesTaxRate to indicate the type and name of the parameter expected to be returned by the tax calculation process.
  10. Click the arrow in the Select variables to assign field, and select taxRate (float).


  11. Click Close to close the node builder.
  12. This step completes the procedure to remove the callback handler that receives a message from a tax calculation Web Service—changing it to a callback handler that receives a message from a tax calculation business process (via the Process control you created).

  13. From the Workshop menu, select FileArrow symbolSave All.
To Test the Request Quote Process and its Call to the Tax Calculation Process

You can run and test the business process, which now contains an asynchronous call to another business process (via the Process control) in the same way as you tested the business process you created in Part I. To do so, follow steps 1 through 7, as described in Step 5: Run Your Business Process.

When you start the operations in the Test Form page, the Message Log refreshes to display a summary of the calls to, and responses from, the tax calculation business process.

Entries in the Message Log correspond to the methods on your business process:

Note About Additional Functionality in the Test Browser

The following additional links are available from the Test Form page in the Test Browser:

Graph

Click Graph to open the Process Graph tab in the Test Browser. The interactive instance graph is a fully expanded version of the view provided in the Design View. The interactive process graph requires Adobe SVG Viewer Version 3.0. The first time you open the Process Graph tab, you will be asked if you would like to download the Viewer from the Adobe Web site. You can also download the viewer directly from the Adobe Web site at http://www.adobe.com/svg/viewer/install/main.html.
Note: This viewer is not available for some configurations that WebLogic Platform 9.2 supports. For details, please see "Requirements for the Interactive Graph" in Process Instance Monitoring at http://download.oracle.com/docs/cd/E13214_01/wli/docs92/adminhelp/processmonitoring.html in WebLogic Integration Admin Console Online Help. For detailed information about the operating systems and browsers WebLogic Platform supports, see BEA WebLogic Platform Supported Configurations at http://download.oracle.com/docs/cd/E13196_01/platform/suppconfigs/index.html.
As previously mentioned, the Process Graph is a graphical representation of your business process and its execution path. The Process Graph highlights the node currently being executed. When the instance of the business process completes, the path of execution followed in your test is highlighted. In this scenario, the Yes path is executed—the No path is gray on the Process Graph to indicate that this path was not taken during the execution of this instance of the business process.
Note: Press Alt and drag the mouse pointer over the Process Graph to move and position it on the Test Browser page. To zoom in, press Ctrl+click; to zoom out, press Ctrl+Shift+click. Alternately, right-click on the Process Graph and select the Zoom In or Zoom Out command from the drop-down menu.
You will review your running business process in the Process Graph in a later step in the tutorial.
Note: Use the back and forward arrows to navigate between the pages in the BEA Workshop Test Browser.

Monitor

Click Monitor to open the BEA Products Administration Console in a Web Browser. Login using username = weblogic and password = weblogic. The BEA Products Administration Console opens to the Process Instance Details page. The WebLogic Integration Administration Console allows you to administer and manage your BEA Products applications. For example, if you click View Statistics on the Process Instances navigation pane, you access a Process Instance Statistics page. This page displays a summary of business process instances grouped by the process type. To view the instances of a process type that ran or are running on your server, click the process name. Processes instances are identified by their instanceID. Note that the instanceID displayed for your RequestQuote business process matches the instanceID displayed on the Message Log pane (see the preceding figures in this topic).

Monitor all RequestQuote.java processes

Click Monitor all RequestQuote.java processes at the top of the Test Form to open the BEA Products Administration Console. (Login using username = weblogic and password = weblogic.) When you use this link to open the Administration Console, it opens on the Process Instance Summary page, which displays a summary of all the instances of business processes that ran or are running.

To stop the Test Browser, you can simply close it, or return to BEA Workshop and click on the tool bar.

This step completes Part II of the tutorial.

Related Topics

Process Control

Managing WebLogic Integration Solutions


  Back to Top       Previous  Next