Create a Custom Screen

Create a Custom Screen

The following information describes the steps on how to create a custom screen, installing it onto a Java webserver, and running the custom screen. While this covers Java, similar steps can be followed for .Net.

For generic background on how to construct a plugin, see Create a plugin.

For a description of custom screens and their purpose, see Custom Screen and Custom Control Provider plugins.

For how to implement a custom screen plugin for Web Determinations, see Create a Custom Screen example.

Assets and information needed

The following are information that will be referred to 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).

 

Web Determinations library jars

Steps

To develop a custom screen:

  1. Planning -- which default screen will your custom screen be replacing?  How will it know?  What data will your screen be handling?  The custom screen provider can use any available information for each screen, to determine whether it will insert a custom screen.  A common technique is to key on the screen name set by the screen author in Oracle Policy Modeling.
  2. Start with a standard screen with standard controls allowing you to manually enter the data that your custom screen will eventually provide.  You will need to verify that there is an attribute, entity, or relationship in the rulebase for each piece of data that your screen is meant to collect.
  3. 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.
  4. Create a java class for the custom screen provider in the new Java project, and implement the CustomScreenProvider interface and its methods in the new Class.  Each time a new user begins a session, the CustomScreenProvider will be examining an InterviewSession to determine whether its custom controls are relevant to this session.  More information about using rulebase model and instance data in the InterviewSession object can be found in Understanding the InterviewSession.
  5. Create a java class for the custom screen itself, and implement the CustomScreen interface and methods.

To install the Custom Screen:

  1. Package the custom screen, custom screen provider, and any other required classes 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 Determination library jars - they are already in the 'lib' folder).
  3. Restart the J2SE server to enable the new plugin.

Testing the plugin:

  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. The getInstance method will be called each time a Web Determinations interview is started (that is, rulebase and locale have been selected). If you are having trouble getting the plugin registered, ensure that your plugin getInstance method simply returns a new CustomScreenProvider object.
  3. Finally, if the plugin is loaded and registering correctly, test its functionality.