Welcome to the OPA Hub!


Tag Archives: Oracle Policy Modeler

Extension Code Generators for JavaScript

Hi There!


This content is accessible only to logged in users of the OPA Hub Website.

To Register takes only 10 seconds and uses LinkedIn for authentication.

Once registered you can change your OPA Hub password and manage it independently of LinkedIn.

We recommend you keep different passwords for all your sites.

To register, click the Log in link in the menu at the top of your page.

Thanks, the OPA Hub Website.

Back to Basics 7 – Interview Styles

Back to Basics 7 – Interview Styles

This episode looks at something that crops us regularly in workshops or training sessions with Oracle Policy Automation. What can we do to make the interview more unique , more like my website, more modern? You name it, you can insert plenty of other things in there – most people will recognize the sort of discussions I’m sure.

All too often the next step appears to bring in web specialists. I’m not against that at all, in fact quite the opposite, but only at the point where it becomes necessary, because we cannot achieve what the customer is asking without it.

There does not need to be a lot of Cascading Style Sheet manipulation on every project – because there are a host of options that can be managed from inside the Oracle Policy Modeler application and that will result in a custom style being written for you, but without the need for actual CSS editing.

The Styles Dialog is perfectly good for a lot of basic groundwork. It’s great that so many different things can be adjusted so quickly without resorting to customization.

OPA 12 Interview Styles Dialog

Bare Metal

In fact one of the things I like most about the Interview is the ability to strip right back to a minimalist look and feel, which is great for focusing the minds present on the actual business rules and not the gadgets. My own favorite thing is to strip off the extra styling on the radio buttons, calendar and drop-downs. These controls are already lightly styled out of the box. Compare the following.

This is the standard look and feel and the bare metal side by side:

Notice the difference. The custom sprites have been removed from the radio buttons and the other controls have had similar treatment. This is controlled by one option in the appearances.properties file. This file can be found if you go to the Styles dialog and click the Custom Files… button on the bottom left corner, then accept the warning. To activate the option you will need to remove the “#” on the following line.

OPA 12 Interview Styles Appearances ExtractThe appearances.properties file contains so many useful options that I am glad you have found it!

Have fun until next time.

 

Back to Basics 5 – Using the Go To Button in Oracle Policy Modeler

Back to Basics 5 – Using the Go To Button in Oracle Policy Modeler

Alright so this one is a bit strange, but I wanted to point out a piece of screen Real-Estate that in my humble opinion does not get used enough. The Go To Button in Oracle Policy Modeler in the Microsoft Word Ribbon that you see when you are editing Word Documents using Oracle Policy Modeler. Let me demonstrate by showing you a screenshot, as this will hopefully make things clear.

the Go To Button in Oracle Policy Modeler

To be honest, the name on the button bugs me. It is not really a “Go To” button at all. For me, luddite that I am, “Go To” means go somewhere in my document. And while the Go To button in Oracle Policy Modeler does indicate location, it does not go anywhere. In fact you have to put your mouse on the relevant item to get it to work. It is more a “what’s here?” button if you ask me. And yes, it tells me of the different properties of the item I have put the cursor on. Like this:

the Go To Button in Oracle Policy Modeler -- Results Window

As you can see in the screenshot above, the mouse was clicked on the conclusion. Then the Go To button was clicked. The dialog that was displayed reveals the text and any locations it appears in the Project (for example if you have your logic in two separate Word files, they will both appear here). In addition there are shortcut buttons to edit the Attribute or jump into the Oracle Policy Modeler Debugger. But the best part, if you ask me, is the ability to pin the window and open one, or many, more at the same time. Sometimes when debugging a document written by someone else it can be useful to have these all displayed as reference points – or just because you are trying to keep track of several things at once. If you pin a window, you can go right ahead and “Go To” again on another Attribute or whatever takes your fancy.

the Go To Button in Oracle Policy Modeler Pinned Wiindows

This picture is too big to display immediately so you can click it to go to full size. These simple things can be the source of saved time and heartache – for finding misspellings and so on – and I’m happy to be talking about them here on the ODE OPA Blog. Oh, and I did a little dance just now as we passed the 100 post landmark. Woohoo!

Oracle Policy Modeler Articles

Back to Basics 2 – Oracle Policy Modeler Articles

Back to Basics 2 – Oracle Policy Modeler Articles

Articles are a thorny point, since not all languages have the same concept. But the chances are that if you are working in a latin-based or greek-based language then you will have the concept of “the”, “le” or “la”, or “der”, “die”, “das” and so on. Writers who jump into Oracle Policy Modeler, especially those from other less natural-language focussed tools, tend to write rules that don’t have any articles, or that use the indefinite article. So what should we look out for in the area of Oracle Policy Modeler Articles?

Basic  Idea #2

Articles don’t matter.

Yes they do. Very much so. And perhaps the most insidious problems occur when there is no defined strategy at all, and everyone does what they feel like. For example, consider the following rule.

Oracle Policy Modeler Articles

Notice the lack of article. This rule will validate and work, despite it being a long way from natural language. However, what usually happens next is the entity model becomes more complex. So the designer adds an entity. Either “the customer” or “a customer”.

opa-12-customer-entity-bad

Notice how the original attributes, customer status and customer is always right, have remained attached to Global rather than the new Entity, since they didn’t contain the exact text “a customer”.

opa-12-entity-debug

Now in the Debugger we can see the side effect in the language generation.  A customer looks weird. The customer would have been far more readable. And in the Interview debugging session, it looks pretty nasty too.

opa-12-interview-customer-bad

And of course at the same time, our Interview does not really work because the attribute is not applied to each customer, just to Global.

opa-12-interview-customer-bad-2

 

If we had adopted a common sense approach and created all of our attributes with the more natural “the customer…” we would have had less issues with matching attributes to Entities and better natural language generation, and last but not least it would have been far more normal to read in Word. Oracle Policy Modeler needs to have definite articles both for Entity names and attribute definitions. 

  • Customer is right – not natural language
  • A customer is right – which customer?
  • The customer is right – natural, specific to one customer

 

 

Chrome Debugging Policy Modeler Interviews

Chrome for Debugging Policy Modeler Interviews

When looking into an Oracle Policy Modeler Debug session, I often want to view the Interview in Google Chrome, even at an early stage. The embedded Web Browser of the Debugger being Internet Explorer-based (and for various reasons which I quite understand, not having all the Context Menu options that normal IE has), I want a quick way to get into Chrome. I need to see the CSS, the JavaScript, and all the rest. Basically give me a Browser Debug Console.

To do this requires Registry Editor work, but the result is worth the effort. Firstly, let me again make clear I am not responsible for anything you choose to do with this information – you should think before doing anything in the Registry, and make backups. The example I am giving is for Windows 10, since it seems to be the least obvious solution – certainly it took a fair bit of searching on the Internet to get this working.

Add the following Key to add the ability to call Chrome directly from a URL in Internet Explorer, so to speak. You are going to create a new protocol to add to the http:// https:// file:// res:// and so on that you can use already for links. My protocol is called Trickshot://. Doing this in Windows 10 is much harder than in previous versions since there are many more restrictions in the domain of programs, defaults and so on.

In addition, just so we understand each other, we are basically using a security issue that could, in theory, be hijacked for nefarious purposes.

Several registry keys are needed. One in the HKEY_LOCAL_MACHINE and one in HKEY_CLASSES_ROOT branch.

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Trickshot\shell\open\command]
 @="\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" -- %1"

[HKEY_CLASSES_ROOT\Trickshot]
@="URL:trickshot"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\Trickshot\shell]

[HKEY_CLASSES_ROOT\Trickshot\shell\open]

[HKEY_CLASSES_ROOT\Trickshot\shell\open\command]
@="\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" -- %1"

Obviously you would adjust the path to correspond to your system. Now if you go to Windows Run command and type “Trickshot:// google.fr” – with a space after the slashes and without the quotes, you should see Chrome open the relevant site. So now we could use this as a link in our Debugger. The link will work, but as a side effect, a window of the OPA Debugger will open, will fail to load the page (with an Unknown Protocol error) but then Chrome will start and you are looking at the Interview. You can start a new session, switch on the JavaScript Debugger of Chrome and so on.

Embed a label in your Interview (or put it somewhere, hard coded) that looks like this:

<a target="_blank" href="./" onclick="window.open('Trickshot:// ' + this.href, 'mynewwin');return false;">Go to Chrome</a>

This is just an example of course. Run the Interview with the Debug button as normal. Click your Go to Chrome link. When you click it, the Embedded Internet Explorer will fail to open it, but the registered application will take over and Chrome will load the page for you.

So the flow is something like this:

And of course, it is true, you could right click the normal Oracle Policy Modeler Debugger window, click Create Shortcut, minimize Oracle Policy Modeler, find the right Shortcut, run it in Chrome, ad eternam (so many useless icons on your Desktop!) and work like that. But I think this method is much faster and easier in the long run.

Have fun!

 

OPA 12 – Custom Styles and JavaScript visualization

Hi There!


This content is accessible only to logged in users of the OPA Hub Website.

To Register takes only 10 seconds and uses LinkedIn for authentication.

Once registered you can change your OPA Hub password and manage it independently of LinkedIn.

We recommend you keep different passwords for all your sites.

To register, click the Log in link in the menu at the top of your page.

Thanks, the OPA Hub Website.

Conditions & Conclusions in Oracle Policy Automation Spreadsheets

Conditions and Conclusions in Oracle Policy Automation Excel Spreadsheets

Since this came up in the recent Oracle Policy Automation discussions I was having with a customer, it seemed a good idea to summarize it for people who are Getting Started with Oracle Policy Automation. There are two basic ways to use the column headings in an Excel file.

Using Column Headers with Condition or Conclusion Text

This is the usage that is taught first in the Oracle Policy Automation Essentials training. Using a small fragment of a fictitious speeding fine table, you can see the Condition Heading and Conclusion Heading formats are populated with Attribute Text.

Oracle Policy Automation - Using Table Headers with Attribute Text

Using Generic Column Headers

The second choice is to use generic headers, in fact these are the default headers inserted into the Excel file when you add it to your Project. In this example below you can clearly see the condition and conclusion texts in the relevant columns and the generic headers. This can be useful if you want, for example, to assert that different booleans are true as a result of a table row being true.

Oracle Policy Automation - Condition and Conclusion Generic Headers

Excel Limitations

There are some limitations which can occur when you are unfamiliar with Excel spreadsheets. Although these are not both directly related to generic column header usage I thought I would add them here for new starters to remind of the importance of using multiple columns where appropriate.

Oracle Policy Automation - Generic Conclusion Attempted Negative Error

As you can see in the example above, the use of a negative sentence in the generic conclusion is not allowed. We would have to reformat our table to use different, specific columns for our conclusion.

Oracle Policy Automation - Non Generic Conclusion Examples

Similarly, attempting to squeeze too much into a condition column will create another validation error:

Oracle Policy Automation - Generic Conditions Attempted Multiple Conditions

Hopefully this helps clarify what is possible, and what will need to be considered when getting started with Oracle Policy Automation Excel Spreadsheets. The official documentation can be found online here.

Have a nice day!

Natural Language in Oracle Policy Modeler- Missing Translations

Natural Language in Oracle Policy Modeler- Missing Translations

One of the things that irritates me, and I am sure (since I ask) other people is the lack of support for natural language versions of some pretty basic functions. For example, in English you can write (this is a screenshot in version 12 of Oracle Policy Modeler, in a Microsoft Word document) the following conclusion using a natural language “long form” function on the right hand side of the equals sign:

english natural language

This is a pretty standard function (the current date time) and I can think of gazillions of places where you would neeed to use it. In French, for example, the identical conclusion in a similar Project would need to look like this, where you can immediately see the section after the equals sign is no longer in natural language “long form”. You can find the function in the French function reference on the web here:

FRENCH FUNCTION WITH ONLY SHORT

So why is this function not available to be written in “long form” in French (and in a number of other supported languages)? This is because of the lack of natural language French equivalent for the “current date time” function, in the dictionary file. Now I’m not suggesting this is a showstopper, but natural language is one of the biggest selling points of Oracle Policy Modeler in respect of working with non-technical team members. So it would be nice to see a more complete investment in providing translations for common functions.

For esoteric ones, I get it, it can be hard, But this is an easy one and a translation can readily be found. In a few days we will take a look at how to resolve this kind of issue.

OPA 10 – Missing “It is currently known”

Hi There!


This content is accessible only to logged in users of the OPA Hub Website.

To Register takes only 10 seconds and uses LinkedIn for authentication.

Once registered you can change your OPA Hub password and manage it independently of LinkedIn.

We recommend you keep different passwords for all your sites.

To register, click the Log in link in the menu at the top of your page.

Thanks, the OPA Hub Website.

OPA 12 – Reference to Source Materials

Hi There!


This content is accessible only to logged in users of the OPA Hub Website.

To Register takes only 10 seconds and uses LinkedIn for authentication.

Once registered you can change your OPA Hub password and manage it independently of LinkedIn.

We recommend you keep different passwords for all your sites.

To register, click the Log in link in the menu at the top of your page.

Thanks, the OPA Hub Website.