Loan Approval
Introduction
The loan approval process is the same as the one used in the BPEL specification Business Process Execution Language for Web Services Version 1.1. It consists of a BPEL process, two Web services upon which it depends, and a configuration file that tells the Web services what to do.
A diagram of the loan approval process appears below. The process receives a credit information message. Based on the loan amount, the process sends the message to an assessor and/or an approver whose jobs are to approve or reject the loan.
The fault handler for the process replies by sending back the fault received from the Web service.
Deploying the Process
See Deploying the Samples.
Additionally, you will have to deploy the two Web services and the
configuration file. To deploy the Web services, copy the file
loan_approval_services.wsr from the Resources/dist
directory to the place appropriate for your app server. For example, on
Tomcat
that would be the $CATALINA_HOME/bpr directory.
To deploy the configuration file, copy
loan_approval_config.xml from Resources/dist
to
java.io.tmpdir. Since the Web service is run within an app
server,
the server's value of java.io.tmpdir is used. For example,
under
Tomcat running on Windows the value of java.io.tmpdir is
%CATALINA_HOME%\temp.
Running the Process
See Running the Samples.
The
service name to use is ApproveLoan. The sample data file
loan_approval.xml can be used as input for this example.
The
contents of the reply will depend upon the values in
loan_approval_config.xml.
The loan_approval_config.xml File
This file contains values used by the two auxiliary Web services.
The
comments in loan_approval_config.xml
explain how it affects the the Web services' responses. Take a look at
the
BPEL process expected response
In order to properly set the value /rundata/bpel-expected-response located in the config file, you have to understand the example loan approval BPEL process. Here it is, in pseudo-code:
if (amount < 10000) {
if (assessor returns "low")
return "yes"
else
return approver response
}
else
return approver response
If either Web service encounters an error, it throws a loanProcessFault exception. If you tell the Web service (via the config file) to throw a fault, it will throw a loanProcessFault.
Config file changes
When you change the config file, the next time a Web service is called it will use the new values.
Copyright © 2004–2006 Active Endpoints, Inc. - All Rights Reserved
