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.
Pre-seeding a Web Determinations interview with data from an external data source
This scenario is useful when:
Data for base attributes in a Web Determinations interview is already available, and accessible from a datasource; for example:
the user has provided data to an existing client system, and that system stores the data in a datasource accessible to Web Determinations.
data about the subject matter of the Web Determinations interview is available from a datasource that is accessible to Web Determinations.
The Web Determinations interview needs to be integrated into a client system , and the client system wants to hand over the user to the Web Determinations interview for determination.
it is expected that questions in the Web Determinations interview where the data is already known by the client system should be pre-populated.
The Web Determinations interview is expected to allow the user to stop the interview, and continue later.
Pre-seeding a Web Determinations interview with existing data has the following advantages:
better user experience - the user does not need to re-enter the same data that has already been provided to the client's other system in the past.
ability to provide data that the user may not know - this is useful for Web Determinations interviews where some of the base attributes of a goal is not known by the user, but is needed for the determination of a goal.
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:
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).
The Data Adaptor is loaded onto the Web Determinations web application.
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.
The Data Adaptor load() is called, with the Case ID passed in.
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.
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.
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.
Useful for saving inferenced data (the main power of Oracle Policy Automation).
Also can be used together with auto-saving to enhance user experience with Web Determinations interview - they can save provided data and continue later, don't need to complete the interview in one go.
The general steps to enable saving data from a Web Determinations interview are:
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).
The Data Adaptor is loaded onto the Web Determinations web application.
When the save action is triggered in the Web Determinations interview, it calls the Data Adaptor save().
The Data Adaptor reads the Web Determinations interview session data and saves it into the external data source.
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:
Most likely the data is automatically saved for the user by the Web Determinations session. Automatic saving of data requires Event handlers that call the Data Adaptor to save the current data.
The user is also able to save by clicking on the default Save/Save As command available in a Web Determinations interview session. This also calls the Data Adaptor to save the current data.
This scenario also has variations/extensions, which are:
Auto-saving of Web Determinations interview data when a certain event occurs or requirements are met.
Loading base instance data and saving inferenced instance data
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:
when the user completes a screen (OnGetScreenEvent).
when a goal is reached (OnInvestigationEndEvent plus checking the Session data that the target goal attribute value has been provided).
when certain attributes are inferenced (OnGetScreenEvent plus checking that the particular attribute has a value that is not null, unknown, uncertain).
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):
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).
Determine which Event/s need to be used to trigger the Data Adaptor save().
Create Event Handler/s that triggers the Data Adaptor save().
The Data Adaptor together with the Event Handler/s are loaded onto the Web Determinations web application.
When a user goes through a Web Determinations interview, event/s for the autosave Event Handler/s may be triggered.
When an autosave Event Handler is triggered, it will process the Event arguments and call the Data Adaptor save() if conditions are met.
When the Data Adaptor save() is called, it will save data from the Web Determinations interview.
Because Case ID and Interview Session data are the only data passed through to the Data Adaptor, design of the Event Handler and Data Adaptor must take this into account. The Data Adaptor must be able to operate based on information available in the Web Determinations session data passed - that is, the Event Handler cannot tell the Data Adaptor if the save is for a completed screen (autosave per screen), or a completed goal.
When analyzing which Events to use, check both sender Object and the event args. Both expose data that can be used to fine-tune when the Data Adaptor save is triggered
The Case ID that the Event Handler needs to pass to the Data Adaptor save() is in the SessionContext object. Therefore ensure that the Event to trigger the autosave has access to the SessionContext object (either the sender object or from one of the Event args)
Ensure that the Event Handler calling the Data Adaptor provides a Case ID if the Data Adaptor is not generating the ID.
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).