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

In this step, you specify 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 business process via the controls interface. You learn more about Process controls in Call a Business Process Using a Process Control of this tutorial.

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

In the Design View, the interactions between a business process and a client application 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 on this node to handle the receipt of a message from a client.

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

To Create a Start Node in Your Business Process
  1. On the Package Explorer pane, double-click RequestQuote.java. Your RequestQuote business process is displayed in the Design view.

  2. Quote Request

    You must add a node to this Start node to define the start method for your business process.

  3. Double-click the Start node to display the Start node builder.
  4. The node builder displays with the possible start methods.


    Quote Request

  5. In the node builder, select Invoked via a Client Request.
  6. Click Close. The node builder closes and the empty node that was associated with the Start node is now populated with a Client Request node.
To Design Your Client Request Node

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

  1. Rename the Client Request node. To do so, click the Client Request node and press F2. Enter Client Requests Quote as the name to replace Client Request for the node. Press Enter. Your business process should now resemble the following figure:

  2. Quote Request

  3. In Design view, double-click the Client Requests Quote node. The node builder is invoked.

  4. Quote Request

    Note: Node builders provide a task-driven user interface that helps 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 specific for the node you selected is displayed in-line in your business process.

    As shown in the preceding figure, the node builder for a Client Request node displays the following tabs to guide your design of the communication between a client and the business process: General Settings and Receive Data.

To Specify General Settings

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

  1. In the Method Name field on the General Settings tab, change the default method name from clientRequest to quoteRequest.
  2. Note: When you make your business process available as a service, the name you assign to a method on a Client Request node is the name of the method that is exposed via the Web Services Description Language (WSDL). In general, it is recommended that you define a name that is representative of the service offered by your business process.
  3. Specify a data type for the parameter to your quoteRequest method:
    1. Click Add on the General Settings tab. A panel, which shows the data types is displayed:

    2. Quote Request

      The Request for Quote message from clients is an XML message. Therefore, we are concerned with XML Types at this node.

    3. If necessary, select XML. The panel is populated with a list of XML Schema files (Typed XML) and a list of Untyped XML objects available in your project.
    4. Note: The XML Schemas you need as you build the Quote Request business process in this tutorial are provided in the Tutorial_Process_Application_UTILITY\Schemas folder. The Schemas provided include QuoteRequest.xsd, PriceQuote.xsd, AvailQuote.xsd, Quote.xsd and a system Schema: DynamicProperties.xsd.

      For XML Schemas to be available to the services in your application, they must be located in a project. Projects (Web, or Utility) are represented in the Package Explorer pane as folders.

      In this step, we use an XML Schema, specifically QuoteRequest.xsd, to specify the structure of documents that clients can send to start your business process.
    5. In the list of XML Types, go to Typed and expand upto QuoteRequest.xsd level, and click the + associated with QuoteRequest.xsd.
    6. A graphical representation of the XML Schema defined by QuoteRequest.xsd is displayed in the node builder pane.

    7. Click the quoteRequest node. (It represents the parent element in your XML document.) The Type field is populated with the XML type: org.example.request.QuoteRequestDocument.
    8. Figure 4-1 Quote Request


      Quote Request

    9. In the Parameter Name field, replace the default parameter name (x0) with requestXML.
  4. Click OK. The parameter specifications you made (parameter type is QuoteRequestDocument, parameter name is requestXML) is displayed in General Settings tab in the node builder.
  5. 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 that is valid against an XML Schema (in this case, QuoteRequest.xsd).

    Note: Example XML messages (QuoteRequest.xml and QuoteRequest_a.xml) that can be received from a client are provided in the testxml folder in your project. You use them later in the tutorial to test your business process.

    The General Settings tab is updated to indicate that you successfully completed the specification of a method name and parameters: Quote Request indicates that a task is complete; Quote Request indicates that a task is not complete.


    Quote Request

To Specify Receive Data
  1. Click the Receive Data tab, which allows you to specify a variable that receives a Request for Quote message from a client that is assigned at run time. By default, the Receive Data tab opens on the Variable Assignment panel.
  2. Note: Receive Data tabs have two modes:
    • Variable Assignment—Use this mode when you want to assign the data received from the client to a variable of the same data type.
    • Transformation—Use this mode when you want to create a transformation between the data assigned to a variable and that expected by the method parameter.
    • Note: Note that 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 of 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 this case, 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 Request for Quote from clients.

  3. Under Select variables to assign, click the arrow and select Create new variable...

  4. Quote Request

    The Create Variable dialog box is displayed.

  5. In the Create Variable dialog box:
    1. In the Variable Name field, enter requestXML.
    2. In the Select Variable Type field, in the list of XML Types, go to Typed and expand upto QuoteRequest.xsd, and select the quoteRequest element.

    3. Quote Request

      The Variable Type field is populated with org.example.request.QuoteRequestDocument.

    4. Click OK. Your new variable is created and displayed in the Receive Data tab.

    5. Quote Request

      Note: The requestXML variable is also listed as an XML variable in Outline.


      Quote Request

      Both tabs in the node builder (General Settings and Receive Data) are marked complete Quote Request.

  6. Click Close. The Client Requests Quote node builder closes.
  7. In Design view, note that the completeness icon associated with the Client Requests Quote node changed from Quote Request to Quote Request indicating that the design of the node is complete.


    Quote Request

  8. From the Workshop menu, select FileArrow symbolSave All.

Related Topics

Components of Your Application

Designing Start Nodes

Working With Data Types

Interacting With Resources Using Controls


  Back to Top       Previous  Next