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
This tutorial covers the following topics:
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.
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
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:
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.

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

|
| 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.

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

|
| 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.

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

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

Click OK.

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

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.

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

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

|
| 4. |
Enter FileRead in the Service Name field
and click Next.

|
| 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.

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

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.

|
| 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.

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

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

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

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

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

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.

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

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

|
| 4. |
Set the following and click OK:
Partner Link Type: MyLoanProcess
My Role: MyLoanProcessRequester
Partner Role: MyLoanProcessProvider

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.

|
| 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.

|
| 3. |
Click the Auto-create Variable icon .

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.

Click OK to close the Receive properties window.

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

|
| 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 .

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.

Click OK to close the Invoke properties window.

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

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

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

|
| 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.

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

|
| 10. |
Click OK to close the Assign properties window.

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.

|
| 2. |
Click Next in the Welcome screen of the Workflow Wizard.

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

Click the XPath Expression Builder icon.

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

|
| 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.

|
| 6. |
Click OK to close the XPath Expression Builder.

|
| 7. |
Click the Create Expression icon for Payload.

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

|
| 9. |
Click Next.

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

Click Next.

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

|
| 11. |
Select the BPEL Server connection that you are using. Click Lookup.
|
| 12. |
Select jcooper from the list and click Select.

Click OK.

|
| 13. |
Click Next and click Finish.

|
| 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.

Select File > Save All to save the changes to the
project and workspace.
|
Back to Topic
Back to Topic List
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.

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.

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
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

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.

|
| 4. |
Click on the instance of BatchLoanProcessing.


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

|
| 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.

|
| 7. |
You will see the pending tasks.

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


|
| 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.

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


|
| 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.

|
| 11. |
Click Dashboard link.


|
| 12. |
Click on the instance of MyLoanProcess.

Observe that the process is waiting for StarLoan approval.

|
| 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.

|
| 14. |
Click Approve.

You will see the confirmation.

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


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


|
Back to Topic List
In this tutorial, you've learned how
to:
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.
|