The following is intended as a reference for implementing plugin event handlers to provide custom logic in response to events being fired at defined points throughout the execution cycle in both the Web Determinations Interview Engine and Web Determinations platform.
This section describes the specific engine and platform events - providing details about the objects contained by the events (accessible and modifiable by associated event handler implementations) and the mapping between the events and the event handler interfaces to be implemented by plugin classes in order to be registered as valid event handlers for the respective events.
These events are tied to an instance of the InterviewEngine. They allow subscribers to be notified when a rulebase has been added, removed or otherwise modified. This is particularly useful when using a Rulebase Resolver plugin that is capable of dynamically reloading rulebases (also known as, hotswapping).
Event |
Encapsulated objects |
Description |
Event Handler Interface |
---|---|---|---|
OnRulebaseAddedEvent | InterviewRulebase object that has just been added. | Fired immediately after the RulebaseService has notified the InterviewEngine that a rulebase has been added. | OnRulebaseAddedEventHandler |
OnRulebaseRemovedEvent | InterviewRulebase object that has just been removed. | Fired immediately after the RulebaseService has notified the InterviewEngine that a rulebase has been removed. | OnRulebaseRemovedEventHandler |
OnRulebaseUpdatedEvent | InterviewRulebase object that has just been updated. | Fired immediately after the RulebaseService has notified the InterviewEngine that a rulebase has been updated. | OnRulebaseUpdatedEventHandler |
These events are tied to an instance of the InterviewSession:
Event |
Encapsulated objects |
Description |
Event Handler Interface |
---|---|---|---|
OnSessionCreatedEvent |
|
Fired immediately after an interactive session is created, with the InteractiveEngine object as the sender. This is the chance to inject data into the session or perform any other custom initialization logic required.
|
OnSessionCreatedEventHandler |
BeforeSessionDestroyedEvent |
|
Fired just before a Web Determinations session is to be destroyed, with the InterviewSession as the sender. This is the last chance to extract the session data out of the session and persist it somewhere, clean up any resources created/opened during the session's lifetime, and so on. |
BeforeSessionDestroyedEventHandler |
OnValidateControlEvent |
|
Fired immediately after an input control is validated by the core validation logic, with the Web Determinations Engine ControlInstance as the sender. Custom validation may be applied here and errors and/or warnings attached to the transaction result object. |
OnValidateControlEventHandler |
OnValidateScreenEvent |
|
Fired immediately after an Interview screen is validated by the core validation logic, with the Web Determinations Engine InterviewScreen object as the sender. Custom validation may be applied here and errors and/or warnings attached to the transaction result object. | OnValidateScreenEventHandler |
BeforeSubmitDataEvent |
|
Fired immediately before data (encapsulated in an InterviewUserData object instance) is to be submitted into an Web Determinations session, with the InterviewSession object as the sender. Event handler implementations that handle this event have the ability to cancel the submission by appending an error to the transaction result object. |
BeforeSubmitDataEventHandler |
OnCommitEvent |
|
Fired immediately after data submitted into an Web Determinations session is committed to the rulebase session, with the InterviewSession object as the sender. If this event fires, it means that the data submitted has been attached to the underlying rule session and is safe to work with, persist, export, and so on. Some sort of auto-save functionality could be implemented as a handler of this event. |
OnCommitEventHandler |
OnSubmitRollbackEvent |
|
Fired immediately after a failed submit data operation was rolled back, with the InterviewSession object as the sender. If this event fires, it means that the data submitted has not been committed to the underlying rule session |
OnSubmitRollbackEventHandler |
OnSubmitDataEvent |
|
Fired immediately after the submit operation, regardless of whether the operation was successful and the data submitted was committed or the operation failed and the operation was rolled back. Note that this event will not fire if the transaction result contained errors immediately after the call to handleEvent on all the BeforeSubmitDataEventHandler implementations - the submission operation is aborted in this case and the BeforeSubmitDataEvent is the only submission event fired. |
OnSubmitDataEventHandler |
OnGenerateDocumentEvent |
|
Fired when the user submits a document generation action. The event handler receives the document type and other various document-generation parameters in the event object. The event handler also has access to the InterviewSession object from the sender input argument. The event handler has the option of generating a document of its own and providing it to the event object (as a 'replacement document'). The Web Determinations Server will use the replacement document and bypasses normal Document Generation steps. |
OnGenerateDocumentEventHandler |
These events allow developers to customize the behavior of the Interview Portlet:
Event | Description | Event Handler Interface |
OnPortletRequestEvent |
|
OnPortletRequestEventHandler |
OnPortletWriteResponseEvent |
|
OnPortletWriteResponseEventHandler |
OnDecodeParamEvent |
|
OnDecodeParamEventHandler |
OnAfterProcessActionEvent |
|
OnAfterProcessActionEventHandler |
These events are tied to an instance of the Web Determinations WebDeterminationsServlet. They are designed to provide access to the native HTTP Request, Response, and Session objects. Unlike other events the encapsulated objects differ with regards to the .NET and Java implementations.
Event |
Encapsulated objects |
Description |
Event Handler Interface |
---|---|---|---|
OnRequestEvent |
Java
|
Fired on receipt of either a HTTP Get or Post request, immediately prior the request being processed by Web Determinations. | OnRequestEventHandler |
.NET
|
|||
OnWriteResponseEvent |
Java
|
Fired after Web Determinations has processed the request but prior to any response being written to the response stream. | OnWriteResponseEventHandler |
.NET
|
These events are tied to an instance of the Web Determinations SessionContext:
Event |
Encapsulated objects |
Description |
Event Handler Interface |
---|---|---|---|
OnInvestigationStartedEvent |
|
Fired immediately after an investigation on a particular goal attribute is started. |
OnInvestigationStartedEventHandler |
OnInvestigationEndedEvent |
|
Fired immediately after an investigation on a particular goal attribute is concluded (that is, the goal becomes known). |
OnInvestigationEndedEventHandler |
OnGetScreenEvent |
|
Fired after the Platform Screen is generated from the InterviewScreen, and before it is rendered to HTML. The Screen object can be a native or custom screen. The sender object is the SessionContext object for the current session. |
OnGetScreenEventHandler |
OnRenderScreenEvent |
|
Fired after the HTML is generated from the Platform Screen object, and before the HTML is set back as a Response. The sender object is the SessionContext object for the current session. |
OnRenderScreenEventHandler |
OnSaveEvent |
|
Fired when the user clicks on the Save button to save the current interview data, and before the DataAdaptor 'save' is called. The handler can provide a Case ID for the save - poor man's data adaptor, and a quick way to auto-generate CaseID for save (avoiding the 'Get CaseID from user' screen'). The handler can also raise an error and halt the save process. |
OnSaveEventHandler |
OnRequireSessionEvent |
|
Fired if the current Interview request requires an InterviewSession to have already been started, and the current InterviewSession is null. The handler can provide the InterviewSession to be used by the Interview request. The handler can use the URI object, which contains various details about the current request such as the rulebase, locale, request action, and so on. Note: This event will not fire on a StartSession request since having an existing active session is not a pre-requisite for starting a new session. |
OnRequireSessionEventHandler |
OnApplyTemplatesEvent |
|
The event that fires before the Velocity template is applied to the screen. This method can be used to push additional parameters to the velocity template or modify the template used to render the screen. | OnApplyTemplatesHandler |
OnInterviewSessionCreatedEvent |
|
Fired immediately after a new InterviewSession is created in Web Determinations. It provides the opportunity for handlers of this event to perform additional post session configuration such as load reference data. Additional parameters that are passed in on the query string to the StartSession Action can be accessed via the provide URI object. The sender object is the SessionContext object | OnInterviewSessionCreatedEventHandler |
Along with the requirements placed upon plugin implementations, event handler implementations must conform to the following:
Follow the links below to view the event handler examples contained in the Oracle Policy Automation Developer's Guide:
Interview Engine
Web Determinations
Plugins - Data Adaptor - sample code (Autosave with Derby)
Example: Use the OnInterviewSessionCreatedEvent to pre-seed data into a newly created session
Interview Portlet
Example: Encode the Interview Portlet's response