Assess API Events

Assess API Events

Go to:

Technical notes

Examples

 

The Assess API offers four events that fire at various points during the process flow, each of which is described in the following table; click on the appropriate event name in the table to go to related examples.

Name Encapsulated objects Description Event Handler Interface
OnAfterThinkEvent

AssessConfig - The assess configuration object provided for this assess request Session

Session - The Determinations Engine being used to conduct this assessment

This event fires immediately after a think has been conducted on the assessment. It provides an opportunity to add add/remove/or alter the data in the session before the assess results are generated and returned. OnAfterThinkEventHandler
OnBeforeThinkEvent

AssessConfig - The assess configuration object provided for this assess request

Session - The Determinations Engine Session being used to conduct this assessment

This event fires after the AssessData has been mapped into the session but before a think has been conducted. It provides the opportunity to augment the data in the session that was provided by the AssessData object. OnBeforeThinkEventHandler
OnMapDataEvent

AssessConfig - The assess configuration object provided for this assess request

Rulebase - the rulebase this assessment is going to be conducted using

AssessData - the data that the assessment will be based upon

This event fires prior to the AssessData being mapped into the Determinations Engine Session. It provides an opportunity to augment the data used to conduct the assessment. OnMapDataEventHandler
OnReturnResultEvent AssessResult - the result of the assessment This event fires after the assessment's results have been calculated but prior to that information being returned. It provides an opportunity to modify the assess results. OnReturnResultEventHandler

 

Technical notes

Examples

Go to:

OnMapDataEventHandler

OnBeforeThinkEvenHandler

OnAfterThinkEventHandler

OnReturnResultEventHandler

OnMapDataEventHandler

Usage scenarios

Example - Adding additional outcomes

This example uses a rulebase to calculate the total amount of pocket money a person has to pay. It adds an additional outcome for each child to show the amount of pocket money that child has earned.

Sample Java code can be found at:

<DS_JAVA_RUNTIME_DIR>\examples\determinations-server\onmap-dataevent-handler

Sample C# code can be found at:

<DS_CSHARP_RUNTIME_DIR>\examples\determinations-server\onmap-dataevent-handler

OnBeforeThinkEventHandler

Usage scenarios

Example - Adding reference data

This example uses a rulebase to calculate the total amount of pocket money a person has to pay. The calculation is based on the pocket money 'base rate' which is piece of reference data that gets loaded into the session using an event handler.

Sample Java code can be found at:

<DS_JAVA_RUNTIME_DIR>\examples\determinations-server\ onbefore-thinkevent-handler

 

Sample C# code can be found at:

<DS_CSHARP_RUNTIME_DIR>\examples\determinations-server\ onbefore-thinkevent-handler

OnAfterThinkEventHandler

Usages

Example - Conditionally adding additional data to the session

This example uses the OnAfterThinkEventHandler to add additional data to the session based on the value of an attribute that was inferred using the data that was submitted into the session.

Sample Java code can be found at:

<DS_JAVA_RUNTIME_DIR>\examples\determinations-server\ onafter-thinkevent-handler   

 

Sample C# code can be found at:


<DS_CSHARP_RUNTIME_DIR>\examples\determinations-server\ onafter-thinkevent-handler

OnReturnResultEventHandler

Usages

Example - Removing outcomes

This example goes through and removes any outcome that is not known, which will result in the service only returning known outcomes.

Sample Java code can be found at:

<DS_JAVA_RUNTIME_DIR>\examples\determinations-server\ onreturn-resultevent-handler

 

Sample C# code can be found at:

<DS_CSHARP_RUNTIME_DIR>\examples\determinations-server\ onreturn-resultevent-handler