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 2: Specify How the Process Is Started

In this step, you define how your business process is started. As web services, business processes expose their functionality through methods, which clients invoke to make requests. You can also create Process controls from business processes. In the case of Process controls, other resources can interact with your process via the controls interface.

Note: You will learn more about Process controls in Step 6: Invoke a Business Process.

In this step, you design the Start node in your business process to receive a Request for Quote (RFQ) message from a client; receipt of the RFQ message is the trigger that starts the business process.You also create a variable to hold the incoming RFQ message.

In the Design view, interactions between a business process and a client are represented by Client Request and Client Response nodes. In this case, you add a Client Request node to your business process and, subsequently, create the code for this node to handle receipt of a message from a client.

Complete the following tasks to design the Client Request node that starts your business process:

 


Create Start Node

  1. In the Package Explorer view, double-click RequestQuote.java. The RequestQuote business process is displayed in the Design view.
  2. Figure 3-1 RequestQuote Process


    RequestQuote Process

  3. Double-click the Start node to display the node builder, which displays the possible start methods.
  4. Figure 3-2 Node Builder - Start Node


    Node Builder - Start Node

  5. Select Invoked via a Client Request, and click Close.
  6. The empty node that was associated with the Start node changes to a Client Request node.

 


Design Client Request Node

Designing the Client Request node includes creating a method and parameters that the client uses to trigger the start of the business process, and designing the logic for handling receipt of requests from the client.

  1. Rename the Client Request node.
  2. Select the Client Request node and press F2. Enter Client Requests Quote as the new name and press Enter. Your business process should now be as shown in the following figure:

    Figure 3-3 Rename Client Request Node


    Rename Client Request Node

  3. Double-click the Client Requests Quote node.
  4. The node builder is displayed.

    Figure 3-4 Node Builder


    Node Builder

    Note: Node builders provide a task-driven user interface to help you design the communication between a business process and its clients and other resources. To access the node builder for any node, double-click the node in the Design view. A node builder that is specific for the type of node that you selected is displayed in-line in your business process.

    The node builder for a Client Request node displays the two tabs: General Settings and Receive Data.

Specify General Settings

The following steps describe how to specify the method exposed by your business process. Clients invoke this method to start and make requests on your business process.

  1. On the General Settings tab, in the Method Name field, change the default method name from clientRequest to quoteRequest.
  2. Note: When you make your business process available as a service, the name that you assign to a method on a Client Request node is the name of the method that is exposed through the Web Services Description Language (WSDL). It is recommended that you use a name that clearly indicates the service offered by the business process.
  3. Specify a data type for the parameter of the quoteRequest method:
    1. Click Add... on the General Settings tab. A panel showing the data types is displayed.
    2. Figure 3-5 Specify Data Type for Parameters


      Specify Data Type for Parameters

      The RFQ is an XML message. So an XML data type is required at this node.

    3. Select the XML tab.
    4. The panel displays a list of XML schema files under Typed and a list of Untyped XML objects that are available in your project.

      The XML schemas that you need for this tutorial are in the Schemas folder of the utility project. The schemas provided include QuoteRequest.xsd, PriceQuote.xsd, AvailQuote.xsd, Quote.xsd, and a system schema DynamicProperties.xsd.

      Note: For XML schemas to be available to the services in your application, they must be located in Schemas folder under the web or utility project.

      In this step, you use the QuoteRequest.xsd XML schema to specify the structure of documents that clients can send to trigger your business process.

    5. In the XML tab, progressively expand the nodes under Typed node, up to and including the QuoteRequest.xsd node.
    6. A graphical representation of the QuoteRequest.xsd XML schema is displayed.

    7. Select the quoteRequest node. It represents the parent element in your XML document.
    8. The following value appears in the Type Name field: org.example.request.QuoteRequestDocument.

      Figure 3-6 Request Quote Parameter Type


      Request Quote Parameter Type

    9. In the Parameter Name field, enter requestXML in place of the default parameter name (x0).
    10. Click OK.
    11. The parameter type (QuoteRequestDocument) and name (requestXML) are displayed in the General Settings tab in the node builder.

      This step completes the specification of the method exposed to clients by your business process. Messages from clients are expected to be typed XML; that is, the messages received from clients must contain XML data that is valid against an XML schema (in this case, QuoteRequest.xsd).

      Note: Sample XML files (QuoteRequest.xml and QuoteRequest_a.xml) that are provided in the testxml folder are used later in the tutorial to test the process.

      The General Settings tab is updated, as shown in the following figure, to indicate that you successfully completed the specification of a method name and parameters.

      Figure 3-7 General Settings Tab - Updated


      General Settings Tab - Updated

      Note: General Settings Tab - Updated indicates a completed task; General Settings Tab - Updated indicates an incomplete task.

Specify Receive Data

  1. Select the Receive Data tab, which lets you to specify a variable that receives an RFQ message from a client.
  2. The Receive Data tab has two modes:

    • Variable Assignment: You can use this mode to assign data received from a client to a variable of the same data type.
    • Transformation: You can use this mode to create a transformation between the data assigned to a variable and the data expected by the method parameter.
    • By default, the Receive Data tab opens in the Variable Assignment panel.

      Note: It is also possible to assign typed non-XML (MFL) data directly to XML variables in the Receive Data tabs; no transformation is necessary. A discussion about non-XML (MFL) data is outside the scope of this tutorial. To learn about MFL files and the assignment of the data to business process variables, see Business Process Variables and Data Types in Guide to Building Business Processes.

      For this tutorial, we use the Variable Assignment mode because we want to assign the XML message received from the client directly to a variable of the same data type. In subsequent steps, you create a variable of typed XML (QuoteRequestDocument) to which your process assigns the incoming RFQs from clients.

  3. In the Select variables to assign drop-down list, select Create new variable...
  4. The Create Variable dialog box is displayed.

  5. In the Variable Name field, enter requestXML.
  6. In the XML tab, progressively expand the tree structure under the Typed node up to and including the QuoteRequest.xsd node; then, select the quoteRequest element as shown in the following figure.
  7. Figure 3-8 Create Variable Dialog Box


    Create Variable Dialog Box

    The following value appears in the Type Name field: org.example.request.QuoteRequestDocument.

  8. Click OK.
  9. The new variable is created and displayed in the Receive Data tab.

    Figure 3-9 Variable Assignment


    Variable Assignment

    Note: The requestXML variable is shown as an XML variable in the Data Palette view.

    Both tabs in the node builder (General Settings and Receive Data) are marked as complete Variable Assignment.

  10. Click Close.
  11. In the Design view, note the completeness indicator associated with the Client Requests Quote node changes from Variable Assignment to Variable Assignment, confirming that the design of the node is complete.

    Figure 3-10 Completeness Indicator


    Completeness Indicator

  12. From the Oracle Workshop for WebLogic menu, choose File Arrow symbolSave All.

Related Topics


  Back to Top       Previous  Next