Tutorial: Designing 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

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.

In this part of the tutorial, you change the design of the business process you created in the previous part, to take advantage of a tax calculation service provided by a business process instead of using the tax calculation web service you used earlier. You can do this by first creating a process control from the tax calculation business process. Then, you simply change the control nodes in such a way that instead of communicating with the tax calculation web service through the web service control, the nodes communicate with the tax calculation business process through the new process control.

The tasks in this step include:

 


Create Process Control for Tax Calculation Process

  1. Open RequestQuote.java in the Package Explorer view.
  2. If the Data Palette view is not visible, choose Window > Show View > Data Palette.
  3. Instances of controls that are already available in your project are displayed in the Controls folder of the Data Palette view.

  4. Select the Controls folder, and click Message Log to display a drop-down list of controls that represent the resources with which your business process can interact.
  5. Choose Integration Controls > Process.
  6. The Insert Control: Process dialog box is displayed.

  7. In the Field Name field, enter taxCalcProcess as the name for the instance of the process control that you creating, and click Next.
  8. In the Create Control dialog box, enter TaxCalculationProcess in the Name field, and click Next.
  9. In the Insert Control - Process dialog box, click Browse... and select /Tutorial_Process_Application_Web/src/requestquote.services/TaxCalcProcess.java.
  10. This Java file is a simple business process that calculates the sales tax for an RFQ.

    The start method for TaxCalcProcess.java (requestTaxRate) is displayed in the Start Method field.

  11. Click Finish.
  12. The process control (TaxCalcControl.java) is created and displayed in the Package Explorer view. An instance of the control (taxCalcProcess) is added to the Data Palette. The Controls area in the Data Palette view now resembles the following figure:

    Figure 7-1 Controls in Data Palette


    Controls in Data Palette

 


Change Control Send Node to Interact with Process Control

  1. In the Data Palette, click + beside taxCalcProcess under the Controls folder to expand the list of methods on the control.
  2. Drag the void requestTaxRate (QuoteRequestDocument quoteRequest) method from the Data Palette to the Design view and drop it on the requestTaxRate node in the RequestQuote.java process.
  3. The following message is displayed:

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

  4. Click OK.
  5. The requestTaxRate node changes to reflect the type of control with which it is now associated. The node changes as follows:

    Figure 7-2 Change in Node After Associating Control


    Change in Node After Associating Control

  6. Double-click the requestTaxRate node to open its node builder.
  7. In the General Settings tab, confirm that taxCalcProcess is selected in the Control field and that the following method is selected in the Method field:
  8. void requestTaxRate(QuoteRequestDocument quoteRequest)
  9. Select the Send Data tab.
  10. By default, the Variable Assignment option is selected, and the Control Expects field contains QuoteRequestDocument quoteRequest, indicating the format and type of the message that the tax calculation process requires.

    Note: The tax calculation process requires 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.
  11. In the Select variables to assign field, and select requestXML(QuoteRequest).
  12. Click Close.
  13. This step completes the procedure to change your business process to call the tax calculation business process instead of the tax calculation web service.

 


Change Control Receive Node to Interact with Process Control

  1. In the Data Palette, click + beside taxCalcProcess under the Controls folder to expand the list of methods on the control.
  2. Drag the void returnTaxRate(float salesTaxRate) method from the Data Palette to the Design view and drop it on the returnTaxRate node in the RequestQuote.java process.
  3. The following message is displayed:

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

  4. Click OK.
  5. The returnTaxRate node changes to reflect the type of control with which it is now associated.

  6. Double-click the returnTaxRate node.
  7. In the General Settings tab, 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. Select the Receive Data tab.
  10. The Variable Assignment option is selected by default, and the Control Returns field contains float salesTaxRate, indicating the type and name of the parameter expected to be returned by the tax calculation process.

  11. In the Select variables to assign field, and select taxRate (float).
  12. Click Close.
  13. This step completes the procedure to change the callback handler to receive a message from the tax calculation business process instead of from the tax calculation web service.

  14. From the Oracle Workshop for WebLogic menu, choose FileArrow symbolSave All.

 


Test Request Quote Process

You can run and test the business process, which now contains an asynchronous call to another business process in the same way that you tested the business process in the previous part. Perform steps 1 through 7 of Step 5: Run the 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.

Figure 7-3 Message Log

Message Log

Entries in the message log correspond to the methods in your business process:


  Back to Top       Previous  Next