Today we are going to discuss about the integrated Batch Processor in Oracle Policy Automation. Well let’s all take a deep breath and try to focus as this is a new module which we are going to unfold. Life of an IT professional is not that predictable and I must say batch processor was introduced to me at one of the client location by someone who don’t have any prior experience about the tool.
That’s it!. I made some international calls, thanks to WhatsApp, and tried to get a basic idea on how it works. That combined with the Oracle documents and examples, it made me kind of OPA batch processing expert overnight. It’s more than 3 months now and I am doing nothing but batch processor implementation.
Batch Processing in OPA
Batch Processing, according to Wikipedia, is execution of series of programs on a computer without manual intervention. It is a processing mode, the execution of series of programs each on on a set of “batch” of inputs, rather than single input. Fortunately OPA can also do batch processing and believe me IT IS SUPER FAST*.
*Conditions apply. Depends on the rule complexity and type of implementation.
When Batch Processor is used in OPA
I understood the significance of this question when I was talking about this functionality to couple of new joiners. Interact with such ‘IT’ free fresh minds and you will get to know how to arrange the knowledge you have. The OPA, you know so far, works, you create screens, feed in input and get the decision report along with output. Or you will call the web service and you will get the response back, the XML request response transaction.
Imagine you have a lot of data, million or billion record, and you need to run OPA rule engine over it to find out result. Lets say we are dealing with finding eligibility of citizens of a country to vote and the only condition is age. It’s not practical to type in information of millions of people into the screen or consume web-service by creating XML requests. OPA batch processor can be used in this scenario. You will get faster results over lot of data. Do the mapping for OPA and Database and start the batch processor. It will execute and store back the result to the database. Let’s see what are the steps involved for doing such a process. The batch processor module doesn’t come with the standard installation package. You need to download OPA server componenets from Oracle site and unzip the files.
Types of Implementation
There are two type of implementation.
- Using Database – In this implementation, the data to be processed will be fetched from database. The mapping will be like entity (OPA) to table (database) and attribute to table column.
- Using CSV – In this type, the data will be feed in CSV format. Excel is used to maintain CSV files. The mapping will be from entity to csv file and attribute to column.
How to Implement Batch Processor in OPA
I am going to keep it simple. These are the steps to implement batch processor in OPA.
- Write the rules in word or excel. Compile and get the zip file.
- Give public names/names for all the entities, attributes, relationships using the Oracle Policy Modeling tool. This names are used in mapping the elements.
- Create database or use the existing database to consume the data.
- If you are planning to use Oracle database please follow this post on How to Configure Oracle Database and SQL Developer.
- Create a folder with following structure.
- The lib folder contains the odbc jar file which is supporting jar for database connectivity.
- rulebase – contains the compiled rule zip file.
- config – file contains the mapping.
- In case of CSV implementation then one more folder will be there which is used to store the input CSV files.
- Remaining jar files determinations-batch.jar, determinations-engine, determinations-utilities.jar, log4j.jar are used the whole batch execution.
- Open command prompt here and type java -jar determinations-batch.jar and the batch processor execution starts.
PS: This is a high level explanation.
The whole idea behind this blog post is to give an introduction on batch processing capability of the tool. I will be covering the step by step detail implementation example in another blog post. Kindly download the latest version of OPM and Server components to avoid compatibility error while executing. Please subscribe and like our Facebook page to stay updated with new blog posts on batch processor. Thank you for reading.