ActiveBPEL™ Designer User’s Guide

Tutorial Part 4: Using the Operation Wizard to Create Web Interaction Activities

If you have not already done so, complete or review Tutorial Part 1: Starting a New Process, Tutorial Part 2: Planning and Designing a Process, and Tutorial Part 3: Adding Web References.

In Part 2 of the tutorial, you added a BPEL Receive activity on the Process Editor canvas. Now you will begin creating an executable process based on a WSDL file that you have added to Web References.

In the Navigator view of ActiveBPEL, you should have the following:

In Web References view, you should have loanServicePT.wsdl that you added in Part 3. The Web References view should be set to Partner Link Types.

By completing Part 4 of the tutorial, you will be able to:

Step 1: Use the Operation Wizard to create a pair of Receive and Reply activities

ActiveBPEL contains an Operation wizard that uses Web References to build a good chunk of a BPEL process automatically. It discovers the namespace, partner link type and message information required to create Receive, Reply and Invoke activities, that is, the Web service activities.

The loan approval process needs four Web service activities:

  1. Ensure your file, tutorial.bpel, is open in the Process Editor.
  2. Delete any activities that remain on the canvas, such as a Receive or Empty activity that you created in Part 2 of the tutorial. The canvas should be blank.
  3. From Web References view, drag the request operation to the Process Editor canvas.
  4. As described in the last part of the tutorial, you can find the request operation by setting Web References to Partner Link Types view and expanding loanPartnerLT.

  5. In the Operation wizard, select the Receive-Reply option and click Next.
  6. A BPEL process must begin by receiving an input message. This means you must start with either a Receive or a Pick activity, since they are structured to receive data from a business partner’s Web service. Since the loan approval process contains a Receive and matching Reply, you can create both activities at the same time.

    Operation wizard for request operation, page one

  7. Notice that the Operation wizard suggests loanPartnerLT for a partner link name. To make the name more meaningful, type in customer for the partner link, and click Next.
  8. A partner link describes the roles that a process and service can play as well as what data they can manipulate in that role. They are based on partner link types defined in a WSDL file. A business process can have many roles as it interacts with services, and each role is defined within a partner link. The customer role is defined in the loanServicePT.wsdl file.

    Operation wizard for request operation, page two

  9. Notice that the Operation wizard selects creditInformationMessage for the input variable name. This is the WSDL message used in the operation. To make the process variable name more meaningful, type in request, and click Next.
  10. A BPEL process receives, manipulates, and sends data through XML variables. Variables hold the messages exchanged between business partners as well as data used only within the process.

    Operation wizard for request operation, page three

  11. Name the output variable approval.
  12. Click Finish.
  13. The Receive and Reply activities appear in the Process Editor. The activities have valid properties.

    The following illustration shows the activities and properties for the Receive created by the Operation wizard.

    Activities and properties created via Operation wizard

Step 2: Rename the Receive and Reply activities

To make the activity names more meaningful, we will rename them.

  1. Select the Receive activity in the Process Editor.
  2. Ensure that the Properties view is in focus.
  3. Look at the properties of the Receive activity. The required properties, partner link, operation, and variable contain valid values from loanServicePT.wsdl. Notice that the optional port type property is also included.
  4. Rename the Receive. Either type ReceiveCustomerRequestforLoanAmt in the activity label on the Process Editor canvas or, in Properties view, type into the Activity Name field. Do not use spaces.
  5. Select the Reply activity, and rename it AcceptMessageToCustomer.
  6. In Properties view, scroll down to Label, and select Activity Type: Name. This step shows you that you can name activities in several ways.

Step 3: Create the Invoke Loan Assessor Activity using the Operation Wizard

The process requires invocation of two different Web services. Each Web service receives an input from the process and returns an output.

  1. In Web References - Partner Link Types view, expand riskAssessmentLT and then expand assessor.
  2. Select the check operation, as shown in the example.
  3. Web References partner link types view with check operation displayed

  4. Drag the check operation to the Process Editor.
  5. In the Operation wizard, select Invoke for the activity type, and click Next.
  6. Name the partner link assessor, and click Next.
  7. The input variable to the loan assessor is request, so we will use the existing variable that was named in the Receive activity, as shown in the example. Click Next.
  8. Operation wizard for check operation, page three

  9. Create a new output variable named risk.
  10. Click Finish.
  11. Rename the Invoke activity InvokeLoanAssessor, as the example shows.
  12. Properties view for InvokeLoanAssessor

Step 4: Create the Invoke Loan Approver activity using the Operation Wizard

  1. In Web References, expand the loanApprovalLT partner link type.
  2. Drag the approve operation to the Process Editor canvas.
  3. In the Operation wizard, do the following:
    1. Select Invoke for the activity type.
    2. Create a partner link named approver.
    3. Use the existing request and approval variables.
  4. Rename the activity InvokeLoanApprover, as shown in the example.
  5. Properties view for InvokeLoanApprover

You should now have four activities on the Process Editor canvas, as shown.

Partially built process containing four activities

The Web service activities are in place, and you can continue to Tutorial Part 5: Adding Process Activities and Properties.