ActiveBPEL™ Designer User’s Guide

Tutorial Part 5: Adding Process Activities and Properties

You have now completed:

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

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

Step 1: Use the Outline view to add and select building blocks

The Outline view displays all major components of a BPEL process. The Outline view shown on the left is the default for a new process, containing only the parent nodes. Your Outline should look like the one on the right. By starting your process using Web References, you have automatically added the appropriate namespace, partner links, variables, and several activities.

Outline view default view

Outline view with items added view the operation  wizard

  1. In Outline view, select Correlation Sets.
  2. Drag the Correlation Sets node to the bottom of the outline. The loan approval process does not include any correlation sets, so you can move this node out of the way.
  3. Tip: You can move items up and down to reorganize them. You can right-mouse click on a node to add new items of the same type.

Step 2: Rename a Namespace Prefix

Each WSDL file declares one or more namespaces that provide a context for messages, port types, and other definitions. The namespaces that are declared in the WSDL files that your process references must also be declared in the process itself.

Because one namespace can have many WSDL files associated with it, ActiveBPEL identifies the correct WSDL file by using the Imports function. The Operation wizard automatically added the import, and added a default namespace prefix, which you can rename to make it more meaningful.

  1. In Outline view, expand Imports to see the location of the WSDL and namespace.
  2. Imports node of Outline view displaying WSDL location and namespace

  3. Expand Namespaces and select the ns1 namespace, which is the namespace the Operation wizard added.
  4. In the Properties view, type lns (lns is short for loan namespace) in the Prefix field to provide a shortcut for the loan approval URI reference. Press Enter.

Tip: All new processes contain two common namespaces. The xsd namespace defines the location of the XML schema. The bpel namespace defines the location of the BPEL schema.

Step 3: Use a Shortcut to Automatically Create an Assign Activity

There is one more activity the process needs, an Assign. In the loan approval process, the assessor must assign a congratulations-type value to the approval message sent to the customer in the Reply. An Assign accomplishes this through a Copy Operation.

Within the Process Variables view, you can create a Copy Operation automatically. The Copy Operation copies a literal value (“yes”) to a message part (accept).

  1. Display the Process Variables view, which is stacked below Web References.
  2. Right-mouse click the approval variable, and select Open.
  3. Right-mouse click the accept message part, and select Copy> To, as the illustration shows.
  4. Note: The Copy >To option means create the TO side of the Copy Operation.

    Context menu for process variable part

  5. In the Copy Operations dialog, complete the FROM part as follows:
    1. Select Literal from the Type list.
    2. Type in yes in the Literal Contents field.

    Copy Operation dialog

  6. Click OK, and you will see a new Assign activity in the Process Editor. The activity is in the upper left corner, and you can move it below the Invoke Loan Assessor.
  7. Rename the Assign as AssignYestoAccept.

Tip: There are more shortcuts you can take when working with variables. Be sure to read the Using Variables section of ActiveBPEL Online Help.

Step 4: Add Links for Sequencing Activities

Depending on the loan amount in the request, either the loan assessor’s Web service or the loan approver’s Web service is invoked. Our process implements this logic by linking the Receive to both Invokes. Since the sequence is conditional, a transition condition will be added to both links in Step 5.

  1. Select the Receive activity.
  2. Select InvokeLoanAssessor.
  3. Select the Link toolbar icon or select Link Activities from the right-mouse menu.
  4. In Properties view, type in the Link Name field, receive-to-assess.
  5. Repeat Steps 1-4 to create a link from the Receive to the Invoke Loan Approver activity, naming the link receive-to-approve.

Step 5: Add a Transition Condition to Links

  1. Select the receive-to-assess link in the Process Editor.
  2. Double-click the link.
  3. In the Transition Builder dialog, double-click the amount part of the request variable to add the appropriate expression to the Transition box.
  4. Complete the expression by selecting the “less than” operator and typing in 10000, as shown in the following example. Click OK.
  5. Transition Condition Builder dialog

  6. For the receive-to-approve link, add the expression as follows: $request.amount >= 10000, and click OK.

Step 6: Add links and link transitions for the Invoke activities

The Loan Assessor returns a result of high risk or low risk for the customer. The process can assign the low risk message to a congratulations-type of reply to the customer or send a high risk message to invoke the Loan Approver for a full review of the customer.

  1. Add a link from Invoke Loan Assessor to Invoke Loan Approver.
  2. Name the link assess-to-approve.
  3. Add a link transition for a high risk condition by creating the expression $risk.level != 'low'
  4. Change the Link Router style to create a straight, rather than stair-step, link:
  5. Add a link between Invoke Loan Assessor and the Assign. Label the link assess-to-setMessage with a transition expression: $risk.level = 'low'.
  6. Link the Assign activity to the Reply activity, and link the Invoke Loan Approver activity to the Reply. Do not add any link transitions to these links.

Your process should look like the following illustration.

Completed BPEL diagram for tutorial

Step 7: Add a Create Instance property to the Receive activity

The Receive is the activity that kicks off the process, so you must set the Create Instance property to Yes.

  1. In the Process Editor, select the Receive activity.
  2. In the Properties view, select Yes from the Create Instance drop-down.

Step 8: Disable the Abstract Process setting and validate your process

  1. Click on a blank part of the Process Editor to display the Properties view for the process.
  2. In the Abstract Process property, ensure that No is selected from the drop-down list, as shown.
  3. Process properties

  4. Save your file.
  5. View Problems view, stacked next to Properties view. There should be no errors listed.
  6. If any errors are listed, double-click the error to go to the source of the error. You can also compare your file to loanapproval_tutorial_complete.bpel to discover any differences.

You have completed the main process definition.

Continue to Tutorial Part 6: Adding Fault Handling.