Data Adaptor - common scenarios

Data Adaptor - common scenarios

The following are common implementation scenarios that use the Data Adaptor, listed from basic to more complex scenarios. Note that some of the scenarios need to use other Web Determinations extensions, and also other Web Determinations extensions; for example, customizing UI, controls, and so on.

These scenarios document only how to implement the Data Adaptor in terms of each scenario.

Go to:

Pre-seeding a Web Determinations interview with data from an external data source

Saving data from a Web Determinations interview to an external data source

Auto-saving data during a Web Determinations interview - using the Data Adaptor and Event Handlers

Integrating the Web Determinations interview into the client system - using the Data Adaptor to handle data integration

Pre-seeding a Web Determinations interview with data from an external data source

 

This scenario is useful when:

 

Pre-seeding a Web Determinations interview with existing data has the following advantages:

Example scenario:

A client system is a case management system used for customer support, and needs determinations functionality. The user of the system is a customer support representative. When the user is in the case management system and needs to access Web Determinations for determinations, the Web Determinations interview that is started will have user data pre-filled, as well as other data required by the interview for determinations. Thus, the user does not need to manually enter existing data, and the Web Determinations interview process is streamlined, efficient, and will have less chances of input error from the user.

 

How to implement pre-seeding functionality using Data Adaptor plugin.

The general steps to enable pre-seeding are:

  1. Use or create a Data Adaptor that has a working load() action for the Web Determinations interview (note - a Web Determinations interview has specific rulebase and locale).
  2. The Data Adaptor is loaded onto the Web Determinations web application.
  3. The user is directed to the Web Determinations interview via a constructed link that defines the Case ID to be used as the key to retrieve data.
  4. The Data Adaptor load() is called, with the Case ID passed in.
  5. The Data Adaptor uses the Case ID to retrieve the necessary data from the external data source, and hands it over to the Web Determinations interview for data pre-seeding.
  6. The user starts the Web Determinations interview with pre-seeded data.

 

The URL that will direct the user to the pre-seeded Web Determinations interview is through a URL constructed by the client's system.

For developing Data Adaptors, see Data Adaptor plugin overview.

Saving data from a Web Determinations interview to an external data source

This scenario covers cases where data in a Web Determinations interview session needs to be saved to an external data source.

 

The general steps to enable saving data from a Web Determinations interview are:

  1. User or create a Data Adaptor that has a working save() action for the Web Determinations interview (note - a Web Determinations interview has specific rulebase and locale).
  2. The Data Adaptor is loaded onto the Web Determinations web application.
  3. When the save action is triggered in the Web Determinations interview, it calls the Data Adaptor save().
  4. The Data Adaptor reads the Web Determinations interview session data and saves it into the external data source.
  5. Other systems can now access the data entered or inferenced during the Web Determinations interview.

 

The steps above use default functionality for the Data Adaptor save method. As long as the Data Adaptor plugin is loaded for the Web Determinations interview, it will be used for any save action within that Web Determinations interview.
The action for saving data should also be determined; the following are two common ways of calling the Save action in a Web Determinations interview:

 

For developing Data Adaptors, see Data Adaptor plugin overview

 

This scenario also has variations/extensions, which are:

 

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

Auto-saving data during a Web Determinations interview - using the Data Adaptor and Event Handlers

Auto-saving data during a Web Determinations interview can be driven by Event Handler plugins. For more information about Event Handlers, see Events and Event Handlers.

Auto-saving will use the 'save' capability of the loaded Data Adaptor, triggered by an Event Handler. To persist Web Determinations interview data into an external datasource see "Saving data from a Web Determinations Interview to an external data source" (above).

The following 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 as well as being performed again when the goal is reached.

The general steps to setup Auto-saving of data during a Web Determinations Interview to an external datasource (that is, using Data Adaptor):

  1. User or create a Data Adaptor that has a working save() action for the Web Determinations interview (note - a Web Determinations interview has specific rulebase and locale).
  2. Determine which Event/s need to be used to trigger the Data Adaptor save().
  3. Create Event Handler/s that triggers the Data Adaptor save().
  4. The Data Adaptor together with the Event Handler/s are loaded onto the Web Determinations web application.
  5. When a user goes through a Web Determinations interview, event/s for the autosave Event Handler/s may be triggered.
  6. When an autosave Event Handler is triggered, it will process the Event arguments and call the Data Adaptor save() if conditions are met.
  7. When the Data Adaptor save() is called, it will save data from the Web Determinations interview.

 

For Autosave sample code, see Data Adaptor - sample code (Autosave with Derby)

 

Notes

Integrating the Web Determinations interview into the client system - using the Data Adaptor to handle data integration

It's very common for Web Determinations to be integrated into the client system, usually as part of a workflow where a Web Determinations interview session is required to inference information from provided data.

The client system usually has existing data about the user, and this existing data can be loaded into the Web Determinations interview session to pre-fill fields. In many cases the client system will integrate to the Web Determinations interview by being able to pre-load that existing data into a Web Determinations interview.

To load data into a Web Determinations interview, a Data Adaptor needs to be created so it can load the data from an external datasource. The URL that the client system uses to forward the user to the Web Determinations interview will contain the Case ID. For more information about loading data via the Data Adaptor see the Pre-seeding a Web Determinations interview with data from an external data source section above.

Once the user has provided all the necessary base attribute data to reach a conclusion, some or all of the Web Determinations interview session data usually needs to be passed back to the client system. The most effective way to do this is to persist the data into a datasource first so the client system can access the new data from the datasource.

The persisting or 'saving' of data to a datasource during the Web Determinations interview can be persisted via the Data Adaptor. The action of saving the data can be manual (user-triggered) or automatic (event-driven).

For more information about saving Web Determinations interview session data into a datasource, see Saving data from a Web Determinations interview to an external data source.