Reader small image

You're reading from  Instant Oracle BPM for Financial Services How-to

Product typeBook
Published inApr 2013
PublisherPackt
ISBN-139781782170143
Edition1st Edition
Right arrow
Author (1)
B.M Madhusudhan Rao
B.M Madhusudhan Rao
author image
B.M Madhusudhan Rao

B. M. Madhusudhan Rao, alias name James Smith (Author of James Smith's Technology Blogs), has more than 15 years of experience in the enterprise software industry. He has been a TOGAF 9 Enterprise Architecture certified solution specialist at Oracle's North America Technology Organization for more than 5 years. He works primarily around Service Oriented Architecture, Business Process Management, Webcenter Portal, Webcenter Content, and Enterprise Architecture Practice. He is a part of the Tech-Sales team that showcases various customer proof of concepts and demonstrations to meet the customers' business challenges and requirements.Before joining Oracle, Madhu was a Technical Manager at HCL Technologies in India. He is known as James for his blog James Smith's Java and Oracle Blogs, which is very popular among techies. Last year, in 2012, his blog jamessmith73.wordpress.com had over 74,000, hits making it one of the top technology blogs.Madhu lives in Bangalore,India with his parents, wife, and little daughter Aishwarya Rao, and loves nature photography.
Read more about B.M Madhusudhan Rao

Right arrow

Implementing a home loan business process (Advanced)


A process analyst needs to have expertise on BPMN 2.0 models. They should also be able to understand the business process and business rules, collaborate with other business users, and simulate and document the process. It is also expected that a process analyst can model and edit the process on runtime using BPM Composer if there are changes in the business requirements. Oracle BPM allows process analysts to monitor the process, or even assign a given task to any user in the workflow system. BPM's out of the box integration capabilities allows analysts to view or check-in documents from or into the content repository related to his process.

A process developer needs to have expertise on BPMN 2.0 models from a technical point of view and the ability to write complex business logic in Java or PL/SQL. If required, he needs to have expertise in implementing the process model itself, by integrating with the necessary applicants or legacy systems by using BPM or SOA.

This recipe continues from the previous process model and implements the eligible customers business logic.

Getting ready

Before we begin, the following requirement needs to be fulfilled:

  • Download the source code from the previous recipe.

  • Use Oracle SQL Developer to develop and test a stored procedure to compute the EMI amount. We can use the SQL scripts provided in the code files of this recipe to create the database user and execute the procedure.

  • Ensure that SOA Suite is running.

Let us understand how a home loan EMI is calculated. Home loan EMI's are calculated based on the following formula:

EMI = (L*I)* {(1+I)^N / [(1+I)^N]-1}

Where:

L = Requested loan amount

I = Interest rate (rate per annum divided by 12)

^ = To the power of

N = Repayment duration in months

So, assuming a loan of 100,000 INR at 11 percent per annum that is repayable in 15 years, which is 180 months, the EMI using the formula will be:

EMI = (100000*0.00916)* {(1+0.00916)^180 / [(1+0.00916)^180]-1}

EMI ~ 916 * (5.161846 / 4.161846)

EMI ~ 1,136 INR

How to do it…

We need to create a PL/SQL procedure that can calculate fixed and variable EMIs, and also generate a unique request ID for every eligibility request. We will be passing the interest rate (I) to the PL/SQL procedure from the BPM business rules.

Writing a business logic in PL/SQL and integrating it with the process is done as follows:

  1. Log in to Oracle Database as the SYS user.

  2. Create the JAMESBANKDB user and grant all the required create table, create trigger, and create sequence privileges to this user.

  3. Log in as JAMESBANKDB.

  4. Create the procedure to calculate EMIs and write the data in the database table.

    Note

    The SQL scripts are available in the code files for this recipe.

  5. Compile and Run the Insert Eligibility procedure. This procedure will insert the eligibility data into a table, calculate the EMI amount for fixed and variable rate of interest, and also return a unique ID for the eligibility request.

  6. Launch JDeveloper and open the James Bank application developed in the previous recipe.

  7. Open composite.xml in the Design view.

  8. In the External References area on right side in the Design view, insert a Database Adapter service.

  9. Set up the necessary database connection parameters:

    • Connection Name: jamesbankdb

    • Username: jamesbankdb

    • Password: welcome1

    • JDBC Port: 1521

    • Service Name: orcl

  10. Test the connection and proceed if it is successful.

  11. In the Adapter Configuration Wizard, select the Call a Stored Procedure or Function operation type.

  12. From the configuration wizard, select the EMI Calculator stored procedure.

  13. Open the LoanEligibility process in the Design view, and change the EligibleCustomers activity into a service task, and make it active (earlier it was marked as draft).

  14. Select the Database Adapter service that we have created in the service list.

  15. Now click on Data Associations and ensure that the necessary input and output parameters are passed.

  16. Save the process and deploy on SOA Suite.

  17. Generate a web service-based Application Development Framework (ADF) data control by using the deployed WSDL URL, and drag-and-drop it on the JSPX page.

  18. Right-click and Run the JSPX page to test the web service from the browser by giving necessary input parameters, and then clicking on the Check Eligibility button, as shown in the next screenshot.

How it works…

We have build a PL/SQL procedure to calculate EMIs, store the necessary input data into the database table, and generate a request ID for every eligible application request. In the James Bank's loan application business rules, we are dynamically passing the fixed and variable interest rate (I). We have also built a business logic that defines Platinum, Gold, Silver, Bronze, and NE customers. We then deployed our BPM process. The process can be tested from Enterprise Manager or a simple ADF web service-based data control.

The role clarification process analyst was responsible for creating the dynamic business logic in the BPM process, including business rules, whereas the process developer was responsible for creating the PL/SQL stored procedure for the static business logic. The process developer was also responsible for creating and deploying the ADF application, and implementing some of the process logic as planned by the process analyst.

The output of this recipe is ready to run the home loan EMI calculator application that works on a particular business logic. We also learnt how the business logic in the BPM rules engine communicates through a service invocation with the business logic stored in stored procedures or any other legacy systems.

In the browser UI, enter input values and check for the web service return values, as shown in the following screenshot:

Log in to Enterprise Manager and view the process flow. The major change that we see in the process flow is the business service invocation at the PL/SQL database layer by the BPM process.

Our business logic is now ready to be used in the main Home Loan Process.

There's more…

It would also be interesting to know that BPM supports integration with EJB-written business logic. So if we are not planning to implement PL/SQL-based business logic, we can write the same logic by using EJBs, and invoke it as a BPM service activity. Alternatively, we can also use a combination of BPMN expression language to compute the EMI, and use a simple Database Adapter to write the data into a database table and generate the request ID.

Previous PageNext Page
You have been reading a chapter from
Instant Oracle BPM for Financial Services How-to
Published in: Apr 2013Publisher: PacktISBN-13: 9781782170143
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
B.M Madhusudhan Rao

B. M. Madhusudhan Rao, alias name James Smith (Author of James Smith's Technology Blogs), has more than 15 years of experience in the enterprise software industry. He has been a TOGAF 9 Enterprise Architecture certified solution specialist at Oracle's North America Technology Organization for more than 5 years. He works primarily around Service Oriented Architecture, Business Process Management, Webcenter Portal, Webcenter Content, and Enterprise Architecture Practice. He is a part of the Tech-Sales team that showcases various customer proof of concepts and demonstrations to meet the customers' business challenges and requirements.Before joining Oracle, Madhu was a Technical Manager at HCL Technologies in India. He is known as James for his blog James Smith's Java and Oracle Blogs, which is very popular among techies. Last year, in 2012, his blog jamessmith73.wordpress.com had over 74,000, hits making it one of the top technology blogs.Madhu lives in Bangalore,India with his parents, wife, and little daughter Aishwarya Rao, and loves nature photography.
Read more about B.M Madhusudhan Rao