Legal | Privacy
Leveraging Integration Services of Oracle BPEL Process Manager

Leveraging Integration Services of Oracle BPEL Process Manager

This tutorial demonstrates how to incorporate human workflow aspects into process flows and how to integrate with file systems using JCA based adapters.

Approximately 20 minutes

Topics

This tutorial covers the following topics:

Using File Adapter Services for Integration

Deploying the Batch Loan BPEL Process
Testing the Batch Loan BPEL 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 and deploy the BatchLoanFlow BPEL process. BatchLoanFlow process uses FileAdapter services to read loanApplications from a pre-defined directories and invokes MyLoanProcess with the loanApplication read from the file system.

Back to Topic List

Prerequisites

Before starting this tutorial, you should:

1.

Have successfully completed the BPEL tutorial: Orchestrating a Simple Process Using Oracle BPEL Process Manager.

 

2.

If you have not completed the introduction tutorial then, perform the following steps to create and deploy the MyLoanProcess BPEL process:

a) Select the lab1solution.zip file in the labs\bpel\bpelintroduction\solution directory of the CD-ROM given by the instructor. Unzip into <BPEL_HOME>\integration\jdev\jdev\mywork\
b) In the JDeveloper menu, select File > Open. Navigate to the directory <BPEL_HOME>\integration\jdev\jdev\mywork\bpelintroductionsolution\MyLoanProcessWS\ and select MyLoanProcessWS.jws. Click Open.
c) Select MyLoanProcess and from the menu choose Run > Rebuild
d) In the JDeveloper Applications - Navigator, right-click the MyLoanProcess project node
e) Select Deploy > LocalBPELServer > Deploy to default domain.

Back to Topic List

This section covers the following subtopics:

Creating a Batch Order Booking Process
Creating a Partner Link that Uses the File Read Functionality
Creating a MyLoanProcess Partner Link
Adding Receive, Invoke, and Assign Activities
Adding a Workflow to Accept or Reject the Loan Application

Back to Topic List

 

Creating a Batch Order Booking Process

Follow these instructions to create a new BatchLoanProcessing project. Note that you create an empty BPEL process, and not an asynchronous process.

1.

Right-click MyLoanProcessWS in the Applications Navigator section of the designer window and select New Project.

Place the cursor over this icon to see the image

 

2.

Select BPEL Process Project in the Items window and click OK.

Place the cursor over this icon to see the image

 

3.

In the BPEL Process Project window, enter BatchLoanProcessing in the BPEL Process Name field. Select Empty BPEL Process from the Template list. Make sure that the Use Default check box is selected. Click OK.

Place the cursor over this icon to see the image

This creates the bpel.xml, BatchLoanProcessing.bpel, and BatchLoanProcessing.wsdl files in the Applications Navigator section of the designer window.

Place the cursor over this icon to see the image

 

4.

Copy LoanFlow.xsd and LoanFlow.xml from the labs\bpel\practicefiles directory in the CD-ROM to the <BPEL_HOME>\integration\jdev\jdev\mywork\MyLoanProcessWS\BatchLoanProcessing directory.

 

5.

Select BatchLoanProcessing.bpel in the Applications - Navigator section. Click Project Schemas in the Structure pane and click Import.

Place the cursor over this icon to see the image

 

6.

The Import Schema dialog box appears. Click the Browse File System icon.

Place the cursor over this icon to see the image

 

7.

In the Open dialog navigate to the <BPEL_HOME>\integration\jdev\jdev\mywork\MyLoanProcessWS\BatchLoanProcessing directory, select LoanFlow.xsd and click Open.

Place the cursor over this icon to see the image

Click OK.

Place the cursor over this icon to see the image

 

8.

In the Structure pane observe that the LoanFlow.xsd file appears under Project Schemas. You can also check this in the Applications - Navigator.

Place the cursor over this icon to see the image

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

 

 

Back to Topic

Creating a Partner Link that uses the File Read Functionality

Follow these instructions to create a Partner Link.

1.

If not in the Diagram View, double-click BatchLoanProcessing.bpel to switch to the diagram view. Ensure that Process Activities is selected in the drop-down list of the Component Palette. Drag and drop a PartnerLink activity onto the right side of the designer window under Partner Links.

Place the cursor over this icon to see the image

 

2.

In the Create Partner Link window enter FileReadAdapter in the Name field. Click the Define Adapter Service icon .

Place the cursor over this icon to see the image

 

3.

You will see the Adapter Configuration Wizard - Welcome screen. Click Next. Select File Adapter and click Next.

Place the cursor over this icon to see the image

 

4.

Enter FileRead in the Service Name field and click Next.

Place the cursor over this icon to see the image

 

5.

Select Read File as the Operation Type on the Operation window and click Next.
Note that the Operation Name field is automatically filled in with Read.

Place the cursor over this icon to see the image

 

6.

Click Browse next to the Directory for Incoming Files (physical path) field.

Place the cursor over this icon to see the image

Select the folder from which the files should be read. Ensure that the Archive processed files check box is not selected and click Next. You must create the folder if it does not exist. In this lab, we will use c:\temp folder.

Place the cursor over this icon to see the image

 

7.

Enter LoanFlow*.xml in the Include Files with Name Pattern field. This specifies that any input file with this pattern is selected for processing. Click Next.

Place the cursor over this icon to see the image

 

8.

Set 15 seconds in the Polling Frequency field. Ensure that the Delete files after successful retrieval check box is selected. Click Next.

Place the cursor over this icon to see the image

 

9.

Click Browse next to the Schema File URL field on the Messages window to display the Type Chooser window.

Place the cursor over this icon to see the image

 

10.

Select Project Schema Files > LoanFlow.xsd > loanApplication. Click OK.

Place the cursor over this icon to see the image

The Schema File URL field (LoanFlow.xsd) and the Schema Element field (loanApplication) are populated. Click Next.

Place the cursor over this icon to see the image

 

11.

Click Finish and then click OK to close the Create Patner Link window.

Place the cursor over this icon to see the image

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

 

 

Back to Topic

Creating a MyLoanProcess Partner Link

Follow these instructions to create a Partner Link.

1.

Drag and drop a PartnerLink activity from the component palette section onto the right side of the designer window below FileReadAdapter.

Place the cursor over this icon to see the image

 

2.

Enter MyLoanFlowProcess in the Name field. Click the WSIL Browser icon .

Place the cursor over this icon to see the image

 

3.

In the WSDL Chooser expand LocalBPELServer > processes > default. Select MyLoanProcess and click OK.

Place the cursor over this icon to see the image

 

4.

Set the following and click OK:

Partner Link Type: MyLoanProcess
My Role: MyLoanProcessRequester
Partner Role: MyLoanProcessProvider

Place the cursor over this icon to see the image

MyLoanFlowProcess partner link is created. Select File > Save All to save the changes to the project and workspace.

 

Back to Topic

Adding Receive, Invoke, and Assign Activities

1.

Drag and drop a Receive activity from the component palette section onto the designer window. Because you created an empty BPEL process, the designer window does not include the receiveInput (Receive) and callbackClient (Invoke) activities that are automatically created with an asynchronous BPEL process.

Place the cursor over this icon to see the image

 

2.

Double click the Receive_1 activity to display the Receive properties. Enter receive_FileInPartner in the Name field, select FileReadAdapter from the Partner Link drop-down list. Check the Create Instance check box.

Place the cursor over this icon to see the image

 

3.

Click the Auto-create Variable icon .

Place the cursor over this icon to see the image

A variable named receive_FileIn_Read_InputVariable is automatically created in the Name field. This variable is assigned a message type of loanApplication. Click OK.

Place the cursor over this icon to see the image

Click OK to close the Receive properties window.

Place the cursor over this icon to see the image

 

 

4.

Drag and drop an Invoke activity from the Component Palette section to below the receive_FileInPartner Receive activity.

Place the cursor over this icon to see the image

 

5.

Double-click the Invoke_1 activity to display the Invoke properties. Enter invoke_MyLoanProcess in the Name field, select MyLoanFlowProcess from the Partner Link drop-down list. Click the Auto-create Variable icon .

Place the cursor over this icon to see the image

A variable named invoke_MyLoanProcess_initiate_InputVariable is automatically created in the Name field. This variable is assigned a message type of MyLoanProcessRequestMessage. Click OK.

Place the cursor over this icon to see the image

Click OK to close the Invoke properties window.

Place the cursor over this icon to see the image

 

 

6.

Drag and drop an Assign activity from the Component Palette section to below the receive_FileInPartner Receive activity.

Place the cursor over this icon to see the image

 

7.

Double-click the Assign_1 icon to display the Assign properties. Click the General tab.

Place the cursor over this icon to see the image

 

8.

Enter assignLoan in the Name field and click Copy Rules tab.

Place the cursor over this icon to see the image

 

9.

Click Create to display the Create Copy Rule window. Select Variable as Type for both From and To sections.

In the From section expand Process, Variables, receive_FileInPartner_Read_InputVariable, loanApplication and select ns3:loanApplication.

Place the cursor over this icon to see the image

In the To section expand Process, Variables, invoke_MyLoanProcess_initiate_InputVariable, payload, and select ns3:loanApplication. Click OK.

Place the cursor over this icon to see the image

 

10.

Click OK to close the Assign properties window.

Place the cursor over this icon to see the image

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

 

Back to Topic

 

Adding a Workflow to Accept or Reject the Loan Application

JDeveloper BPEL Designer provides workflow to add human interactions and connectivity to processes in a single end to end process flow. Follow these instructions to add a simple workflow to accept or reject the loan application.

1.

Drag and drop a User Task activity from the Component Palette section to below the assignLoan Assign activity.

Place the cursor over this icon to see the image

 

2.

Click Next in the Welcome screen of the Workflow Wizard.

Place the cursor over this icon to see the image

 

3.

Select Simple Workflow from the Workflow Patterns drop-down list. Enter LoanApplicationApproval for Workflow Name and LoanApp for Variable Name. Click Next.

Place the cursor over this icon to see the image

Click the XPath Expression Builder icon.

Place the cursor over this icon to see the image

 

4.

Expand Process, Variables, receive_FileInPartner_Read_InputVariable, loanApplication, ns3:loanApplication, and select ns3:customerName. Double-click concat from the String Functions.

Place the cursor over this icon to see the image

 

5.

The concat function appears in the Expression Body. Enter 'Loan Application For ', as the first parameter for the concat method. Select the variable ns3:customerName and move it to Expression Body as the second parameter.

Place the cursor over this icon to see the image

 

6.

Click OK to close the XPath Expression Builder.

Place the cursor over this icon to see the image

 

7.

Click the Create Expression icon for Payload.

Place the cursor over this icon to see the image

 

8.

Expand Process, Variables, receive_FileInPartner_Read_InputVariable and select loanApplication. Click OK.

Place the cursor over this icon to see the image

 

9.

Click Next.

Place the cursor over this icon to see the image

The two tasks that we require for this workflow is Accept or Reject. So, click Next.

Place the cursor over this icon to see the image

Click Next.

Place the cursor over this icon to see the image

 

10.

Click Browse OID Users icon to select the User who can approve or reject the loan application.

Place the cursor over this icon to see the image

 

11.

Select the BPEL Server connection that you are using. Click Lookup.

Place the cursor over this icon to see the image

 

12.

Select jcooper from the list and click Select.

Place the cursor over this icon to see the image

Click OK.

Place the cursor over this icon to see the image

 

13.

Click Next and click Finish.

Place the cursor over this icon to see the image

 

14.

Observe that there are 3 outcomes of the LoanApplicationApproval task: Accept, Reject, and Otherwise. Accept and Reject are the outcomes that you chose and Otherwise is automatically added to handle any exceptions.

Place the cursor over this icon to see the image

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

 

Back to Topic

Back to Topic List

Deploying the Batch Loan BPEL process

To deploy the Batch Loan BPEL process to the BPEL Process Manager Server, perform the following steps:

1.

In the JDeveloper Applications - Navigator, right-click the BatchLoanProcessing project node. Select Deploy > LocalBPELServer> Deploy to default domain. Enter the default domain password, bpel, when you are prompted to enter the password.

Place the cursor over this icon to see the image

Note: JDeveloper automatically compiles the BPEL process. During compilation, JDeveloper creates a BPEL suitcase in the form of a Java Archive (JAR file), which is deployed to the BPEL Process Manager Server.

 

2.

Track the progress of compiling and deploying the BPEL process in the Messages page of the Messages - Log window.

Place the cursor over this icon to see the image

Note: Make sure that compilation and deployment are successful, before testing the deployed BPEL process. To wrap the message lines in the Messages page, right-click anywhere in the Messages page area and select Wrap from the context menu.

 

Back to Topic List

 

Testing the Batch Loan BPEL process

To test the success of the BatchLoanProcess BPEL process, perform the following steps:

1.

To view the deployed BPEL process, open a browser window and enter the following URL to display the BPEL Console page. The BPEL Console can also be started by selecting Start > Programs > Oracle - OracleBPM > Oracle BPEL Process Manager 10.1.2 > BPEL Console.

http://localhost:9700/BPELConsole

Place the cursor over this icon to see the image

A BatchLoanProcessing link appears under the Deployed BPEL Processes column on the Dashboard page.

 

2.

Copy the LoanFlow.xml file from the CD-ROM (Products\Labs\Integration\Lab2-BPELAdvanced) to C:\temp directory. Allow the polling frequency of 15 seconds that you set up earlier. After the process starts, the file is read, deleted (if reading was successful), and sent to the MyLoanFlow process.

 

3.

Refresh the Oracle BPEL Console. You will see that instances are created.
Note: You may see many old instances if you have not purged the instances earlier.

Place the cursor over this icon to see the image

 

4.

Click on the instance of BatchLoanProcessing.

Place the cursor over this icon to see the image

Place the cursor over this icon to see the image

 

5.

Since we have included the workflow at this point, the process has to wait for the approval.

Place the cursor over this icon to see the image

 

6.

Open another browser window and enter the following URL:

http://localhost:9700/integration/worklistapp/Login

Login as jcooper. Recollect that you had chosen jcooper as the approver from the user(s) list. The default password is welcome.

Place the cursor over this icon to see the image

 

7.

You will see the pending tasks.

Place the cursor over this icon to see the image

Click the link for the task to see the details of the loan application.

Place the cursor over this icon to see the image

Place the cursor over this icon to see the image

 

8.

The approval can be done from this page or from the previous page. Click the Back button of the browser window to return to the previous page.

Place the cursor over this icon to see the image

 

9.

Select Accept from the Actions drop-down list and click Go.

Place the cursor over this icon to see the image

Place the cursor over this icon to see the image

 

10.

Switch back to the BPEL Console window and refresh the screen. Observe that the Audit Trial has changed. It is now trying to invoke MyLoanProcess.

Place the cursor over this icon to see the image

 

11.

Click Dashboard link.

Place the cursor over this icon to see the image

Place the cursor over this icon to see the image

 

12.

Click on the instance of MyLoanProcess.

Place the cursor over this icon to see the image

Observe that the process is waiting for StarLoan approval.

Place the cursor over this icon to see the image

 

13.

Complete the manual StarLoan approval task. Switch to the other browser window and change the URL to

http://localhost:9700/StarLoanUI

Click the Assign APR Task link.

Place the cursor over this icon to see the image

 

14.

Click Approve.

Place the cursor over this icon to see the image

You will see the confirmation.

Place the cursor over this icon to see the image

 

15.

Return to the Oracle BPEL Console. Refresh the Oracle BPEL Console and observe process instance creation and completion.

Place the cursor over this icon to see the image

Place the cursor over this icon to see the image

 

16.

Click callbackClient link or icon to view the loan offer document that is returned to the client.

Place the cursor over this icon to see the image

Place the cursor over this icon to see the image

 

Back to Topic List

 

In this tutorial, you've learned how to:

Use File Adapter services for integration

Include workflow in the process
Compile and deploy the BPEL process
Test the BPEL process in the BPEL Console

Back to Topic List

To learn more about Oracle BPEL products, refer to additional OBEs on the OTN Web site.

Back to Topic List

Place the cursor over this icon to hide all screenshots.

 

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy