The OPA Assess Method in Oracle Policy Automation Determinations #1
In this short series we are going to walk through using your Oracle Policy Automation Hub, which you have set up perhaps using our step-by-step guide, to create and execute a Web Service call using the OPA Assess method. This will require you to have the following ready to hand
- SOAP UI for testing purposes
- An Oracle Policy Automation Hub in your self-study environment
- Word and Excel
- The correct version of the Oracle Policy Modelling application for your Oracle Policy Automation Hub
Let’s get started:
For the purposes of this example, I created a simple Project that uses the following attributes. The details are not really important, but here is the rundown and the explanation.
- An entity named “the horse” and another called “the jockey”
- A relationship of type 1:1 between the horse and the jockey whose text is “the horse’s jockey”
- An attribute called “the jockey’s number” in addition to the default identifier attribute “jockey” which is automatically created
- An attribute called “the horse’s status”
- A Global attribute called “the date of the race”
- Make sure “all the instances of the horse” and “all the instances of the jockey” are changed to “the horses” and “the jockeys”
- Make sure that all attributes, entities and relationships have names specified. In my case for the relationships I used contracted versions of the actual text, such as “thehorsesjockey” and “thehorses” and “thejockeys”. You can use whatever you would like.
The following “rules” were added. In Excel, the horses are instantiated. The logic is puerile and not important.
Then a couple of extra goals are set up in a Word document.
- Passing Global attributes and Entity attributes in the Request
- Returning Inferred Instances in the Response as well as other goals
Now you can upload your version to the Repository and Deploy the Project. Once deployed, log in to the Oracle Policy Automation Hub and make the following changes for the Project in question, in the Deployments section: change the available access methods:
This ensures that for testing purposes, your Project is only available through Determinations API.
Verify that in the Permissions section, the username and password is required for Determinations API calls.
Next, ensure that the user that you intend to use for the Web Service access, has the Determinations API access as part of their permissions:
Finally, click the Web Service URL in the Deployment details for your Project and save the resulting file to a suitable location, ready for use in SOAP UI. This takes a couple of steps.
You will have to enter your username and password. If you are unable to proceed past this point, check that your user has the permissions shown in the previous screenshot. Now download the most recent (in terms of version) Web Service definition by clicking the link shown. This is the file that you need in SOAP UI.
Open Soap UI and create a New SOAP Project for the OPA Assess Method. The dialog box for the New Project will look a little like this. The items marked are as follows:
- The file you just saved
- A name you want to give to this series of tests
Once the Web Service definition has been imported you should be looking at something like this, in the SOAP UI window:
Well done on getting this far, you are now ready to test and investigate your Web Service. In part two, you will configure both of the available methods (Assess and ListGoals) in order to complete your work. Onward to part two!