Oracle Policy Automation Tutorial

Getting Started with Oracle Policy Automation Tutorial

When starting with Oracle Policy Automation, the first step is to start writing rules and policies in Oracle Policy Modeling tool.

In the previous article we learnt about the high-level technology overview of Oracle Policy Automation, in this article we will try to get familiar with Oracle Policy Modeling tool by writing some basic rules and see how it works.

Oracle Policy Automation can be downloaded at the following link: http://www.oracle.com/technetwork/apps-tech/policy-automation/downloads/index.html

Please respect the terms and conditions of a trial version.

Once downloaded and installed, you will be able to start Policy Modeling from All Programs>Oracle>Policy Modeling.

Once started you will see the following screen.

Start Screen in Oracle Policy Modeling
Start Screen in Oracle Policy Modeling

We will start with creating a new project. Click on the “Create a new project” link or a “New Project” icon from the Menu bar.

A popup will be displayed as per the below screenshot.

Creating New Project in Oracle Policy Modeling
Creating New Project in Oracle Policy Modeling

Here you can type a “Name” for the project, choose the Rule language and region, and change the location where you want to create this new project. Once completed click on the “Create” button.

Once created, you will see the below screen, also called as the “Project” tab.

Project Tab in Oracle Policy Modeling
Project Tab in Oracle Policy Modeling

Project Tab: Project tab provides various information about the project. Some of them include:

  1. Project location and a button to open the project folder in windows explorer and also a button to share the entire project folder as a zip file.
  2. Rule Documents information including the number of documents and rules.
  3. Data Model which includes entities, relationships and attributes (used for storing the data) in OPM.
  4. Interview which includes the screens and navigation.

It also provides some other features from the left hand vertical pane which we will go into detail once we are comfortable with OPM tool.

The next tab in OPM is the “Rules” tab. This is where you can write your rules/policies/legislation.

The following screenshot demonstrates how the rules tab looks.

Rules Tab in Oracle Policy Modeling
Rules Tab in Oracle Policy Modeling

Here you can create the following:

  1. A new Word document to write your rules.
  2. A new Excel document to write your rules in an Excel tabular format.
  3. Arrange your documents by creating New Folder.
  4. Rename or Delete a document.
  5. Undo your changes.

By default, you are provided with a Word rule document. We will start writing our first rule by opening this document.

When you open this document in Ms Word, you will notice a new tab in the Menu Bar called as POLICY MODELING.

This tab provides you with various different features of Oracle Policy Modeling.

The below screenshot shows you the Policy Modeling tab.

Oracle Policy Modeling Tab
Oracle Policy Modeling Tab

To start writing rules we need to first get familiar with the above tab. Here we will go through each of the options provided in the Policy Modeling tab

Conclusion: Conclusion in OPM is your goal. It is the result of your conditions. For example:

                             the person is eligible to apply for a mortgage if

                                          the person’s age >= 18

 Levels: To derive a conclusion you need it to satisfy various conditions. Levels are your conditions. In the above example the condition of “the person’s age >= 18” is of Level 1. We will see more examples of this in the next article where we start writing some complex rules.

Indent: Indent is use to change the level or to indent the text in the document.

Toggle Comment: It is used to comment out a rule so that it is not considered by the Policy Modeler.

Blank Line: It removes all formatting from the text selected i.e. it will be treated as normal text and not as a rule.

Delete Condition: It will delete the condition selected.

Show Styles: It will show the formatting applied for each line in the rule document i.e. whether it is a Conclusion or Level 1 or Normal text.

Rule Table: This allows you to write rules in a tabular format in Word. We will see examples of this in the later article.

Rule Assistant: It helps you find all the attributes to assist you with finding the right one to use. We will see examples of this in the later article.

Go To: It helps you go to the attribute in the Data Tab. Again we will see examples of this in the later article.

Validate: This is the most important button on the Policy Modeling tab. It compiles all your rules and checks for any errors. It shows a popup confirming the same.

Let’s start writing our first simple rule in the Document opened.

Writing Rules in Oracle Policy Modeling
Writing Rules in Oracle Policy Modeling

In the above example, the first line is our Conclusion which is derived from the second line which is our Level 1 rule. Here we are saying that a person is eligible to apply for a mortgage if the person’s age is greater or equal to 18.

After writing your first line, select the text and click on the Conclusion button from the tab. Next write your Level 1 rule in the next line, select the text and select Level 1 from the drop down list of Level in the tab.

Now click on the Validate button to check if there are any errors. If the rules compile successfully, a popup will be shown with “No errors found”. Click OK on the popup and save your Word document.

Now go back to your OPM tool and click on the “Data” tab. You will see the below:

Data Tab of Oracle Policy Modeling
Data Tab of Oracle Policy Modeling

All the rules which you write gets converted into “Attributes”. Attributes are the way in which OPM stores the data or information about a certain rule/conclusion.

There are 3 types of attributes:

  1. Top-Level: The Top-Level attributes are generally your goals which you want to achieve. In the above example “the person is eligible to apply for a mortgage” is your top-level attribute.
  2. Intermediate: These are the ones which are derived by the inputs or base level attribute and are used by the top-level attributes.
  3. Base-Level: These are the input required to achieve the end result or the goal. In the above example “the person’s age” is the base level attribute.

Each attribute has a type which determines what can be stored in that attribute. OPA provides following different type of attributes:

  1. Boolean: Stores Boolean true or false value
  2. Number: Stores a number
  3. Currency: Stores a currency
  4. Text: Stores a text value
  5. Date: Stores date only
  6. Date and Time: Stores date and time
  7. Time of day: Stores time of the day

It is absolutely fine if you would like to create the attributes first and then write the rules for those attributes.

To create a new attribute, click on the “New Attribute” button from the Data tab.

The following screen is shown.

Creating New Attribute in Oracle Policy Modeling
Creating New Attribute in Oracle Policy Modeling

The first text box is for the attribute’s text (for example: the person is eligible to apply for a mortgage). The Entity drop down defines the entity of the attribute; we will look into the entity when we define the data model for our project in the later article.

The next is the attribute type which you can choose depending on what data will be stored in that attribute.

Input validation provides a way to perform validation.

Attribute name defines the name for the attribute which can be used to do mapping with external data.

We will come back to the “Data” tab when we write some more rules. Now let us look at the last tab in OPM called the “Interview” tab.

The below screenshot shows the “Interview” tab.

Interview Tab of Oracle Policy Modeling
Interview Tab of Oracle Policy Modeling

We will look into the options available on the “Interview” tab in detail in the later articles, but for now let’s try running the rules which we have written and see how it works.

For running the rules, click on the “Debug” button on the top right hand corner.

This starts the Interview application using the Oracle Web Determinations discussed in the earlier article. It runs the rules at the back and returns the results.

The below screenshot shows the Interview application in a Web App.

Running Interview in Oracle Policy Modeling
Running Interview in Oracle Policy Modeling

As mentioned earlier the Base-Level attributes will form the input and answering them will achieve the goal (i.e. the Top-Level attribute).

The below screenshot shows the result after the Interview is complete.

Interview Question Screen in Oracle Policy Modeling
Interview Question Screen in Oracle Policy Modeling
Interview Result in Oracle Policy Modeling
Interview Result in Oracle Policy Modeling

As seen in the above screenshots, based on our rules the “Interview” screens asked us questions and on answering the questions and submitting the page, the rules were executed and the goal was reached (i.e. the result was concluded). The summary of the result was shown on the final page.

To summarize the above, in this article we looked into the following:

  1. Creating a new project in OPM and understanding the Project Tab
  2. Writing basic rules and getting familiar with the Rules Tab
  3. Creating attributes and understanding the Data Tab
  4. Running the rules using internal OWD and understanding Interview Tab

In the later articles we will learn how to write complex rules and will go through some of the other functions provided in OPM.