SquirrelSQL

Making JBoss Fuse, Data Virtualisation and BPMS Work Together – Part 2

Recap

In the previous installment, I outlined the use case or business scenario we are implementing using the 3 JBoss middleware products. In this installment, I am going to describe the Fuse to Business-as-a-service (Business rules application on the Realtime Decision Server) integration which validates the XML data and the Fuse to BPMS integration which kicks off a business process instance for a mortgage application as well as the Fuse to JBoss Data Virtualisation integration.

BRMS Realtime Decision Server Integration

For customer validation, a simple business rules application called MortgageAppValidation is used. It consists of only 1 DRL (Drools Rule Language file) and 1 Data Object. Both are created using Business Central.

Rules Project
Rules Project

And deployed in the Realtime Decision Server:

Rules Deployment
Rules Deployment

For those of you who want to migrate the application from the Realtime Decision Server to BPMS 6.3’s Intelligent Process Server, please refer to my other article (link provided below) to avoid frustration:

BPMS/BRMS 6.3: An Intelligent Process Server Odyssey

As mentioned earlier, the integration is done using a custom bean named RemoteBrmsValidation which uses Apache HTTP client to post the transformed (by the data mapper) XML to the Realtime Decision Server using HTTP Post.

To learn how to build a rules application and deploy in the Realtime Decision Server, please refer to my blog: http://mrdreambot.ddns.net/building-a-jboss-bpms-rules-application-without-writing-code/#more-91

BPMS Business Process Integration

The mortgage business process is the stock version that comes with the jboss-bpm-example-dist-${version}.zip. The business process diagram is shown below:

Mortgage Business Process
Mortgage Business Process

Fuse uses a custom bean named startProcessBean to kick off an instance of the mortgage application business process utilising the BPMS Java Remote API.

Start Process Bean
Start Process Bean

You can reference my blog on using the BPMS Java Remote API here. http://mrdreambot.ddns.net/building-a-bpms-web-application-part-2-remote-java-api/

JBoss Data Virtualisation Integration

As described earlier, the virtual database is created using 3 data sources. They are:

  1. Account Information including shares ownership (MySQL database)
  2. Market Data (stock price retrieved using a REST Web Service)
  3. Other Personal Holdings (a Holdings XML)

To grasp the concept on data virtualisation, please refer to my blog:

JBoss Data Virtualization Part 1 – Concept

The implementation is the same as that described in:

JBoss Data Virtualization Part 2 – An Example

The only difference is that the Holding XML file is now put in the designated directory by JBoss Fuse instead of manually.

Running the Example

At the moment, the example is set up on 2 virtual machines. One is used to run JBoss Developer Studio (JBDS), Fuse Camel routes and BPMS servers. The other is used to demonstrate JBDS together with JDV. There is no reason why they cannot be combined into one virtual machine. I just happened to develop the different components on different virtual machines at different times and did not have time to consolidate them yet.

First of all, review the business scenario the example is fulfilling. Make sure you know what to expect before starting the test.

VM1: JBDS, Fuse, BPMS

  • Start BPMS Server
  • Log in to Business Central. Build and deploy the Mortgage application. See screen shot.

    Build And Deploy
    Build And Deploy
  • Again from Business Central: start the Realtime Decision Server. See screen shot.
Rules Deployment
Rules Deployment
  • Start JBDS and choose the demo workspace. Instead of deploying the Fuse Camel routes to the OSGi Karaf container, I prefer to demonstrate its execution using JBoss Developer Studio. Run the camelContext.xml as Local Camel Context (with tests). See screen shot below.

    Run No Test
    Run No Test
  • Drag customerGood.xml from FileManager to JBDS’ src/data directory and you will see the validationOK message.
    Drag File
    Drag File

    Validation OK
    Validation OK
  • Drag customerBad.xml from FileManager to JBDS’ src/data directory and you will see the validationError message with the reason(s) why it failed validation.
Validation Error
Validation Error
  • Drag homeloancust.xml from FileManager to JBDS’ src/data directory and you will see Start process OK message. You will also see in Business Central that there is a new Mortgage business process instance.

    Start Process Succeeded
    Start Process Succeeded
  • Drag breakfastMenu.xml from FileManager to JBDS’ src/data directory and you will see an error message as it format is not recognised.

    Taking Error Route
    Taking Error Route

You will also receive an email for every mortgage application received. Here is a sample. Note that the example has been configured to send emails to me. You have to change it to send emails to you.

From: andyyuen105@gmail.com
 
Date: 16/07/2016 4:34 PM (GMT+10:00)
To: andyyuen105@gmail.com
Subject: RE: Mortgage Application Recevied
<Application infoType="homeLoan">
<name>Kate</name>
<socialSecurityNumber>123456789</socialSecurityNumber>
<annualIncome>150000</annualIncome>
<address>1 Miller Street</address>
<salesPrice>1000000</salesPrice>
<downPayment>400000</downPayment>
<amortization>15</amortization>
</Application>

VM2: JBDS, JDV

  • Start JBDS with the correct workspace
  • Start the server from JBDS
  • Start Squirrel SQL client to connect to JDV FederatedVDB-1
  • Use the Squirrel client to show the virtual tables and the column masking that was set up for the otherHoldingdView.Holdings.value table (see diagram below)

    SquirrelSQL
    SquirrelSQL

Conclusion

You don’t have to use the JBoss middleware products in isolation. They are designed to work together and complement each other.  This example shows how JBoss Fuse, Data Virtualisation and BPMS working together to satisfy a business requirement and, at the same time, showcases the capability of each. I hope you will enjoy this example and give you ideas as to how you can make use of JBoss middleware to achieve your business goals.