Integrate Web Determinations with another application

What do you want to do?

Integrate an interview experience within an existing application or process

Initialize an interview with data from an outside source

Pass interview data, conclusions and decision reports to an external application

Use an external data store for Web Determinations resources

 

Integration with another application will most likely involve use of the Web Determinations' Data Adaptor plugin which allows the current interactive session to use an arbitrary data source for loading and saving session data.

Integrate an interview experience within an existing application or process

Go to:

Embed Oracle Web Determinations inside a frame

Configure Oracle Web Determinations' look and feel to appear embedded

Integrate Oracle Web Determinations into a parent application's workflow

Embed Oracle Web Determinations inside a frame

To get Oracle Web Determinations to embed inside a frame, you need to turn off the commentary frameset and tell Web Determinations to target the current frame rather than the top frame. This can be done by going to appearance.properties and making the following settings:

use-session-frameset=false frameset-top-target=_self commentary-target=commentary_frame

 

The application can then be started by either going to the main page using:

Java:

http://<server>:<port>/<webapp>

.NET:

http://<server>:<port>/<webapp>.aspx

 

Or you can start a session for a rulebase directly by going to:

Java:

http://<server>:<port>/<webapp>/startsession/<rulebase>/<locale>

.NET:

http://<server>:<port>/<webapp>/startsession/<rulebase>/<locale>.aspx

 

Configure Oracle Web Determinations' look and feel to appear embedded

This following discusses how to configure the Oracle Web Determinations' theme/skin/UI so that it appears to be part of the parent application.

Page styling - colors, fonts, and images

The first thing to change in order to embed Oracle Web Determinations into an application are: the colors used, the text font/size, image and branding. Changing these will achieve the most in terms of making Oracle Web Determinations feel part of the parent application.

A lot of configuration is available in the appearance.properties, such as the body text font and color as well as styling of various Web Determinations page components (progress bar, menu bar, header, and so on).

While there is a lot of configuration available, only some parts of Web Determinations' look and feel can be controlled via appearance.properties. The appearance.properties file allows easy modification of commonly-customized Web Determinations areas.

Specific styling changes not possible in appearance.properties can be made by modifying the main.vm.css - located in <OWD webapp>/WEB-INF/classes/templates/main.vm.css. Note that this requires knowledge of HTML and CSS.

Here are a list of things to consider changing in Web Determinations that are configurable in appearance.properties:

 

The following two screen shots demonstrate the difference that can be made with a few tweaks in the appearance.properties.

Example - appearance.properties untouched:



 

Example - appearance.properties optimized

 

 

Disabling Oracle Web Determinations page components

Oracle Web Determinations has some page components that can be removed so it does not look like a stand-alone application. Some page components can be disabled via appearance.properties, while others need to be disabled manually by manipulating the Web Determinations templates. Note that manipulating templates requires knowledge of Velocity.

Header and Footer

The Web Determinations Header and Footer would be the primary components to be removed for embedding Web Determinations. As the Header and Footer cannot be disabled via appearance.properties, this needs to be done manually by modifying the Web Determinations templates. A main template is a template that contains the <html> tag; for example, start_screen, summary_screen, question_screen.

Bars

The next set of components that can be removed from Web Determinations are the bars - the menu bar, progress bar, and status bar. They can be completely disabled via appearance.properties.

Example - Bars removed

Below is an example of what it would look like if the menu, status, and progress bars are disabled.



 

Modifying page layout and other specific modifications

If the parent application has a layout or characteristics that are unique and do not follow standard web layout, the Oracle Web Determinations page layout may need to be tweaked to match.

This is not a simple change, and is considered advanced customization. Customizing the Web Determinations Velocity templates allows for nearly limitless changes, but can also reduce stability and maintainability.

To prevent reduction in stability and maintainability,

 

Some examples of page layout and specific modifications are:

Integrate Oracle Web Determinations into a parent application's workflow

This following describes an approach to integrating Oracle Web Determinations into a parent (web) application's workflow/process. This means that part-way through the workflow, the parent application will hand over data to Web Determinations, which will then conduct an interview.

Data (both provided and determined) during the Web Determinations interview is then passed back to the parent application. The parent application can then use the data passed back for further analysis or to drive the workflow.

How to integrate Oracle Web Determinations within a workflow

Integrating an Oracle Web Determinations interview inside an application's workflow means that the application can leverage Web Determinations' capability for handling complex determination scenarios.

To integrate the Web Determinations interview, the parent application needs to:

Pre-seeding the interview

Pre-seeding a Web Determinations interview makes the integration with the workflow seamless - the user does not have to re-enter data that was provided already to the parent application (either via a previous form on the same workflow or another workflow/app altogether).

The parent application can feed data to the Web Determinations interview by using the Load action. The data can be a mixture of:

 

The Web Determinations Load action uses the Data Adaptor to fetch and load data to a fresh interview, 'pre-seeding' the interview before it begins. More information about pre-seeding and Data Adaptor can be found in Data Adaptor - common scenarios

Starting the interview

To start a Web Determinations interview, a specific URL needs to be constructed. The URL construction works for both starting a fresh interview and pre-seeded interview, although the latter is probably the expected usage when integrating.

Web Determinations has a REST-based URL, allowing for a specific rulebase, locale, goal, and session ID to be provided. This avoids the user having to manually make the selection for those items, and helps with a seamless integration.

The REST URL to construct for starting the pre-seeded Web Determinations interview is as follows:

http://<OWD_webapp>/startsession/<rulebase_name>/<locale>/<goalID>?caseID=<caseID#>&user=guest

 

Description:

High level process for pre-seeding and starting an Oracle Web Determinations interview
  1. The parent application workflow reaches the stage where it requires a determination.
  2. The parent application's server-side has saved workflow data in a datasource that the Web Determinations Interview will require for pre-seeding.
  3. The parent application calls the Web Determinations interview to start, using a special (REST) URL:
    1. the REST URL instructs Web Determinations to 'load' a specific ID (for example, the applicant's ID).
    2. the REST URL can also instruct Web Determinations to start on a specific Goal, therefore skipping the Summary Screen (which is crucial if Web Determinations is to be embedded).
  4. Web Determinations' Load action uses the Data Adaptor to load the ID.
  5. The Web Determinations Data Adaptor, which has been created specifically to access the parent application's datasource, accesses the datasource and retrieves the necessary data for pre-seeding the interview.
  6. The Data Adaptor loads the data into the Interview, and the Interview Engine does a 'think' with the present data to check if any goals have been determined (for integration with a workflow, it should not reach a goal).
  7. Web Determinations starts the interview and presents a Question screen to the user.
Retrieving the data from the Oracle Web Determinations interview

The parent application has a few options to retrieve the data from a Web Determinations interview session.

  1. Let the Data Adaptor save the data into a datasource; for example, database in the parent application:
    1. Best approach.
    2. Because it is attached to the default Data Adaptor 'Save' action, can be called via different means; for example, Extension event, REST URL.
  2. Use an Extension event to access the intervew session data, and save it into a datasource:
    1. If the Data Adaptor 'save' action needs to be mapped to another save process, this is another option.
    2. Cannot be called manually, so the event has to be triggered for the save to happen.
  3. Create a Custom Screen that redirects to a URL link, supplying the data through a HTTP call:
    1. Not the cleanest solution, low security, not suitable for anything but simple/primitive data.
    2. Very flexible.
    3. Can also serve dual purpose - to retrieve data from the Web Determinations interview and also resume flow in the parent application workflow.
Resuming the original workflow

To resume the original workflow, the Web Determinations interview needs to direct the user to the next form in the workflow after the interview is completed.

There are many different approaches for this since web applications vary in implementation. Some are complex and dynamic, employing heavy Javascript/AJAX while others are simple and rely on basic URL request/response to drive the flow.

For basic (non-dynamic) webapp setups, the Web Determinations interview can change the URL of the frame (or the parent page) to the next form in the workflow.

To achieve this:

 

Some web applications employ DHTML/Javascript, and can control the page or frame's URL. In this case, Web Determinations may only need to be able to signal via Javascript that it has completed, and the parent application's DHTML/Javascript architecture can resume control of the workflow.

Initialize an interview with data from an outside source

You can initialize an interview by pre-seeding it with data from an outside source in instances where:

 

To enable pre-seeding, do the following:

  1. Create the Data Adaptor for the Web Determinations web application that is to run the pre-seeded interview.
  2. Proceed to the Web Determinations interview via a constructed link that defines the Case ID for the user; this case ID is then used by the Data Adapter to retrieve the necessary data from the external data source.
  3. Commence the Web Determinations interview with the pre-seeded data.

 

The URL that will direct the user to the pre-seeded interview allows the client system to specify a Case ID that the Data Adaptor will use to retrieve data from the external datasource.  The URL format is:

http://<webserver address>/<WD web app name>/startsession/<rulebase name>/<locale ID>?caseID=<caseID#>&user=guest

 

The client system needs the following information in order to construct the URL:

 

To build the Data Adaptor that will load the data from the datasource to the target rulebase you first need to determine what data is to be extracted from the datasource, and how it will map to the rulebase as instance data.

Pass interview data, conclusions and decision reports to an external application

In the event of the data being inferenced from a Web Determinations interview session needing to be saved to an external data source, you must first take the following action in order to determine what action will be taken to save the data:

 

A Data Adaptor needs to be developed for the client system so that when the 'save' action is issued, the custom-developed Data Adaptor will persist the specific Web Determinations interview session data into the external datasource.

This scenario also has variations/extensions, which are:

 

Note that when calling the Data Adaptor save, only the Case ID and interview session data is passed in. 

Auto-saving data during a Web Determinations interview

Auto-saving data during a Web Determinations interview can be driven by Event Handler plugins.

Auto-saving will use the 'save' capability of the loaded Data Adaptor. To persist Web Determinations interview data into an external datasource see "Saving data from a WD Interview to an external data source".

Below are common triggers for auto-save, and the Event to use:

 

More complex scenarios can combine the above so that, for example, auto-save per screen is performed and also when the goal is reached.

Because Case ID and interview session data is the only data passed through to the Data Adaptor, design of the Event Handler and Data Adaptor must take this into account. This means that the Data Adaptor must be able to operate based on information available in the Interview Session data passed; that is, the Event Handler cannot tell the Data Adaptor if the save is for a completed screen, or a completed goal.

With this design restriction, the Data Adaptor needs to be able to persist the data based on the actual instance value together with the rulebase model data.

Use an external data store for Web Determinations resources

There are situations where rulebases of an Oracle Web Determinations implementation need to be stored and accessed from a custom datasource. The RulebaseResolverPlugin is an Interview Engine plugin that allows usage of custom datasources to store and retrieve rulebases from. Also it lets the implementer customize the rulebase service functionality. For information on how to create a Rulebase Resolver plugin, go to the topic Create a Rulebase Resolver plugin.