Wednesday Jan 22, 2014

Batch Processor in Oracle Policy Automation (OPA)

Adeolu Owokade | Monad Solutions

In this article, we will be exploring the Batch Processor in Oracle Policy Modeling. The Batch Processor allows a large number of cases to be processed in batch. It can take input from comma separated files or from a database and can output to the same.

Let me give an example of where the batch processor may come in handy. Imagine a Telecommunications organization that recently implemented OPA for its customers to check what mobile phone packages they can apply for. However, that organization already has data about its existing customers in a database and will also want to know which packages are applicable to its existing client base. The best way to do this will be by running this data in a batch rather than conducting an interview for each existing customer.

The Batch Processor sees its usefulness in other areas like conducting what-if analysis and generating test scripts from existing Excel data. We will explore input from and output to CSV files. This article assumes you have working knowledge of OPA; I will make it as practical as possible so let us begin by modeling a simple rulebase.

Sample Policy

  • The customer is eligible to apply for the Gold Plan if the customer has been a registered customer for at least 3 years and the total amount spent by the customer is above £3,000.
  • The customer is eligible to apply for the Silver Plan if the customer has been a registered customer for at least 2 years and the total amount spent by the customer is above £2,000.
  • Any registered customer is eligible to apply for the Basic Plan.

The OPA rules for this policy are as shown below:

The data model is as shown below:

Batch Processor Zero-configuration

If you are using CSV files as the input to the Batch Processor, much of the mapping from CSV data to OPA data can be done automatically through the Zero-configuration, by following a few simple guidelines which we will discuss in this section.

Entities

The CSV file name should be the public name of the entity. In our example, we will use two CSV files: "global" and "customer". "customer" is the public name of 'the customer' entity as shown below:

The CSV files are as shown below:

Input Attributes

The columns on the first row in the CSV files should be named with the attribute public names.

Identifier

By default, a column with the heading "#" is assumed to be a unique identifier for that entity.

Output attributes

To represent output attributes, enclose such public names in brackets.

One-to-Many Relationships

One-to-many relationships can also be represented in CSV files by using the public name of the relationship as the column title. For example, the relationship between global and 'the customer' entity is a one-to-many relationship which I can represent  in the customer.csv as shown below:

In the diagram above, customer instances #1 to #4 are instances under global instance #1 while customer instances #5 to #7 are instances under global instance #2.

The full content of the CSV files are shown below. The global.csv file has two instances of 'global'. You can think of this like two separate interviews (or 2 test cases). The customer.csv file has 7 instances representing 7 customers.

Running the Batch Processor

The batch processor is a standalone application that is run from the command line using the parameters listed below:

  • java -jar determinations-batch.jar <command line parameters> (JAVA)
  • Determinations.Batch.exe <command line parameters> (.NET)
To make running the Batch Processor easier especially when using Zero-configuration, I recommend placing all your files and rulebase in one folder. For example, take the rulebase ZIP file (found in the output folder in the Development folder of your OPA project) and place it in a separate folder. In that same folder, create another sub-folder to hold your CSV input files (name it "csv" so you don't have to specify the name of the folder in the CLI parameters).

Then, you can open a command prompt, navigate to this folder and run the batch processor from this location.

Note: If you are not running the Batch Processor from its default location, you must specify the full path e.g. "C:\Program Files (x86)\Oracle\Policy Modeling\bin\determinations-batch.jar"

Batch Processor Output

When the Batch process is complete, a folder (called "csv.out") is automatically created. This folder used to be named "output" in earlier versions of OPA (I'm using version 10.4.4). This folder contains the same CSV files in the input folder but with the generated output values.

Let's view the content of these CSV files. First, the customer.csv:

Notice that the output field – out_cust_years-reg – has been filled out. This is just the number of years between the current date (January 08, 2014) and the dates the customer registered.

Let's also view the global.csv file, where the output should count the number of customers that are eligible for each plan.

Summary

In this article, we have seen how to use CSV as input to the Batch Processor. We have also seen how to ensure that our csv files are properly formatted so that zero-configuration can take place. There are move advanced topics like writing a configuration file to be used for running the batch process and also database connections but this gives a good overview of the Batch processor.

I hope you have found this article insightful.


This article originally appeared on Monad's Commentary on Oracle Policy Automation (OPA) blog on 10 January 2014. Republished with permission.  

Sunday Jan 19, 2014

Ten Minute Tutorial: XDS Logger Plugin for Determinations Server (JDeveloper)

Andrew Higginbottom | Policy Automation Technical Zealot

Welcome to another TMT. This time we will create a plugin for Oracle Determinations Server to log incoming SOAP requests in the Oracle Policy Automation XDS (eXplicit Data Set) format - not to be confused with XSD. You can take this and load it into the Oracle Policy Modeling debugger to track down issues with specific SOAP requests. DISCLAIMER: This might take you longer than 10 minutes, depending on how fast you can click and how fast your PC is!

Last time we used Eclipse but this time we will be using JDeveloper to build and test the plugin. Again there are some prerequisites:
  1. Oracle JDeveloper (I used 11.1.2.4.0)
  2. Oracle Policy Automation Runtime Components for Java (I used v10.4.4.21.0)
  3. SoapUI (I used 4.6.4)

Once downloaded, install JDeveloper, extract the OPA Runtime Components to a convenient location and install SoapUI.

Now we begin. Start JDeveloper and accept the "Studio Developer (All Features)" role.

Select Application > New... from the main menu to create a new application workspace.
Give the application a name "ODSXDSPlugin"

Accept the default Project1 and Finish.

Having set up the Application, we now import the Determinations Server WAR file. File > Import... from the main menu, then select > WAR File. Call the project "determinations server".

At the next step Browse... to the location where you extracted the OPA Runtime and select /determinations-server/determinations-server.war.

Right-click determinations-server project, New..., General > Java Class.
Enter Name "XDSLogger", Package "com.opablog.aeh".

Add the "OnBeforeThinkEventHandler" interface. This event is fired for every request, after the request has been parsed into the session but before the rules are executed.


This time I've provided the code to copy and paste in, replacing the entire contents of the new XDSLogger.java file:

package com.opablog.aeh;

import com.oracle.determinations.engine.SessionUtils;
import com.oracle.determinations.server.assess.extensions.AssessPlugin;
import com.oracle.determinations.server.assess.extensions.AssessPluginRegisterArgs;
import com.oracle.determinations.server.assess.extensions.events.OnBeforeThinkEvent;
import com.oracle.determinations.server.assess.extensions.events.OnBeforeThinkEventHandler;
import java.io.IOException;
import java.io.StringWriter;
import org.apache.log4j.Logger;

public class XDSLogger implements OnBeforeThinkEventHandler {
 
    private Logger log = Logger.getLogger(this.getClass());
 
    public XDSLogger() {
        super();
    }

    @Override
    public void handleEvent(Object object, OnBeforeThinkEvent onBeforeThinkEvent) {
        try {
            StringWriter w = new StringWriter();
            SessionUtils.exportSession(onBeforeThinkEvent.getSession(), w);
            log.debug(w.toString());
        } catch (IOException e) {
            log.error(e);
        }
    }

    @Override
    public AssessPlugin getInstance(AssessPluginRegisterArgs assessPluginRegisterArgs) {
        return this;
    }
}


Edit Application Sources/config/application.properties to configure ODS to load the plugin by updating the plugin.libraries parameter to "plugin.libraries=com.opablog.aeh.XDSLogger"

Edit Application Sources/log4j.xml to increase the logging level by setting <level value="DEBUG"/> under the <root> element. Don't do this in production!

Copy in the PocketMoneyComputation.zip rulebase from the \examples\rulebases\compiled folder in your expanded OPA runtime location. Use Windows Explorer to copy the file into your JDeveloper project. For me the destination folder is located at C:\JDeveloper\mywork\ODSXDSPlugin\determinations-server\src\rulebases.


Now we can deploy the plugin to our local server.
Select Run > Start Server Instance (IntegratedWebLogicServer) from the main menu and enter credentials of your choice to use for server setup.

Wait for domain to build and server to start up. Once completed you should see "IntegratedWebLogicServer started." in the Log window.

Now we can deploy our Determinations Server with XDS logger plugin.

Right-click the determinations-server project and Deploy > "determinations-server...". Select "Deploy to Application Server", click Next, then IntegratedWebLogicServer, then Finish. Ignore any warnings logged during startup - they are only there because we turned the logging up to DEBUG.
In the deployment tab you should see that deployment has finished and you are given the URL in the Deployment - Log window.


Finally we can test our plugin by sending a request using SoapUI.
Open the URL in your favourite browser and you will see the familiar page listing the OPA services available. Grab the full URL to the specific Assess service WSDL.

Start SoapUI and select File > New SOAP Project from the main menu. Give the project a name and paste the WSDL URL for Initial WSDL. Make sure Create Requests is checked.

Open Request1 under the Assess node and paste the following minimal SOAP message to replace the default content:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://oracle.com/determinations/server/10.4/PocketMoneyComputation/assess/types">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:assess-request>

         <typ:global-instance>
            <!--You may enter the following 6 items in any order-->
            <!--Optional:-->
            <typ:base_rate>
               <typ:number-val>2.50</typ:number-val>
            </typ:base_rate>
            <typ:person_name>
               <!--You have a CHOICE of the next 3 items at this level-->
               <typ:text-val>Parent</typ:text-val>
            </typ:person_name>
 
            <typ:total_money outcome-style="decision-report"/>
 
            <typ:list-child>
               <typ:child id="1">
                  <typ:child_name>
                     <typ:text-val>Bobby</typ:text-val>
                  </typ:child_name>
                  <typ:child_age>
                     <typ:number-val>7</typ:number-val>
                  </typ:child_age>
                  <typ:child_money outcome-style="value-only"/>
               </typ:child>
               <typ:child id="2">
                  <typ:child_name>
                     <typ:text-val>Betty</typ:text-val>
                  </typ:child_name>
                  <typ:child_age>
                     <typ:number-val>9</typ:number-val>
                  </typ:child_age>
                  <typ:child_money outcome-style="value-only"/>
               </typ:child>
 
            </typ:list-child>
         </typ:global-instance>
      </typ:assess-request>
   </soapenv:Body>
</soapenv:Envelope>

Press "play" (the green arrow pointing to the right) to submit Request1. You should see a response that looks similar to the request, but with calculated values returned along with the inputs used.

In addition to processing the Assess request as normal, our new Determinations Server plugin has logged the inputs to the application log in the OPA XDS format.

You can now copy this XML into a text file and load it up in OPM to debug!

There are obvious improvements that could be made to this, such as logging each request to its own file, but I will leave those as an exercise for the reader. This is supposed to be a TMT after all!



Wednesday Jan 08, 2014

Building an Oracle Policy Automation Center of Excellence

Matthew Bickham | OPA Implementation Manager (Europe) & Center of Excellence Facilitator

Introduction

We all know Oracle Policy Automation (OPA) enables business experts to be able to create sophisticated rulebase applications directly without the need to have a background or qualification in software development. The diagram below provides an overview of the steps that are normally conducted to build an OPA rulebase:  

Business rule authors are critical to every project and to wrap them into a structure, I always encourage customers to establish a Center of Excellence (CoE) where talent, skills, processes and disciplines are centrally governed within a business. Whilst business experts may not initially have the skills to build software, the CoE approach provides everything needed to grow capability and confidence in authoring rules and systems that significantly outweighs any nervousness that may have existed at the outset. This is very important because initially not all organizations are ready to take the leap of faith needed for business experts to play a more development role. For those that do, there are significant rewards. Just some quotes from our CoEs:

“OPA is the most innovative technology on our estate”

“OPA has paid for itself 7 times over and that is just with our first project!”

“OPA is a game changer. We would never have been able to achieve what we have done using any other method or technology”

OPA Projects

Any project is often born through a business need to build a system to meet a brand-new requirement. In terms of OPA this will mean that a project will include a requirement for a system to automatically make a complex decision on behalf of the organization using rules and building a customer experience friendly interview that will include assessment screens, smooth screen-flow, data validation, look-ups (of known data) and documented outputs of the rulebase determinations that are made.

Projects are normally resourced to meet the needs of the project and formed based on the availability of key people, timelines to deliver and scope of the project work. Given these variables, a lot is left to chance and luck. Rulebase resources may require initial training but there is a tension to deliver in an agile way and this needs the team to be properly trained, experienced and ready to start creating rulebase components from day one. Forming a brand new project team for every project is very difficult given issues with availability of key experts. A much better approach is to build a Center of Excellence that maintains skills and grows capability so that with every new project the team grows in strength.

The Benefits

An OPA CoE addresses start-up issues because every project is safely delivered within a structure that already has the capability and skills to deliver a project from the beginning. It will contain a pool of resources at various skills levels. Senior members of the team will evolve through experience and lead areas of work including rules architecture, test management, project management and technical architecture. The CoE is special in that it is business centric but includes IT team members who must connect and manage the integration between OPA and other systems. This enables the business authors to remain focused on delivering projects using their skills to the full.

So why is an OPA Center of Excellence any different to any other CoE? The key difference is that the CoE is business focused with more Subject Matter Experts involved more directly with building and testing rulebase components than ever before. This is not only limited to rule authoring. Those involved in testing utilize tools within OPA itself (regression tester, what-if analysis, test coverage reporting etc) to verify rules directly, safely navigating rules and components at a read-only level. Powerful test suites are developed by business experts directly into a rulebase and each key outcome is tested against manually created expected outcomes. The business expert has responsibility for this work and has proven to significantly reduce the time to develop and test solutions, not leaving all the testing effort until the end. In addition, our customers report that defect-free systems are commonplace with OPA after initial implementation because the experts in that area of the business were more intimately involved in the authoring and testing process throughout. Due to OPA’s unique natural language capability, rules are easily read and understood by testers and other members of the team and this is one of the key factors in its success.

Becoming an OPA CoE

There is a process to becoming an OPA CoE. Oracle has assisted many organizations build their structure and capability which establishes a robust model for the successful delivery of projects that utilizes OPA in the future. To start, a Center of Excellence requires management and governance to control, direct and prioritize the work that is conducted. For most, this is led by a business manager with skills to manage resources across projects and business areas. Next, there is organization and structure to the Center of Excellence. For the resource teams, training and a qualification in OPA is achieved to an advanced level to ensure that the team members are fully skilled to successfully deliver projects with the product. A skills matrix is formed and a detailed record is kept of the skills attained as the experience of each member of the team grows. A CoE will also want to be known within the business and a communication plan is created to inform internal and external stakeholders about its purpose and vision. Other criteria exist to achieve recognition and includes adherence to best practices design standards, rule authoring guidelines and the control of rules within a configuration management system.

For all OPA CoEs there is now access to an exclusive online Oracle work-group that allows for greater sharing of knowledge, promotes decision of OPA related topics and provides valuable information about forthcoming events.

Summary

The OPA CoE approach has provided many OPA customers with a valuable structure and focus that has truly maximized the use of the technology and has built a strong team around it. ‘Growing your own’ OPA capability is part of the whole ethos behind the application and true value has been achieved when our customers have taken this best practice approach.  

Please get in touch if you would like to find out more.

Thursday Oct 10, 2013

Can OPA be used to improve draft legislation?

Fiona Guy | Product Manager Oracle Policy Automation

Last week I had the pleasure of presenting at the UK Cross Government Business Rules Group meeting on whether technology generally, and Oracle Policy Automation specifically, can help improve draft policy and legislation. I thought it might be worthwhile to share some of those thoughts here.

1. Improving the Structure and Accuracy of the Draft Itself

Logical and Structural Coherence

The process of transforming natural language text into OPA’s constrained rule format involves understanding the logical structure of the material you are working with, identifying the conclusions and conditions of each rule, and how each of these link to other sections of the policy material. In doing so, the process naturally highlights any logical and structural errors and ambiguities which may not be immediately apparent to the reader. From my experience, even well written policy and legislation usually contains a logical error or ambiguity that requires clarification from a policy expert every 2-5 pages.

In the early days of modeling rules, we started keeping a list of errors we found, and ended up with ~30 common legislative errors uncovered by modeling legislation in this format. For example, if a section mixes and/or logic, links to another section that no longer exists, or contains a loop between sections, OPA will immediately identify this on modeling, and in many cases insist that the error be corrected before continuing.

Many people don’t realize that the structure and principles behind modeling rules in OPA were developed in consultation with a senior legislative drafter to help avoid many of these logical errors. It was important to the development team, that by allowing the rules to be modeled in a natural language format (Microsoft Word and Excel), we did not also encourage the rule modeler to create rules that failed to deliver clear and correct outcomes. In other words, the design of OPA’s constrained rule format is specifically aimed at identifying and avoiding logical and structural errors or uncertainty.

Policy Effect

Once rules have been modeled in OPA, there are a few techniques for identifying whether the draft policy or legislation achieves the desired policy outcome.

The OPA Debugger allows you to run through a single scenario to see which questions are asked, and how the outcome is determined for a single user. I’ve found that simply running through an OPA interview quickly identifies information that is poorly worded, unreasonable to collect from the target audience, or is simply too onerous as a whole. An OPA interview is also useful to assess whether the policy calculates the desired outcome for any given scenario. The decision report is automatically generated to show the reasons for the decision, so errors can be directly traced back to the exact section of draft policy or legislation.

The Coverage tools (version 10.x) allow you to check that your test cases execute every rule in the policy model. This is particularly useful for checking that every section of your policy or legislation has substantive effect. For example, I’ve seen draft legislation which categorized claimants in order to apply one of several formulas for calculating compensation, but one of the categories was worded so broadly that another category would never be applied.

The What-If Analysis (version 10.x) and Excel Testing (cloud) features allow the policy modeler to create a series of test cases to see the effect of the rules on various scenarios. The data is entered into Excel, and the values automatically calculated by OPA appear in Excel column(s), allowing the tester to use Excel’s charting, highlighting and sorting capabilities to identify and analyze the effect of the policy on a range of scenarios, including highlighting unusual outcomes/payments.

2. Improvement Through Internal Consultation/Review

While these techniques can provide some insight into the quality of the draft itself, they are limited in their ability to assess the overall policy impact on the draft’s target audience. The announcement earlier this year of Oracle In-Memory Policy Analytics, signals a significant leap in capability. The key difference here is twofold:

1 - The analysis applies to real-world data, so you can see the actual effect and budget outcomes of the draft policy. For example, you could identify that changes to a disability care scheme would cost the government an additional $1.1 million but disproportionally impact families in a particular region.

2 – The dashboard interface allows people unfamiliar with OPA to analyze and tweak the policy to compare policy options without changing the rules. Policy experts, management, committees etc within an organization could use the dashboard interface to produce charts comparing policy options using real data and real legislative rules, without installing or modeling in OPA themselves.

The experts within your own organization are often the key brains that identify when the policy is likely to go awry. I’ve demoed a prototype to a few organizations and the feedback I’ve received is that it has great potential to improve both the quality of review and speed of the internal review process itself.

3. Improvement Through Public Consultation

Numerous studies have looked at whether public consultation can contribute to the quality of draft legislation in a meaningful way. Some countries (eg Canada, UK, US, Australia and New Zealand) have actively involved citizen participation in reviewing draft policy and legislation, with varying success. With OPA, governments now have the option to quickly and accurately expose the legislation as an interactive questionnaire, allowing citizens or targeted interest groups to assess their own scenarios against the draft legislation and leave their comments on the outcome and experience. The average citizen may not have the time or inclination to read though dense legislation to determine how the changes will affect their circumstances, but I believe many would have the curiosity to answer a few questions to see how they are likely to be affected by a legislative change. An OPA interview can therefore serve to inform as well as elicit public feedback on the draft policy itself.

Final Thoughts

So can OPA help improve draft legislation? Absolutely. It’s not going to tell you that your draft is a masterpiece or award you a gold star for effort, it’s not even going to look for every error you could possibly introduce, but it is another tool in your armory for improving the policy and laws that govern determinations, and therefore to ultimately improve your overall customer experience.

Fiona Guy is an expert in advanced Oracle Policy Automation rule design and implementation topics. She has been working with the OPA product line for over 10 years, as a lead consultant and now a product manager in the OPA development team. She is also a non-practising lawyer and lectures in Legislative Drafting and Technology at the Australian National University.

Wednesday Sep 25, 2013

Oracle Policy Automation Personalizes the Customer Experience

Peter Still | Executive Director, Policy Management and Strategic Decisioning, Oracle

Earlier this year, Oracle announced that Oracle Policy Automation is now available as a Cloud Service. This was an important announcement—partly because it means that OPA is now readily available to a much wider range of organizations, with SaaS flexibility and with Oracle providing the required IT infrastructure—but more importantly because it enables a shift in the way large organizations write their Customer Experience strategies.

Customer Experience has become a high priority area as both public sector organizations and private companies work hard to empower citizens and customers—by alerting them to relevant programs, services or products; by enabling 24/7/365 self-service; and by offering citizens and customers the ability to switch between difference service channels, including call center, web and in-person interactions. Often Customer Experience discussions focus on the cost and resource load of handling a single interaction. For example, some organizations measure the cost of handling a call center inquiry in the range $10–30 per call, so they will focus on offering online knowledge portals to customers, and encouraging lower-cost modes of interaction such as online text-based chat or service requests.

Oracle supports just such a multi-channel service model, and we do so with full support for both SaaS (Oracle RightNow Cloud Service) and on-premises (Oracle Siebel) options—both with productized Oracle Policy Automation available.

But Oracle Policy Automation allows us to take the discussion a step further. Oracle Policy Automation offers a powerful, cost-effective and rapidly deployable way for organizations to personalize citizen and customer interactions. Personalization is an important step in delivering a next-generation Customer Experience solution. It can help organizations to respond to calls quickly, and to enable self-service.

But even more than that, Oracle Policy Automation also plays an important role in driving accuracy and consistency. Citizens, customers—even customer service representatives—can find it difficult to answer complex questions about unusual circumstances, but Oracle Policy Automation can deliver specific, generated advice that is tailored to an inquirer’s situation. This is an important step beyond presenting generalized information to citizens and customers and asking them to interpret it. As a result, Oracle Policy Automation can enhance a Customer Experience strategy by driving higher levels of citizen and customer satisfaction, while also reducing repeat contacts from citizens or customers who may otherwise have received inconsistent advice.

Oracle Policy Automation has long offered both public and private sector organizations the ability to transform complex legislation, regulations and policy into an executable format—made available as online wizards that only ask relevant questions and explain the advice they generate; or integrated with other applications to automate all manner of complex determinations and calculations. The Oracle Policy Automation Cloud Service makes this approach more readily available to a wider range of organizations, and it includes productized integration with a leading Customer Experience Platform, the Oracle RightNow Cloud Service. Oracle also continues to support OPA integration with the Siebel platform for on-premises deployments.

We have been very pleased at the level of interest that the new Oracle Policy Cloud Service is generating, including a recent report, “Oracle offers Change “On the Fly” for Human Services Policies” by Adelaide O’Brien of IDC Government Insights. We’re looking forward to discussing this new solution with you at this week's Oracle OpenWorld conference, and at numerous other conferences and events. 

Peter

Welcome to the Oracle Policy Automation Blog

Welcome to the OPA blog where we aim to give you a range of perspectives on everything OPA. If you have any topics you would like to see addressed, please leave a comment here or post them to the OPA Community Forum

Happy reading! 


About

Welcome to the OPA blog where Oracle's Policy Automation experts share their views on everything OPA.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today