Read the original article at The Crooked Stick


This is the Second entry in this trail that is GlassFish ESB (Open ESB) and will look at the Search For Customer functionality. We assume that the Cars Online application is used as a car sales application is part of a larger corporate implementation. The assumed company also has dealings with finance and insurance which has been built up by acquisition. Hence they will be using a MDM Solution to manage their disparate system.


Therefore we have implemented a simple Customer MDM solution using the OpenESB MDM implementation building a Customer orientated solution which we will integrate with using a BPEL Process.



Overview

The Business Process bsCustomerSearch.bpel receives the Customer Search Information, entered on the "Customer Details" Screen, and then accesses the MDM implementation using the generated API. First the process attempts to find an exact match and if this failed will use the Block search to find a number possible matches. Once the search has completed all possible matches and their associated score are returned to the Search screen and the user can cycle through them.


MDM was installed following instruction that can be found on the Mural Web Site and then a simple Customer Application was built as described in the Tutorial.


I used the GlassFish ESB Healthcare Pack to build the MDM rather than the Mural Download because I needed to run the NetBeans Applications under 6.7.1.


Search Screen


The screen you see below was briefly described in the first entry of this trail. Within this entry we will look at the functionality behind the "Search" Button. The data entry fields on the Customer details screen also double as the search entry screens and when the user selects the search button. On selecting the Search button the backing JavaScript function will use JQuery to retrieve the contents and then write them to the Java Session before calling the AjaxCustomerSearchServlet which will retrieve all the search information and build the Web Service call associated with the Search Business Process which will be described later.





Once the data has been retrieved by the Business Process and returned to the Servlet and then, via a JSON Array, to the JavaScript the user is able to scroll through the retrieved records using the next and previous buttons (only displayed when multiple records have been returned). The current record number and its MDM Matching score are displayed. As the user moves through the record all the fields and the Google map will be updated and once the user has the correct record they can move onto the next screen by selecting the "Payment Terms" button thus saving the Customers data.







Returning to the Search screen will re-initialise the result data and display all the information associated with the previously accepted Search results. If the user need to perform a new Search then the data can be simply cleared using the "Clear" button.


Search Business Process


The search Business Process attempts to identify the Customer in a number of ways based on the Search Criteria passed in. At first the process will try to do an Exact Match on the customer and if this work the single record data will be returned tot he user. As can be seen from the image below if the Exact Search does not return a single records we will proceed to do a Block Search based on the MDM configuration. Given the data entered into the MDM this will the three rows shown in the next section.





You can see that I have also added the option to execute a phonetic search if the Block Search does not return any results but this is essentially a place holder at present until I extend the search so that the user can specify the type to execute.


Customer MDM


As mentioned the MDM implementation is based on that contained within the GlassFish ESB Healthcare Pack, because I am using GlassFish 2.2 and NetBeans 6.7, but you can achieve the same functionality by downloading the Open ESB implementation. I installed the Mural Product, as described on the Mural Site, and then implemented a Customer MDM solution, as described in the Tutorial, and created an number of external systems.


These external systems we then populated, manually, with a number of customer records and validated using the generated MDM application. The image below shows the expected data when searching for Melanie Wilson and it can be seen from the images in the first section that the data returned and displayed on the screen matches the expected contents of the MDM search.





.




More...