Create a Custom Service

The following information describes the steps specific to creating a Custom Service 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 provide information that will assist in understanding what is happening in the steps below:

 

Determinations Server plugin folder - this is where the Determinations Server will pick up the plugins. The user needs to place the plugin packages (.jar for Java).

  1. Tomcat (Java) - default is in the WEB-INF\classes\plugins path in the Web Determinations web application in the Tomcat webapps folder,
  2. IIS (.Net) - default is in C:\inetpub\determinations-server\plugins

 

Determinations Server 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

Steps

To develop a plugin, do the following:

  1. Determine what the plugin is extending (the plugin type), and the Java interface the Java plugin needs to extend. See Plugins - General Technical Information
  2. If you are using a Java IDE - set it up with a Java project and load the Determinations Server library jars as Java libraries. The Determinations Server library jars have Javadoc, which will make it much easier when using Determinations Server Java Objects in the jars.
  3. Create a Java Class for the plugin in the new Java project, and implement the required interface and its methods in the new Class. 
    1. More information can be found on the specific pages of each plugin type
    2. Technical details about plugin authoring can be found in Plugins - General Technical Information

 

To install the plugin, do the following:

  1. Package the Plugin Class and any other Java Class developed with it in a .jar file
  2. Deploy the jar file into the Determinations Server plugin folder, together with any other libraries that were required (except the Determinations Server library jars - they are already in the 'lib' folder as mentioned previously)
  3. Restart the Tomcat server to enable the plugin

 

To test the plugin, do the following:

  1. The first step to check is if it was recognized and loaded by the Tomcat server. The Web Determinations web application prints out data about plugins that were loaded successfully. Any errors when loading a plugin are also printed out. Check the webserver's output file (for example: stdout.txt for Tomcat)
  2. The next step is to check if the plugin is registered. Depending on the plugin type - sometimes it might be loaded when the main web application root is accessed, or others when a Web Determinations Interview is started (that is, Rulebase and locale has been selected). If you encounter problems getting the plugin registered, ensure that your plugin "getInstance" method simply returns the plugin object, for example: "return new MyDataAdaptor()"
  3. Finally, if the plugin is loaded and registering correctly, test its functionality.