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 |
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
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://oracle.com/determinations/server/10.4/PocketMoneyComputation/assess/types">
<soapenv:Header/>
<soapenv:Body>
<typ:assess-request>
<typ:config>
<typ:show-silent>false</typ:show-silent>
<typ:show-invisible>false</typ:show-invisible>
<typ:show-properties>false</typ:show-properties>
<typ:show-events>false</typ:show-events>
<typ:resolve-indecision-relationships>false</typ:resolve-indecision-relationships>
</typ:config>
<typ:global-instance>
<typ:person_name>
<typ:text-val>Bob</typ:text-val>
</typ:person_name>
<typ:base_rate>
<typ:number-val>2.0</typ:number-val>
</typ:base_rate>
<typ:total_money outcome-style="decision-report"/>
<typ:list-child>
<typ:child id="fred">
<typ:child_name>
<typ:text-val>Fred</typ:text-val>
</typ:child_name>
<typ:child_age>
<typ:number-val>5.0</typ:number-val>
</typ:child_age>
</typ:child>
<typ:child id="mary">
<typ:child_name>
<typ:text-val>Mary</typ:text-val>
</typ:child_name>
<typ:child_age>
<typ:number-val>7.0</typ:number-val>
</typ:child_age>
</typ:child>
</typ:list-child>
</typ:global-instance>
</typ:assess-request>
</soapenv:Body>
</soapenv:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:i18n="http://www.w3.org/2005/09/ws-i18n" xmlns:typ="http://oracle.com/determinations/server/10.4/PocketMoneyComputation/assess/types">
<SOAP-ENV:Header>
<i18n:international>
<i18n:locale>en_GB</i18n:locale>
<i18n:tz>GMT+0800</i18n:tz>
</i18n:international>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<typ:assess-response>
<typ:global-instance>
<typ:total_money type="currency" inferred="true">
<typ:number-val>24.0</typ:number-val>
<typ:decision-report report-style="decision-report">
<typ:attribute-node id="dn:0" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="total_money" type="currency" text="The total amount of pocket money Bob has to pay is $24.00." inferred="true">
<typ:number-val>24.0</typ:number-val>
<typ:relationship-node id="dn:1" source-entity-id="global" source-instance-id="global" hypothetical-instance="false" target-entity-id="child" relationship-id="children" state="known" inferred="false">
<typ:target instance-id="fred"/>
<typ:target instance-id="mary"/>
</typ:relationship-node>
<typ:attribute-node id="dn:2" entity-id="child" instance-id="fred" hypothetical-instance="false" attribute-id="child_money" type="currency" text="The amount of pocket money Fred has earned is $10.00." inferred="true">
<typ:number-val>10.0</typ:number-val>
<typ:attribute-node id="dn:3" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="base_rate" type="currency" text="The pocket money base rate is $2.00." inferred="false">
<typ:number-val>2.0</typ:number-val>
</typ:attribute-node>
<typ:attribute-node id="dn:4" entity-id="child" instance-id="fred" hypothetical-instance="false" attribute-id="child_age" type="currency" text="Fred's age is $5.00." inferred="false">
<typ:number-val>5.0</typ:number-val>
</typ:attribute-node>
</typ:attribute-node>
<typ:attribute-node id="dn:5" entity-id="child" instance-id="mary" hypothetical-instance="false" attribute-id="child_money" type="currency" text="The amount of pocket money Mary has earned is $14.00." inferred="true">
<typ:number-val>14.0</typ:number-val>
<typ:already-proven-node id="dn:3"/>
<typ:attribute-node id="dn:6" entity-id="child" instance-id="mary" hypothetical-instance="false" attribute-id="child_age" type="currency" text="Mary's age is $7.00." inferred="false">
<typ:number-val>7.0</typ:number-val>
</typ:attribute-node>
</typ:attribute-node>
</typ:attribute-node>
</typ:decision-report>
</typ:total_money>
<typ:base_rate type="currency">
<typ:number-val>2.0</typ:number-val>
</typ:base_rate>
<typ:person_name type="text">
<typ:text-val>Bob</typ:text-val>
</typ:person_name>
<typ:list-child inferred="false">
<typ:child id="fred">
<typ:child_money type="currency" inferred="true">
<typ:number-val>10.0</typ:number-val>
<typ:decision-report report-style="decision-report">
<typ:attribute-node id="dn:0" entity-id="child" instance-id="fred" hypothetical-instance="false" attribute-id="child_money" type="currency" text="The amount of pocket money Fred has earned is $10.00." inferred="true">
<typ:number-val>10.0</typ:number-val>
<typ:attribute-node id="dn:1" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="base_rate" type="currency" text="The pocket money base rate is $2.00." inferred="false">
<typ:number-val>2.0</typ:number-val>
</typ:attribute-node>
<typ:attribute-node id="dn:2" entity-id="child" instance-id="fred" hypothetical-instance="false" attribute-id="child_age" type="currency" text="Fred's age is $5.00." inferred="false">
<typ:number-val>5.0</typ:number-val>
</typ:attribute-node>
</typ:attribute-node>
</typ:decision-report>
</typ:child_money>
<typ:child_age type="currency">
<typ:number-val>5.0</typ:number-val>
</typ:child_age>
<typ:child_name type="text">
<typ:text-val>Fred</typ:text-val>
</typ:child_name>
</typ:child>
<typ:child id="mary">
<typ:child_money type="currency" inferred="true">
<typ:number-val>14.0</typ:number-val>
<typ:decision-report report-style="decision-report">
<typ:attribute-node id="dn:0" entity-id="child" instance-id="mary" hypothetical-instance="false" attribute-id="child_money" type="currency" text="The amount of pocket money Mary has earned is $14.00." inferred="true">
<typ:number-val>14.0</typ:number-val>
<typ:attribute-node id="dn:1" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="base_rate" type="currency" text="The pocket money base rate is $2.00." inferred="false">
<typ:number-val>2.0</typ:number-val>
</typ:attribute-node>
<typ:attribute-node id="dn:2" entity-id="child" instance-id="mary" hypothetical-instance="false" attribute-id="child_age" type="currency" text="Mary's age is $7.00." inferred="false">
<typ:number-val>7.0</typ:number-val>
</typ:attribute-node>
</typ:attribute-node>
</typ:decision-report>
</typ:child_money>
<typ:child_age type="currency">
<typ:number-val>7.0</typ:number-val>
</typ:child_age>
<typ:child_name type="text">
<typ:text-val>Mary</typ:text-val>
</typ:child_name>
</typ:child>
</typ:list-child>
</typ:global-instance>
</typ:assess-response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
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
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://oracle.com/determinations/server/10.4/PocketMoneyComputation/assess/types">
<soapenv:Header/>
<soapenv:Body>
<typ:assess-request>
<typ:config>
<typ:show-silent>false</typ:show-silent>
<typ:show-invisible>false</typ:show-invisible>
<typ:show-properties>false</typ:show-properties>
<typ:show-events>false</typ:show-events>
<typ:resolve-indecision-relationships>false</typ:resolve-indecision-relationships>
</typ:config>
<typ:global-instance>
<typ:person_name>
<typ:text-val>Bob</typ:text-val>
</typ:person_name>
<typ:total_money outcome-style="decision-report"/>
<typ:list-child>
<typ:child id="fred">
<typ:child_name>
<typ:text-val>Fred</typ:text-val>
</typ:child_name>
<typ:child_age>
<typ:number-val>5.0</typ:number-val>
</typ:child_age>
</typ:child>
<typ:child id="mary">
<typ:child_name>
<typ:text-val>Mary</typ:text-val>
</typ:child_name>
<typ:child_age>
<typ:number-val>7.0</typ:number-val>
</typ:child_age>
</typ:child>
</typ:list-child>
</typ:global-instance>
</typ:assess-request>
</soapenv:Body>
</soapenv:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:i18n="http://www.w3.org/2005/09/ws-i18n" xmlns:typ="http://oracle.com/determinations/server/10.4/PocketMoneyComputation/assess/types">
<SOAP-ENV:Header>
<i18n:international>
<i18n:locale>en_GB</i18n:locale>
<i18n:tz>GMT+0800</i18n:tz>
</i18n:international>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<typ:assess-response>
<typ:global-instance>
<typ:total_money type="currency" inferred="true">
<typ:number-val>60.0</typ:number-val>
<typ:decision-report report-style="decision-report">
<typ:attribute-node id="dn:0" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="total_money" type="currency" text="The total amount of pocket money Bob has to pay is $60.00." inferred="true">
<typ:number-val>60.0</typ:number-val>
<typ:relationship-node id="dn:1" source-entity-id="global" source-instance-id="global" hypothetical-instance="false" target-entity-id="child" relationship-id="children" state="known" inferred="false">
<typ:target instance-id="fred"/>
<typ:target instance-id="mary"/>
</typ:relationship-node>
<typ:attribute-node id="dn:2" entity-id="child" instance-id="fred" hypothetical-instance="false" attribute-id="child_money" type="currency" text="The amount of pocket money Fred has earned is $25.00." inferred="true">
<typ:number-val>25.0</typ:number-val>
<typ:attribute-node id="dn:3" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="base_rate" type="currency" text="The pocket money base rate is $5.00." inferred="false">
<typ:number-val>5.0</typ:number-val>
</typ:attribute-node>
<typ:attribute-node id="dn:4" entity-id="child" instance-id="fred" hypothetical-instance="false" attribute-id="child_age" type="currency" text="Fred's age is $5.00." inferred="false">
<typ:number-val>5.0</typ:number-val>
</typ:attribute-node>
</typ:attribute-node>
<typ:attribute-node id="dn:5" entity-id="child" instance-id="mary" hypothetical-instance="false" attribute-id="child_money" type="currency" text="The amount of pocket money Mary has earned is $35.00." inferred="true">
<typ:number-val>35.0</typ:number-val>
<typ:already-proven-node id="dn:3"/>
<typ:attribute-node id="dn:6" entity-id="child" instance-id="mary" hypothetical-instance="false" attribute-id="child_age" type="currency" text="Mary's age is $7.00." inferred="false">
<typ:number-val>7.0</typ:number-val>
</typ:attribute-node>
</typ:attribute-node>
</typ:attribute-node>
</typ:decision-report>
</typ:total_money>
<typ:base_rate type="currency">
<typ:number-val>5.0</typ:number-val>
</typ:base_rate>
<typ:person_name type="text">
<typ:text-val>Bob</typ:text-val>
</typ:person_name>
<typ:list-child inferred="false">
<typ:child id="fred">
<typ:child_age type="currency">
<typ:number-val>5.0</typ:number-val>
</typ:child_age>
<typ:child_name type="text">
<typ:text-val>Fred</typ:text-val>
</typ:child_name>
</typ:child>
<typ:child id="mary">
<typ:child_age type="currency">
<typ:number-val>7.0</typ:number-val>
</typ:child_age>
<typ:child_name type="text">
<typ:text-val>Mary</typ:text-val>
</typ:child_name>
</typ:child>
</typ:list-child>
</typ:global-instance>
</typ:assess-response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
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
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://oracle.com/determinations/server/10.4/IncomeRebate/assess/types">
<soapenv:Header/>
<soapenv:Body>
<typ:assess-request>
<typ:config>
<typ:show-silent>false</typ:show-silent>
<typ:show-invisible>false</typ:show-invisible>
<typ:show-properties>false</typ:show-properties>
<typ:show-events>false</typ:show-events>
<typ:resolve-indecision-relationships>false</typ:resolve-indecision-relationships>
</typ:config>
<typ:global-instance>
<typ:total_rebate outcome-style="decision-report"/>
<typ:person_income>
<typ:number-val>30000</typ:number-val>
</typ:person_income>
</typ:global-instance>
</typ:assess-request>
</soapenv:Body>
</soapenv:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:i18n="http://www.w3.org/2005/09/ws-i18n" xmlns:typ="http://oracle.com/determinations/server/10.4/IncomeRebate/assess/types">
<SOAP-ENV:Header>
<i18n:international>
<i18n:locale>en_GB</i18n:locale>
<i18n:tz>GMT+0800</i18n:tz>
</i18n:international>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<typ:assess-response>
<typ:global-instance>
<typ:total_rebate type="currency" inferred="true">
<typ:number-val>270.0</typ:number-val>
<typ:decision-report report-style="decision-report">
<typ:attribute-node id="dn:0" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="total_rebate" type="currency" text="The person's total annual rebate is $270.00." inferred="true">
<typ:number-val>270.0</typ:number-val>
<typ:attribute-node id="dn:1" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="eligible_income" type="currency" text="The portion of the person's annual income eligible for a rebate is $3,000.00." inferred="true">
<typ:number-val>3000.0</typ:number-val>
<typ:attribute-node id="dn:2" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="person_income" type="currency" text="The person's annual gross income is $30,000.00." inferred="false">
<typ:number-val>30000.0</typ:number-val>
</typ:attribute-node>
</typ:attribute-node>
<typ:relationship-node id="dn:3" source-entity-id="global" source-instance-id="global" hypothetical-instance="false" target-entity-id="monthly_rebate" relationship-id="personsmonthlyrebate" state="known" inferred="false">
<typ:target instance-id="0x61c4666f66cb053d"/>
<typ:target instance-id="0x52268c854ed40345"/>
<typ:target instance-id="0x601ffca0266f3a67"/>
</typ:relationship-node>
<typ:attribute-node id="dn:4" entity-id="monthly_rebate" instance-id="0x61c4666f66cb053d" hypothetical-instance="false" attribute-id="monthly_rebate_amount" type="currency" text="The person's monthly rebate amount is $125.00." inferred="true">
<typ:number-val>125.0</typ:number-val>
<typ:already-proven-node id="dn:1"/>
<typ:attribute-node id="dn:5" entity-id="monthly_rebate" instance-id="0x61c4666f66cb053d" hypothetical-instance="false" attribute-id="rebate_rate" type="currency" text="The monthly rebate rate is $0.50." inferred="false">
<typ:number-val>0.5</typ:number-val>
</typ:attribute-node>
</typ:attribute-node>
<typ:attribute-node id="dn:6" entity-id="monthly_rebate" instance-id="0x52268c854ed40345" hypothetical-instance="false" attribute-id="monthly_rebate_amount" type="currency" text="The person's monthly rebate amount is $82.50." inferred="true">
<typ:number-val>82.5</typ:number-val>
<typ:already-proven-node id="dn:1"/>
<typ:attribute-node id="dn:7" entity-id="monthly_rebate" instance-id="0x52268c854ed40345" hypothetical-instance="false" attribute-id="rebate_rate" type="currency" text="The monthly rebate rate is $0.33." inferred="false">
<typ:number-val>0.33</typ:number-val>
</typ:attribute-node>
</typ:attribute-node>
<typ:attribute-node id="dn:8" entity-id="monthly_rebate" instance-id="0x601ffca0266f3a67" hypothetical-instance="false" attribute-id="monthly_rebate_amount" type="currency" text="The person's monthly rebate amount is $62.50." inferred="true">
<typ:number-val>62.5</typ:number-val>
<typ:already-proven-node id="dn:1"/>
<typ:attribute-node id="dn:9" entity-id="monthly_rebate" instance-id="0x601ffca0266f3a67" hypothetical-instance="false" attribute-id="rebate_rate" type="currency" text="The monthly rebate rate is $0.25." inferred="false">
<typ:number-val>0.25</typ:number-val>
</typ:attribute-node>
</typ:attribute-node>
</typ:attribute-node>
</typ:decision-report>
</typ:total_rebate>
<typ:person_income type="currency">
<typ:number-val>30000.0</typ:number-val>
</typ:person_income>
<typ:list-monthly_rebate inferred="false">
<typ:monthly_rebate id="0x61c4666f66cb053d">
<typ:rebate_rate type="currency">
<typ:number-val>0.5</typ:number-val>
</typ:rebate_rate>
</typ:monthly_rebate>
<typ:monthly_rebate id="0x52268c854ed40345">
<typ:rebate_rate type="currency">
<typ:number-val>0.33</typ:number-val>
</typ:rebate_rate>
</typ:monthly_rebate>
<typ:monthly_rebate id="0x601ffca0266f3a67">
<typ:rebate_rate type="currency">
<typ:number-val>0.25</typ:number-val>
</typ:rebate_rate>
</typ:monthly_rebate>
</typ:list-monthly_rebate>
</typ:global-instance>
</typ:assess-response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
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
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://oracle.com/determinations/server/10.4/PocketMoneyComputation/assess/types">
<soapenv:Header/>
<soapenv:Body>
<typ:assess-request>
<typ:config>
<typ:show-silent>false</typ:show-silent>
<typ:show-invisible>false</typ:show-invisible>
<typ:show-properties>false</typ:show-properties>
<typ:show-events>false</typ:show-events>
<typ:resolve-indecision-relationships>false</typ:resolve-indecision-relationships>
</typ:config>
<typ:global-instance>
<typ:person_name>
<typ:text-val>Bob</typ:text-val>
</typ:person_name>
<typ:total_money outcome-style="decision-report"/>
</typ:global-instance>
</typ:assess-request>
</soapenv:Body>
</soapenv:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:i18n="http://www.w3.org/2005/09/ws-i18n" xmlns:typ="http://oracle.com/determinations/server/10.4/PocketMoneyComputation/assess/types">
<SOAP-ENV:Header>
<i18n:international>
<i18n:locale>en_GB</i18n:locale>
<i18n:tz>GMT+0800</i18n:tz>
</i18n:international>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<typ:assess-response>
<typ:global-instance>
<typ:person_name type="text">
<typ:text-val>Bob</typ:text-val>
</typ:person_name>
</typ:global-instance>
</typ:assess-response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>