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: Working with Orchestration Interfaces.

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.

In the Project Explorer view of ActiveBPEL, you should have the following:

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 Interfaces 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 Interfaces 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 expanding the Partner Link Types view and expanding LoanProcessLT.

  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 LoanProcessLT for a partner link name. To make the name more meaningful, type in LoanProcess 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 loanProcessor role is defined in the loanProcess.wsdl file.

    Operation wizard for request operation, page two

  9. Notice that the Operation wizard selects loanProcessRequest for the input variable name. This is referring to the single part element of the WSDL message used in the operation. Notice that the Type is selected as Element. To make the process variable name more meaningful, type in creditInformation, which is the name of the WSDL message. 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 loanProcess.wsdl.
  4. Rename the Receive. Either type ReceiveCustomerRequestforLoanAmount 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 ReturnApprovalResponse.
  6. In Properties view, select the All tab, and scroll down to Label to select Activity Type: Name. This step shows you that you can name activities in several ways.

Step 3: Create the Invoke Risk 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 Interfaces - 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 RiskAssessment, and click Next.
  7. The input variable to the risk assessment service is creditInformation, 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 riskAssessment.
  10. Click Finish.
  11. Rename the Invoke activity InvokeRiskAssessor, as the example shows.
  12. Properties view for InvokeLoanAssessor

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

  1. In Interfaces, expand the loanApprovalLT partner link type, and then expand the approver role.
  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 LoanApproval.
    3. Use the existing creditInformation 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.