The Oracle Determinations Server can return a decision report for a Known or an Unknown attribute value. The style of the decision report to be returned is specified by the decision-report-style attribute and each outcome attribute can specify a different decision report style.
A decision report is a complex XML type with the following structure:
The decision report element appears in an attribute element, when the request has specified an attribute-outcome for that element with on the decision report styles. The decision report element has the following attribute:
"report-style" (mandatory attribute). This is the type of decision report. This will match the report style in the attribute-outcome element in the request and will be either "base-attributes" or "decision report".
A sub-element of decision report and also of an attribute-decision-node, this element represents an attribute of an entity instance that is relevant to a decision report. If the value of the attribute this node is referring to is known, then there will be a sub-element of this node which is one of the value elements "boolean-val", currency-vale, etc. If the attribute is inferred from other elements, this element will have attribute-decision-node or relationship-decision-node elements as sub-elements.
The attribute-decision-node element has the following attributes:
"id" (mandatory attribute). This is a unique identifier for the decision node. This is useful when an attribute has been proved earlier. If this is the case the second time the node appears, it will have an "already-proven" element and you can use the id to locate the original proof, which will occur as a decision node element earlier in the decision report.
"state" (mandatory attribute). This attribute is the state of the attribute the decision node is referring to. Like an attribute state, it can be "known", "unknown" or "uncertain"
"attribute-id" (mandatory attribute). This is the identifier of the attribute the decision node is referring to.
"entity-instance-id" (mandatory attribute). This is the entity instance id the decision node is referring to (if known). This value will refer to one of the entity labels in the request session-data.
"entity-name" (mandatory attribute). This is the entity name (the type of entity) that the decision node is referring to.
text (mandatory attribute). this is the text for the attribute. This text will vary depending on the value of the attribute and whether it is known.
A relationship decision node appears when the value cannot be determined because of an unresolved relationship between entities. It only appears in decision reports when the value is unknown because of this. A relationship decision node has the following attributes:
"id" (mandatory attribute). This is the unique identifier for the decision node, and is the same as the id in an attribute-decision-node element.
"state" (mandatory attribute) This attribute is the state of the relationship. Because relationship-decision-nodes only show up when they are unknown, this will currently always be unknown if it appears.
"relationship-name" (mandatory attribute) the name of the relationship that needs to be resolved.
"source" (mandatory attribute) the source entity of the relationship, this will be the entity label, identifying the entity instance in the session data that needs the relationship.
"target" (mandatory attribute) the target entity type.
This sub element of attribute-decision-node appears when the attribute node has already appeared in the decision report. In this case, no further sub-elements of this decision node will be displayed and an already proven element will be displayed.
Decision Report styles
There are two report styles: the decision-report style which is the equivalent of the previously titled 8.5 Rule Server Detailed Report and the base-attributes style which is the equivalent of the previously titled 8.5 Rule Server Base Report.
Example:
If we have a rulebase which contains the following rule:
And an input data set of:
1 <assess-request>
2 <session-data>
3 <list-entity entity="global">
4 <entity label="global">
5 <attribute-outcome id="a" outcome-style="value-only"/>
6 <attribute id="e">
7 <boolean-val>false</boolean-val>
8 </attribute>
9 <attribute id="g">
10 <boolean-val>false</boolean-val>
11 </attribute>
12 <attribute id="i">
13 <boolean-val>false</boolean-val>
14 </attribute>
15 </entity>
16 </list-entity>
17 </session-data>
18 </assess-request>
Note: We are asking for the value of "a" in the global entity as a outcome. We are setting the value of the attributes "e", "g" and "i" (also in the global entity) to false. In the example we are asking for "a" to be displayed with the outcome style "value" only. Below there are examples of the three report styles "value-only" "decision-report" and "base-attributes".
For the outcome attribute "a", we get the following Decision Reports:
value-only
A value-only outcome is the simplest, it merely returns the value of the attribute, if it is known. If it is unknown, no value is displayed, but the attribute has a state of "unknown".
1 <attribute id="a" inferencing-type="goal" state="known">
2 <boolean-val>false</boolean-val>
3 </attribute>
For the attribute outcome report-style "value-only" no decision report is returned. The information in the response is the value of the attribute "a" (known and false).
decision-report
1 <attribute id="a" inferencing-type="goal" state="known">
2 <boolean-val>false</boolean-val>
3 <decision-report report-style="decision-report">
4 <attribute-decision-node attribute-id="b" entity-instance-id="global"
5 entity-name="global" id="dn:1" state="known"
6 text="b is not true.">
7 <boolean-val>false</boolean-val>
8 <attribute-decision-node attribute-id="e"
9 entity-instance-id="global" entity-name="global" id="dn:2"
10 state="known" text="e is not true.">
11 <boolean-val>false</boolean-val>
12 </attribute-decision-node>
13 <attribute-decision-node attribute-id="f"
14 entity-instance-id="global" entity-name="global" id="dn:3"
15 state="unknown" text="is f true?" type="boolean-val"/>
16 </attribute-decision-node>
17 <attribute-decision-node attribute-id="c" entity-instance-id="global"
18 entity-name="global" id="dn:4" state="known"
19 text="c is not true.">
20 <boolean-val>false</boolean-val>
21 <attribute-decision-node attribute-id="e"
22 entity-instance-id="global" entity-name="global" id="dn:2"
23 state="known" text="e is not true.">
24 <boolean-val>false</boolean-val>
25 <already-proven>See above: dn:2</already-proven>
26 </attribute-decision-node>
27 <attribute-decision-node attribute-id="g"
28 entity-instance-id="global" entity-name="global" id="dn:5"
29 state="known" text="g is not true.">
30 <boolean-val>false</boolean-val>
31 </attribute-decision-node>
32 </attribute-decision-node>
33 <attribute-decision-node attribute-id="d" entity-instance-id="global"
34 entity-name="global" id="dn:6" state="known"
35 text="d is not true.">
36 <boolean-val>false</boolean-val>
37 <attribute-decision-node attribute-id="f"
38 entity-instance-id="global" entity-name="global" id="dn:3"
39 state="unknown" text="is f true?" type="boolean-val">
40 <already-proven>See above: dn:3</already-proven>
41 </attribute-decision-node>
42 <attribute-decision-node attribute-id="h"
43 entity-instance-id="global" entity-name="global" id="dn:7"
44 state="unknown" text="is h true?" type="boolean-val"/>
45 <attribute-decision-node attribute-id="i"
46 entity-instance-id="global" entity-name="global"
47 id="dn:8" state="known" text="i is not true.">
48 <boolean-val>false</boolean-val>
49 </attribute-decision-node>
50 </attribute-decision-node>
51 </decision-report>
52 </attribute>
For the report-style "decision-report", the Determinations Server response reports that the attribute "a" is known and is false. Also, the response has a Decision Report containing decision nodes that describe how the value of "a" was determined.
The first node in the decision report is for the attribute id "b". It tells us that b is known and is false. Sub-nodes of this node explain that the values for "e" (false) and "f" (unknown).
Next there is a node explaining the value of "c" (known and false). Sub-nodes of this node explain the values for "e" and "g". Because the value for "e" has already been explain earlier, an already-proven element appears.
The third top level node explains the value of "d" (known and false). The three sub-nodes of this node explain the values of "f", "h" and "I". because "f" has already been proven for the node for "b" an already-proven element appears.
base-attributes
For the same data, a base-attributes decision report looks like:
1 <attribute id="a" inferencing-type="goal" state="known">
2 <boolean-val>false</boolean-val>
3 <decision-report report-style="base-attributes">
4 <attribute-decision-node attribute-id="e"
5 entity-instance-id="global" entity-name="global"
6 id="dn:2" state="known" text="e is not true.">
7 <boolean-val>false</boolean-val>
8 </attribute-decision-node>
9 <attribute-decision-node attribute-id="f"
10 entity-instance-id="global" entity-name="global"
11 id="dn:3" state="unknown" text="is f true?" type="boolean-val"/>
12 <attribute-decision-node attribute-id="g"
13 entity-instance-id="global" entity-name="global"
14 id="dn:5" state="known" text="g is not true.">
15 <boolean-val>false</boolean-val>
16 </attribute-decision-node>
17 <attribute-decision-node attribute-id="h"
18 entity-instance-id="global" entity-name="global"
19 id="dn:7" state="unknown" text="is h true?" type="boolean-val"/>
20 <attribute-decision-node attribute-id="i"
21 entity-instance-id="global" entity-name="global"
22 id="dn:8" state="known" text="i is not true.">
23 <boolean-val>false</boolean-val>
24 </attribute-decision-node>
25 </decision-report>
26 </attribute>
This Decision Report lists only base level attributes so inferred attributes "b", "c" and "d" do not appear. only the base level attributes "e", "f", "g", "h", "i" appear.