Hi there, hope you are done with the OPM installation. In case you missed that part please refer OPM setup guide that I have posted earlier. Before you begin with the tool please make sure that you have the Microsoft Office suite installed in your system. Because we are going to write the rules in either Word or Excel with the help of Oracle Policy Automation office plugin. It will be installed and added to your MS Office when the OPM installation is over. Also check out my post on How to change Word formatting settings before you start writing rule. Now, lets get started.
Creating a example rulebase in Oracle Policy Modeling
1. Once you open the tool go to File –> New Project
2. Give any name for the project. I have give ‘Verification’ as the name. Select the rule language. OPM is a Multilanguage support tool. Select the region. Now this part is really important especially when you are going to use currency, date etc on your rule. The OPM will convert such data according to region.
3. Now as you can see the new project ‘Verification’ is added to the project explorer tab on the left. You see the set of folders that comes with each project, each one has its own important and I will be discussing about it in detail later. Now lets create our first rule document. Right click on rules –>Add new Word document.
4. Give name for the new doc or leave as it is. Either way its ok. For now I am giving name as test_rule.doc.
5. Double click on the doc and it will be opened in Microsoft word. As you can see in the image below Oracle Policy Modeling is the current active tab.
Our example rule goes something like this, ‘if the weather is sunny then the person is happy’. Make no sense right? Let’s begin with this simple one for now to explain the working. Now there is two part conclusion and condition. Here the conclusion or what we are inference is whether the person is happy or not. The only condition or rule we have regarding the weather. So, lets write this down.
6. Now define the conclusion and condition. Select the conclusion ‘the person is happy if’ and click on the Conclusion button on the left side.
7. Now define the condition. Select Level 1 as we have only one plain simple rule. Once the rule gets complicated we can add more levels and reach a valid conclusion.
8. Now compile the written rule. For that click on the Yellow Smiley button.
9. Now it ask for you to confirm the attributes you are using in this rule. Which I will talk later on. Now press OK and you are done.
10. Now come back to the OPM screen. Go to Build –> Build and run
11. Select the run mode. As we need to see the screens lets generate the screens. For that select ‘Run with Oracle Web Determinations’ and click Run.
12. Now if everything goes correct your browser will open a page like this; You can see the conclusion we wrote. The OPM will automatically converts the rule to readable questions. This questioning screen is also called Interview Portlet or screens. Click on the question.
13. It will ask you about the weather now. You see it is yes or no question. We can change the way the question asks. Select Yes and press Submit.
14. The result is ‘The person is happy’. That means the rule has executed correctly. If you have selected ‘No’ then it will show ‘The person is not happy’.
The ‘Why?’ will show you how the Web Determinations reached this conclusion. It is called the decision report. For this sample rule it is not much of a big deal but when you have 100’s of condition to analyse to reach a conclusion then you need to backtrack how it reached such a conclusion.
That’s how you write a sample rulebase using Oracle Policy Modeling tool. Very basic and easy right. On the next post we will be exploring more about the tool, the technical terms, talk about attributes, entities, relationships and deploying the rulebase to server. If you are facing any issues you can ask me anytime using contact me form or leave some comments. Do subscribe to my email newsletter for stay updated. Thank you for reading.