Example: Investigation using the Determinations Server Interview Service

The following is an example of an investigation using the Determinations Server Interview Service operations. The rulebase used to generate the requests and responses can be found atexamples\rulebases\compiled\InterviewServiceTest.zip in the Oracle Policy Automation Runtime package.

Step 1 - Open a session

To begin, a session needs to be opened using the Open Session operation as follows:

Request
Response

Step 2 - List all available Goals

Get a list of the available goals; it is necessary to pass in the Interview Session ID that was listed in the response from the Open Session call. This is done by using the List Goals operation as follows:

Request
Response

Step 3 - Commence investigation of the goal

The call to List Goals showed that only one top-level goal is available; now begins the investigation of this goal. As this is the beginning the investigation, there is no screen data to pass in, in the investigate request. In the request it is necessary to pass the Interview Session ID, as well as the Goal State for the goal being investigated. In this example, the goal state for the only goal that was listed in the previous call to List Goals is passed in- "Is the person eligible for education expenses assistance?"

This is done by using the Investigate operation as follows:

Request
Response

Step 4 - Input pertinent data relating to the subject of the investigation

The screen returned from the first Investigate operation contains a single input control for an attribute with type currency. This input is for "the person's annual salary". It is now necessary to input the value for this control - inside the current-value tag; an amount of $50000 is input as follows:

Request
Response

Step 5 - Collect instances of the "child"

The last response received contained a containment relationship control. This is the control that represents an entity collect screen. We need to collect instances of "the child".

The containment relationship control contains a single entity instance control, representing an instance of the entity that is being collected. Inside the entity instance control is a single date input control for the child's date of birth.

The entity instance control in the response is a template - note that the value of the instance-id attribute is "-BLANK-". To collect entity instances on this screen, it is necessary to:

  1. Make a copy of the template for each entity instance that we want to create.
  2. Set the instance-id attribute for each instance.
  3. Set the values of any child controls of each entity instance control.

 

Note: If there was no need to collect any entity instances, it would simply be a matter of deleting the template instance. Also note that the template entity instance control is ignored in a request - any entity instance control in a request with instance-id "-BLANK-" will be completely ignored by the server.

 

The following example shows how to collect two instances of "the child" with ID,s "child1" and "child2":

Request
Response

Step 6 - Collect instances of the "school"

The response from the previous step contained another containment relationship control, this time to collect instances of "the school".

The template entity instance control contains a two input controls, a text input control for "the school's type", and a number input control for "the school's number of students". Note that the text input control has two list options - "PRIMARY" or "SECONDARY". These are the only valid values that this input can be set to.

Here we will create a single instance of "the school" called "school1", that has type is "SECONDARY", and that has 1200 students:

Request
Response

Step 7 - Set the relationship's target

The response from the last step contained a reference relationship control. This control is used to associated already existing entity instances via a relationship. This particular control is for setting "the child's school" for "child1". The available targets for the relationship are shown inside the "possible-targets" tag. To set the relationship, the appropriate targets should be copied from the "possible-targets" list and pasted inside the "set-targets" tag.

The possible target listed is "school1", so we set this as the single target of the relationship:

Request
Response

Step 8 - Set a second relationship's target

The response from the last step contained another reference relationship control. This time to the "the child's school" for "child2". Again, we set "school1" as the only target for the relationship:

Request
Response

Step 9 - Get a Decision Report

The summary screen has told us that the goal "The person is eligible for education expenses assistance" is true - but why was it true? To find out, we need to

get a decision report using the Get Decision Report operation.

Request
Response

Step 10 - Close the session

Finally, the session needs to me closed:

Request
Response