Get answers from a web service

What do you want to do?

Get an attribute as an answer

Get a relationship as an answer

Batch multiple assessments in a single request

Handle errors or warning returned from the Determinations Server

 

Get an attribute as an answer

You can get the answer to an attribute from the Oracle Determinations Server by using an Assess operation. Typically this attribute would be an inferred goal of a rulebase. In order to get an answer for this attribute goal you will need to provide sufficient information in the Assess operation for the answer to be inferred.

In both the generic and specific interfaces, you can ask for the value of the attribute by specifying an outcome style (outcome-style) instead of supplying a value. An outcome style tells the assess operation that you are asking for a value rather than setting one.

 

Example generic request

In the example above, the attribute element with an outcome-style is inside the entity element for client-100064. This means that I am requesting the value of the attribute client_is_eligible for the client identified in my assess request by the id client-100064. The outcome-style has been specified to be value-only, meaning I am only interested in the value. Alternatively you could specify an outcome-style of decision-report or base-attributes if you wanted the answer reported with a decision report.

In the assess response, you will find all attribute elements with an outcome-style now contain the inferred value of that attribute.

As an alternative to supplying the outcome style, we can supply both the known-outcome-style and unknown-outcome-style. This allows you to control the content of the response depending on whether the inferred attribute is known or unknown. In the example below we are again requesting the value of client_is_eligible for client instance client-100064. If the value of the attribute is unknown, we want a decision report. If the value of the attribute is known, we are only interested in the value:

 

Example generic request - known and unknown outcome styles

Use of the specific format is very similar. The outcome-style (or both known-outcome-style and unknown-outcome-style) is specified for the element representing the attribute that we are interested in to indicate that the Determinations Server should put the value in the response:

 

Example specific request

 

Example specific request

 

Example attribute in specific response

 

Get a relationship as an answer

In the same way that you can ask for the value of an attribute as answer, you can also ask for the value of an inferred relationship. This is also done through the Assess operation, by specifying an outcome-style (or known-outcome-style and unknown-outcome-style) in the request.

 

Example generic request

 

As with attributes (see above), you can specify the outcome style to be the value (in this case all targets of the inferred relationship) or the value and a decision report.

In the assess response, you will find all relationship elements with outcome styles specified populated with all the targets of that relationship.

 

Example relationship in response

 

In the example response, we can see that the inferred relationship is known for the client, and that there are two eligible targets, identified by their id’s.

Use of the specific format is very similar. The outcome-style (or both known-outcome-style and unknown-outcome-style) is specified for the element representing the relationship that we are interested in to indicate that the Determinations Server should put the targets in the response:

 

Example specific request

 

Example relationship in specific response


Batch multiple assessments in a single request

You can use the Oracle Determinations Server to infer more than one result. This means that you can design your rulebase in such a way that you can effectively get multiple results in a single request; you can effectively batch multiple assessments in a single request.

Retrieving multiple answers in a single request operation can be more efficient than a single call for each answer. Although the xml request and response for a batch request will be larger, it will all be done in a single request, which can be more efficient.

 

Example


Handle errors or warning returned from the Determinations Server

The Determinations Server will return Error and Warning events that may happen during an assess operation.

For Warninngs, you must specify in the assess-request that you want any warning returned. You can do this by setting the optional “show-events” attribute of the assess-request “config” element. This is the same for both the Specific and Generic service.

 

Example

 

When show events has been set to true, any warning events will display at the top of the assess-response.

 

Example

 

A warning event is always returned with the entity and a decision report attached.

For error events, no configuration is needed. Error events will always return a SOAP Fault if and error is raised in the inferencing.

 

Example