Implementation of the data loading

In this section we'll look closer at getting the data from the legacy system. If you're not interested in actually trying out this example, you can skip this section.

Database setup

The data can come from various sources – database, XML, CSV, and so on. Our application will pull data from a database; however, it shouldn't be a problem to work with any other data source. The table structure looks as follows:

CREATE TABLE  `droolsBook`.`customer` ( 
  `customer_id` bigint(20) NOT NULL, 
  `first_name` varchar(255) NOT NULL, 
  `last_name` varchar(255) NOT NULL, 
  `email` varchar(255) NOT NULL, 
  PRIMARY KEY  (`customer_id`) 

Code listing 24: Table structure for legacy customers in a MySQL Database

CREATE TABLE `droolsBook`.`address` ...

Get Drools JBoss Rules 5.X Developer's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.