Legal | Privacy
Using Oracle JDeveloper 10g BPEL Designer to Model and Deploy the Loan Flow Process

Using Oracle JDeveloper 10g BPEL Designer to Model and Deploy the Loan Flow Process

This tutorial covers the use of Oracle JDeveloper 10g BPEL Designer to invoke the United Loan, Star Loan, and Credit Rating Web services. This tutorial uses JDeveloper to create a BPEL process called MyLoanProcess.

Approximately 1 hour

Topics

This tutorial covers the following topics:

Creating a New BPEL Project and a BPEL Process Manager Connection

Creating the Partner Links

Adding New Process Variables
Designing the Loan Flow Process
Deploying and Testing the Loan Flow Process

Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: Because this action loads all screenshots simultaneously, response time may be slow depending on your Internet connection.)

Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with that step.

Overview

This tutorial demonstrates how to design the Loan Flow BPEL process by using Oracle JDeveloper 10g BPEL Designer. MyLoanProcess performs a credit check, by invoking the CreditRatingService synchronously with a loan application from the client. The loan application returned with a credit rating (from the CreditRatingService) is then processed asynchronously by the following two Web services:

UnitedLoan Web service
StarLoan Web service

Back to Topic List

The loan application document, supplied by a client, is first modified with a credit rating value after synchronously invoking a CreditRatingService process. The modified loan document is processed in parallel by the UnitedLoan and StarLoan Web services. Each loan-provider Web service returns a loan offer that is document for acceptance or processing by the client.

Back to Topic List

Prerequisites

Before starting this tutorial, you should:

1.

Install Oracle JDeveloper BPEL Designer and the Oracle BPEL PM Server into a directory called D:\JDeveloper\JDevBPEL.


2.

Start the Oracle BPEL PM Server as follows:
Start > Programs > Oracle - OracleBPM > Oracle BPEL Process Manager 10.1.2 > Start BPEL PM Server


3.

Start the Oracle JDeveloper 10g BPEL Designer by double-clicking the desktop icon labeled BPEL Designer:

Note: You can select Start > Programs > Oracle - OracleBPM > Oracle BPEL Process Manager 10.1.2 > BPEL Designer to start Oracle JDeveloper 10g BPEL Designer.

 

4.

Deploy the CreditRatingService, StarLoan, and UnitedLoan Web services to the Oracle BPEL PM Server by entering the following commands in a command window:

D:
cd \JDeveloper\JDevBPEL\integration\bpm\orabpel\samples\demos\LoanDemo
obant

Note: A BPEL process called LoanFlow is deployed by executing the obant script in the LoanDemo directory. However, the LoanFlow BPEL process was removed from the BPEL Server to avoid confusion with the MyLoanProcess BPEL process that is created in this tutorial.

 

5.

Verify that the CreditRatingService, StarLoan, and UnitedLoan Web services have been deployed, select Start > Programs > Oracle - OracleBPM > Oracle BPEL Process Manager 10.1.2 > BPEL Console. The BPEL Console shows the Web service names in the Deployed BPEL Process column on the Dashboard page:

 

6.

Right-click this LoanFlow.xsd link to download and save the link or target to a file in a directory called C:\Hands_on_Labs\bpel_jdev\support_files, or a temporary directory of your choice.

 

Back to Topic List

Creating a New BPEL Project and a BPEL Process Manager Connection

To create a new BPEL project, perform the following steps:

1.

In the Oracle JDeveloper 10g BPEL Designer menu, select File > New:

Place the cursor over this icon to see the image

 

2.

In the New Gallery window, click the General category and select the Workspace item:

Place the cursor over this icon to see the image

Click OK.

 

3.

In the Create Workspace dialog box, apply the following field values:

Workspace Name: MyLoanProcessWS

Directory Name: Accept the value automatically resembling the workspace name entered.
Select Add a New Empty Project to clear the check box.

Leave the Open in New Navigator check box clear.

Place the cursor over this icon to see the image

Click OK.

 

4.

The new workspace, MyLoanProcessWS, appears in the JDeveloper Applications - Navigator pane under the Applications folder. Press [Ctrl]+[S] to save the new workspace:

Note: You can select File > Save to save the selected file, or you can select File > Save All to save changes to all files in the project.

 

5.

To create a new BPEL Project, right-click MyLoanProcessWS in the Applications - Navigator and select New Project:

Place the cursor over this icon to see the image

 

6.

In the New Gallery window, click Projects under General and select the BPEL Process Project item:

Place the cursor over this icon to see the image

Click OK.

 

7.

In the BPEL Process Project dialog box, enter the following values:

BPEL Process Name: MyLoanProcess

Namespace: http://xmlns.oracle.com/MyLoanProcess, which automatically mirrors the BPEL process name. Do not change this value.
Template: Asynchronous BPEL Process is selected by default. Accept this value.

In the Project Content area, the Use Default check box should be selected.

Click OK.

 

8.

In the Navigator, the following three files are created:

bpel.xml contains partner link bindings for the BPEL project.

MyLoanProcess.bpel contains the BPEL elements describing the BPEL process.
MyLoanProcess.wsdl describes the interfaces for the BPEL process as a Web service.

JDeveloper automatically opens MyLoanProcess.bpel on the Diagram View page.

Select File > Save All to save the new project files.

 

9.

The initial BPEL process activities for MyLoanProcess.bpel are shown on the Diagram View page:

Note: The Diagram View page is used to graphically create and edit the BPEL process.

 

10.

To view the BPEL structure for MyLoanProcess.bpel in the Structure pane, click the Diagram View tab.

To import an XML Schema document into the BPEL project directory, select Project Schemas in the Structure pane:

Click Import.

 

11.

In the Open window, use the Location field to navigate to the C:\Hands_on_Labs\bpel_jdev\support_files directory (or the temporary directory into which you downloaded the file). Select LoanFlow.xsd:

Select Open.

 

12.

In the Copy Schema message window, click Yes to copy the schema file into the project directory:

 

13.

In in the Applications - Navigator pane, expand the Miscellaneous Files node to see the LoanFlow.xsd file as a file in the project:

Click in the BPEL process Diagram View window to see the LoanFlow.xsd entry under the Project Schemas node in the Structure Pane.

The XML schema file provides definitions for the loanApplication and loanOffer types that are used to define the structure of the input and response documents of the BPEL process, respectively.

Select File > Save All to save the changes to the project and workspace.

 

14.

Double-click MyLoanProcess.bpel in the Applications - Navigator:

Click the Message Types icon in the toolbar.

 

15.

To set the message type for the loan request, select MyLoanProcessRequestMessage in the Message Types window.

click Edit.

16.

In the Edit Message Type window, select payload:

Click Edit.

 

17.

In the Edit Message Part - payload window, select Element:

Click the Browse Elements icon.

 

18.

In the Type Chooser window, expand Project Schema Files, expand LoanFlow.xsd, and select loanApplication:

Click OK.

 

19.

In the Edit Message Part - payload window, click OK:

 

20.

In the Edit Message Type window, click OK:

 

21.

To set the response message type for the BPEL process, select MyLoanProcessResponseMessage in the Message Types window:

Click Edit.

 

22.

In the Edit Message Type window for the response message, select payload:

Click Edit.

 

23.

In the Edit Message Part - payload window, select Element:

Click the Browse Elements icon.

 

24.

In the Type Chooser window, expand Project Schema Files, expand LoanFlow.xsd, and select loanOffer:

Click OK.

 

25.

To close the Edit Message Part - payload window, click OK. In the Edit Message Type window, click OK. In the Message Types window, click Close:

 

26.

To create a connection with the BPEL Process Manager, choose View > Connection Navigator:

Note: The Applications - Navigator tab is replaced with the Connections - Navigator tab.

 

27.

Right-click the BPEL Process Manager Server node and choose New BPEL Process Manager Server Connection from the context menu:

 

28.

On the Create BPEL Process Manager Server Connection - Welcome page, review the information on the Welcome page:

Click Next.

 

29.

In the Create BPEL Process Manager Server Connection - Step 1 of 3: Name window, enter BPEL_conn in the BPEL Process Manager Connection Name field:

Click Next.

 

30.

In the Create BPEL Process Manager Server Connection - Step 2 of 3: Connection window, accept the default values for the User Name, Host Name, and Port Number fields.

Enter welcome in the Password field:

Note: Characters entered in the Password field appear as asterisks (*).

Click Next.

 

31.

In the Create BPEL Process Manager Server Connection - Step 3 of 3: Test Connection window, click Test Connection:

 

32.

Wait for the text Success to appear in the Status field:

Click Finish.

 

33.

The new BPEL_conn is added under the BPEL Process Manager Server node in the Connections - Navigator pane:

Click the Application tab to switch to the Applications - Navigator to view the MyLoanProcess BPEL project files.

 

Back to Topic List

Creating the Partner Links

To create a partner link for each Web service that is invoked by the BPEL process, perform the following steps:

1.

With MyLoanProcess.bpel displayed in the Diagram View, select Process Activities from the Component Palette list:

Place the cursor over this icon to see the image

 

2.

To create a partner link for the CreditRatingService Web service, drag a PartnerLink object from the Component Palette to the Partner Links region on the right of the BPEL process activities:

Place the cursor over this icon to see the image

 

3.

In the Create Partner Link window, click the WSIL Browser icon to open the WSDL Chooser:

Place the cursor over this icon to see the image

 

4.

In the WSDL Chooser window under the WSIL Explorer node, expand the BPEL_conn, process, and default nodes. Select CreditRatingService:

Place the cursor over this icon to see the image

Click OK.

 

5.

In the Create Partner Link window, the WSDL File and Partner Link Type fields are populated by your selection in the WSDL Chooser. Enter or select the following field values:

Name: creditRatingService

My Role: ----- Not Specified -----

Partner Role: CreditRatingServiceProvider

The creditRatingService partner link box appears in the Partner Links region on the right of the BPEL process in the Diagram View:

 

6.

To create a partner link for the UnitedLoan Web service, drag a new PartnerLink object from the Component Palette to the Partner Links region on the right of the BPEL process activities:

 

7.

In the Create Partner Link window, click the WSIL Browser icon . In the WSDL Chooser, expand the BPEL_conn, process, and default nodes. Select UnitedLoan:

Click OK.

 

8.

In the Create Partner Link window for the UnitedLoan Web service, enter or select the following field values:

Name: unitedLoanService

My Role: LoanServiceRequester

Partner Role: LoanServiceProvider

Click OK.

The unitedLoanService partner link box is added to the Partner Links region on the right of the BPEL process in the Diagram View.

 

9.

To create a partner link for the StarLoan Web service, drag a PartnerLink object from the Component Palette to the Partner Links region on the right:

 

10.

In the Create Partner Link window, click the WSIL Browser icon . In the WSDL Chooser, expand the BPEL_conn, process, and default nodes. Select StarLoan:

Click OK.

 

11.

In the Create Partner Link window for the StarLoan Web service, enter or select the following field values:

Name: starLoanService

My Role: LoanServiceRequester

Partner Role: LoanServiceProvider

Click OK.

The starLoanService partner link box is added to the Partner Links region on the right of the BPEL process in the Diagram View.

Select File > Save All to save the changes to the project files.

 

Back to Topic

Adding New Process Variables

To create variables for activities in the MyLoanProcess BPEL process, perform the following steps:

1.

In the MyLoanProcess.bpel - Structure pane, expand the Variables node, the Process subnode, and its Variables child node to view two variables defined as inputVariable and outputVariable:

Place the cursor over this icon to see the image

 

2.

To create an input variable for the CreditRatingService, in the Structure pane select Variables under the Process subnode. Then click Create:

Place the cursor over this icon to see the image

 

3.

In the Create Variable window, enter crInput in the Name field, select Message Type, and click the Browse Message Types icon :

 

4.

In the Type Chooser window, expand Message Types, Partner Links, creditRatingService, CreditRatingService, and Message Types. Select CreditRatingServiceRequestMessage:

Click Ok.

 

5.

In the Create Variable window, click OK:

The crInput variable appears in the list of BPEL process variables in the Structure pane.

 

6.

Create an output variable for the CreditRatingService, and then select Variables under the Process subnode in the Structure pane. Click Create.

In the Create Variable window, enter crOutput in the Name field. Select Message Type with the value CreditRatingServiceResponseMessage selected from the CreditRatingService, Message Types node:

Click OK.

 

7.

Create an error variable for the CreditRatingService, select Variables, and then click Create.

In the Create Variable window, enter crError in the Name field. Select Message Type with the value CreditRatingServiceFaultMessage selected from the CreditRatingService, Message Types tree:

Click OK.

Select File > Save All to save the changes to the project files.

 

8.

Create the loan application input variable for the UnitedLoan and StarLoan Web Services, select Variables, and then click Create.

In the Create Variable window, enter loanApplication in the Name field. Select Message Type with the value LoanServiceRequestMessage selected from the UnitedLoanService, Message Types tree:

Click OK.

 

9.

Create the loan offer output variable for the UnitedLoan Web Service, select Variables, and then click Create.

In the Create Variable window, enter unitedOffer in the Name field. Select Message Type with the value LoanServiceResultMessage selected from the UnitedLoanService, Message Types tree:

Click OK.

 

10.

Create the loan offer output variable for the StarLoan Web Service, select Variables, and then click Create.

In the Create Variable window, enter starOffer in the Name field. Select Message Type with the value LoanServiceResultMessage selected from the StarLoanService, Message Types tree:

Click OK.

Select File > Save All to save the changes to the project files.

 

11.

In the Structure pane for MyLoanProcess.bpel, verify that the eight process variables (displayed in the accompanying screenshot) are defined under the BPEL Structure > Variables > Process > Variables node:

 

Back to Topic List

Designing the Loan Flow Process

During the creation of the BPEL process, you should regularly save the changes made to your MyLoanProcess.bpel file and project. After completing the steps for each new BPEL activity, select File > Save All to save the changes that you make.

This section covers the following subtopics:

Invoking the Synchronous CreditRatingService Web Service
Adding a Fault Handler for the CreditRatingService
Invoking the Asynchronous UnitedLoan and StarLoan Web Services in Parallel

Adding a Conditional Branch to Select a Loan Offer

Back to Topic List

Invoking the Synchronous CreditRatingService Web Service

To design the loan flow process activities that synchronously invoke the CreditRatingService Web service, perform the following steps:

1.

In the JDeveloper Diagram View, drag a Scope from the Component Palette to the region between the receiveInput and callbackClient activities:

Place the cursor over this icon to see the image

 

2.

To name the new Scope, double-click Scope_1 in the Diagram View. On the General page of the Scope dialog box, enter the value GetCreditRating in the Name field :

Place the cursor over this icon to see the image

Click OK.

 

3.

To expand, click for the GetCreditRating scope:

 

4.

In the Diagram View, drag an Assign activity from the Component Palette to the region labeled Drop Activity Here in the GetCreditRating scope:

 

5.

 

Next, create a copy rule to get the SSN value from the inputVariable into the crInput variable for passing to the CreditRatingService. To do this, double-click the Assign_1 activity to display the Assign properties:

Click Create on the Copy page.

 

6.

In the Create Copy Rule window, click the Browser Variables icon on the right of the Variable field in the From section:

 

7.

In the Variable Chooser window, select inputVariable:

Click OK.

 

8.

In the Create Copy Rule window, choose payload in the Part field:

 

9.

Click the XPath Query field in From section of the Create Copy Rule window. Use the XPath Building Assistant to enter the XML path /ns1:loanApplication/ns1:SSN.

Then press [Ctrl]+[Space] to invoke the XPath Building Assistant and show the root element of the inputVariable XML schema type:

Double-click the /ns1:loanApplication element.

 

10.

The XPath Building Assistant automatically displays the child elements in /ns1:loanApplication:

Double-click ns1:SSN to complete the XPath Query field.

The fields in the From section should contain the following values:

Variable: inputVariable

Part: payload

XPath Query: /ns1:loanApplication/ns1:SSN

 

11.

Using the same techniques from the preceding five steps, complete the To section in the Create Copy Rule to contain the following field values:

Variable: crInput

Part: payload

XPath Query: /ns2:ssn

Click OK to save the copy rule settings.

 

12.

Check the new copy rule details in the Assign properties section:

Note: The Invalid Settings error message is not meaningful until you click Apply or OK. The error message is cleared if the details entered are valid.

Click OK.

 

13.

Drag an Invoke activity from the Component Palette to the GetCreditRating Scope after the Assign_1 activity:

 

14.

To enable the Invoke activity to initiate the CreditRatingService, double-click the Invoke_1 activity to set the following property values on the General page:

Name: invokeCR

Partner Link: creditRatingService

Input Variable: crInput.
Output Variable: crOutput

The input and output variable fields can be set by selecting a value from the Variable Chooser window, which is displayed if you click the Browse Variables icon. In addition, when you choose the Partner Link value, the following field values are automatically filled:

Partner Role: CreditRatingServiceProvider
Port Type: CreditRatingService
Operation: process

Click OK.

 

15.

Drag another Assign activity from the Component Palette to the GetCreditRating Scope after the invokeCR activity:

 

16.

Double-click the Assign_2 activity. To add a copy rule, click Create on the Copy page.

in the From section of the Create Copy Rule window, enter the following field values:

Variable: crOutput

Part: payload

XPath Query: /ns2:rating

Press[Ctrl]+[Space] in the XPath Query field to use the XPath Building Assistant.

In the To section, enter the following field values:

Variable: inputVariable

Part: payload

XPath Query: /ns1:loanApplication/ns1:creditRating

Click OK to close the Create Copy Rule window. Make sure that the copy rule is added to the Assign properties. Click OK to close the Assign properties.

Select File > Save All to save the changes to the BPEL project.

 

Back to Topic

Adding a Fault Handler for the CreditRatingService

To add the process activities for handling faults that are returned by the CreditRatingService Web service and terminate the BPEL process, perform the following steps:

1.

You want to add a fault handler for the NegativeCredit fault that is generated when the CreditRatingService is invoked with an SSN value that starts with a leading zero. To do so, first click the Add Catch Branch icon