List Provider plugin overview

List Provider plugin overview

Rule authors can control the values that a user can provide for a variable attribute by using a List control instead of text field input. List controls are drop-down lists, list-boxes, and radio button lists. The simplest way to define the values of a list is via Screen Authoring in Oracle Policy Modeling, where the rule author inputs each selectable option for the list control. While simple, it is not reusable, flexible, or dynamic.

The List Provider plugin is an Engine Session plugin to the Web Determinations Engine which provides an alternate way of populating List controls via Screen Authoring.

A List Provider plugin allows a list to be loaded with values from any datasource. The default List Provider plugin in Web Determinations web application uses xml files to drive lists.

More information on using the default List Provider can be found in Use the default List Provider

Go to:

List Provider and the Web Determination architecture

Developing a List Provider plugin for your specific project/datasource

See also:

Create a List Provider

Use the default List Provider

List Provider - pseudo code

List Provider -sample code

List Provider and the Web Determination architecture

The following information details how the List Provider plugin fits into the Web Determinations architecture, and how to use it in the Web Determinations environment.

How Web Determinations use the List Provider plugin

Web Determinations uses the List Provider plugin every time a List InterviewInputControl object is instantiated in Web Determinations.

List Provider class methods

A List Provider plugin implements the ListProviderPlugin interface. The ListProviderPlugin interface requires the following when implemented:

 

Method signature

Description

List getListOptions(

InputInterviewControl controlInstance,

InterviewSession session)

  • The InputInterviewControl contains information about the List control.
  • From the InputInterviewControl the Attribute object can be retrieved (which contains information about the variable attribute linked to the List).
  • The InterviewSession contains information about the current Web Determinations interview, such as the current rulebase, instance data known so far, and so on.
  • The List object returned contains ListOptions, and each ListOptions contains the information for each option item in the List control.
  • If the returned List object is null - Web Determinations uses the list of values defined by the rule author for the List control in Oracle Policy Modeling Screen Authoring.

 

Developing a List Provider plugin for your specific project/datasource

This following information explains the various approaches to designing and developing a List Provider plugin for a specific project, rulebase, or datasource.

Factors to consider when designing a List Provider plugin

When designing a List Provider plugin, keep the following in mind:

 

Essentially, the List Provider plugin needs to have the following functionality:

 

The List Provider plugin can also use multiple datasources to populate various List controls.

Simple implementations of the List Provider plugin may use simple logic to retrieve and map datasets for each List control it needs to populate. As the complexity increases (multiple datasources, multiple List controls, supporting several rulebases), providing configuration files becomes a necessity to be able to handle changes from the datasource, rulebase, or the List controls.

About the data passed into the LP method 'getListOptions'

It is important to understand the two input arguments for the ListProvider method getListOptions.

InputInterviewControl

The InputInterviewControl object is useful for determining what attribute the List control is attached to, which can be used in the Plugin logic to retrieve and setup the dataset for the List control.

The InputInterviewControl object passed in is the object representation of the List control. It contains valuable data about the List control, such as:

InterviewSession

The InterviewSession object is useful for determining the current state of the Web Determinations interview such as what instance data has been provided by the user, as well as Web Determinations interview metadata such as the locale and rulebase.

How to build the List object to be returned in getListOptions()

Building the List object is very simple. Here are the general steps to build the List object:

  1. Inspect the List control to determine what data to retrieve.
  2. Retrieve the data for the current List control.
  3. For each option item in the retrieved data,
    1. Create a ListOption object and populate its displayText and value members.
    2. Add the ListOption to the List object.
ListOption object

The ListOption object has the following key members: