Create a plugin

Create a plugin

The following information describes the steps required to create a plugin, install it onto a Java webserver, run the plugin, and debugging tips. While this specifically describes a Java implementation, similar steps apply for .Net

Assets and information needed

The following provide information that will assist in understanding what is happening in the steps below:

 

Web Determinations plugin folder - this is where the Web Determinations webserver 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\web-determinations\plugins

 

Web Determinations library jars - these can be found in the Web Determinations 'lib' folder; for example: C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\web-determinations\WEB-INF\lib

 

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 Web Determinations library jars as Java libraries. The Web Determinations library jars have Javadoc, which will make it much easier when using Web Determinations 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 Web Determinations plugin folder, together with any other libraries that were required (except the Web Determinations 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 into the runtime successfully. Any errors when loading a plugin is 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.