Create a Data Adaptor

Create a Data Adaptor

The following information describes the steps specific to creating a Data Adaptor plugin. For steps on creating and installing a Plugin, see Create a plugin. Although it focuses on Java development, the same steps can be followed for .Net (with slight implementation differences).

Assets and information needed

The following assets are required to develop the Data Adaptor Plugin, or information that will be referred to in the Steps section.

 

Web Determinations library jars

 

Java IDE -  this is the Java development application you are using. While this is optional, it will make it much easier when referring to objects in the web-determinations.jar and determinations-interview-engine.jar files.

 

Data Adaptor business case - the reason why the Data Adaptor needs to be implemented for this specific project. There are many reasons, mostly related to integrating data. For more information, see Data Adaptor - common scenarios.

 

Datasource - this is the datasource (or datasources) that this Data Adaptor plugin will connect to, to load data, save data, or both. It can be an SQL database, or an API that connects to a datasource; for example, Siebel.

 

Datasource library jars - the Datasource may have Java jar library files that is required for the Data Adaptor.

 

Datasource connection details - the Data Adaptor plugin will need to be able to connect to the datasource, so connection details must be known. This might be a specific server port; for example: //server:portnumber/databasename.

Steps

Analysis and design:

Before starting on the development of the plugin, refer to the Data Adaptor overview topic for an understanding of how the Data Adaptor is used by Web Determinations, and the various ways in which load() and save() are called.

Once you have familiarized yourself with the Data Adaptor plugin:

  1. Determine what rulebase (or rulebases) the Data Adaptor will work for; you can make a Data Adaptor that services all the rulebases and its locales in the Web Determinations server, or you can create the Data Adaptor to only work for a specific Rulebase, or even only for one of its locales.
  2. From the Data Adaptor business case, establish:
    1. What data in the rulebase can or needs to be loaded from the datasource.
    2. What data in the rulebase needs to be saved into the datasource.
    3. The datasource and location of the data to be loaded - or where the data is to be saved.
    4. How the save action is to be done during the Web Determinations interview; saved manually saved by the user, or saved automatically? Is the user allowed to specify the Case ID to use for saving, or is it automatically generated?
    5. How the load action is to be done; will the user be directed to the Web Determinations interview with data pre-loaded, or is the user allowed to specify which data to load?

  3. Determine how the Data Adaptor will connect and interact with the datasource, including transaction integrity processes, fallback on error, and so on.
  4. Design the authentication to Data Adaptor methods (load(), save(), listCases()) if needed.
  5. Design how the Data Adaptor will access the data and map it to rulebase attributes for load(), and vice versa for save().

Development

  1. Set up the Java IDE so that it has the Web Determinations library jars and Datasource library jars. This makes it easier to refer to objects for Web Determinations or for the datasource.
  2. Start the Data Adaptor plugin class from the following pseudo code - Data Adaptor - pseudo code.
  3. Develop the Data Adaptor plugin based on the Analysis and design section.

Install and test

For steps on installing and testing the Data Adaptor, see  Create a plugin.