Welcome to the OPA Hub!


Tag Archives: OPA 12

Temporal Reasoning in Oracle Policy Automation #2 : Time Travel

Temporal Reasoning in Oracle Policy Automation #2 : Time Travel

Following on from the previous post, this short series is looking at temporal reasoning. In the initial post we investigated the basic principle of entering temporal data in the debugger and using a function such as ValueAt() to get the value of a temporal attribute on a given date.

Now that we have laid the groundwork, we can extend our range a little. The first scenario to discover requires us to have the data in the debugger just like last time, with data for the first few days in July. If you are not sure of the scenario then jump right back to chapter one.

When did you last have lots of money in your account?

I’m sure I’m not the only one who sometimes looks at my bank account and feels a little depressed! The bank balance seems to go down and down, then spikes up on pay day and down and down again. I often ask myself, when looking at something nice in a shop or showroom¬† – a car for example – when did I last have that kind of money?

Thankfully, Oracle Policy Automation is here to help answer that question and many others in relation to temporal data. The following function will hopefully illustrate this example:

OPA 12 - Temporal Reasoning Part Two 2

You can probably guess the idea. Working backwards from the current date, when did I last have a value greater than 1500 in the temporal bank balance. Now, if you have been using the same example data as me, this function will currently return a value of uncertain. That’s because none of the data in the debugger at the moment is greater than 1500. But if you add a new Change Point to the temporal bank balance, for example :

OPA 12 - Temporal Reasoning Part Two 3

Then your debugger should provide you with a more definite answer. In my case, you can see that June 14 I had a change to my bank balance and it was 1550. The next available change point is July 1, when the value was 1000. So when did I last have more than 1500 in my temporal bank account? Following the change point data, the last date I had that amount of money was June 30. You might suspect that I spent my money faster than that ūüôā but we can only work with the facts, and the change points are those facts.

It won’t come to you as a surprise that there are many functions in the Function Reference for finding out values, and one of them is described below. It belongs to a series of functions prefixed with Interval.

OPA 12 - Temporal Reasoning Part Two 4

This one, as the goal suggests, helps me find my lowest bank balance in the period between the start of the year and today, based on the information in the change points. It will obviously depend on your data, but you will probably have something like this.

OPA 12 - Temporal Reasoning Part Two 5

In the next post we will continue investigating members of this family of temporal reasoning functions.

Oracle Policy Automation and Siebel Innovation Pack 16 #2

Oracle Policy Automation and Siebel Innovation Pack 16 #2

Oracle Policy Automation and Siebel Innovation Pack 16 - Hub ConnectionFollowing on from the first post about Oracle Policy Automation and Siebel Innovation Pack 16 a few days ago, this post continues with a series of (hopefully) useful videos about the next steps. Last time, you had just built your Connection in the Oracle Policy Automation Hub and had checked to see if the green light came  on. In the video sequence today, you will test both of the design time methods (CheckAlive and GetMetadata) in your SOAP UI testing tool to ensure that you get something like the correct response.

Testing in SOAP UI can be very frustrating at first. You take the time to download the WSDL from Siebel Enterprise and import it into SOAP UI, fully expecting to work with it immediately. But there are a few traps. Firstly, the need to (unless you have switched off the requirement in the Oracle Policy Automation Hub, which would be very unwise in most circumstances) add wsse tags to the Header and provide a user name and password. Secondly, you may (probably) need to remove some extraneous tags on the SOAP Request, and finally if your Siebel environment is not up and running and the relevant Workflow Processes are not active, you won’t get much in the way of feedback :).

Presentation

In this brief overview, we talk about the different big-picture steps to set up communication and how to go about it.

Setting Up a Connection for Oracle Policy Automation and Siebel Innovation Pack 16

In this part you walk through the practical steps to build a Connection, add or import the different Workflow Processes and Inbound Web Services to implement the first two operations and get ready to test them.

Build CheckAlive and GetMetaData Operations

This video walks through the technical steps in Oracle Policy Automation, Siebel CRM and SOAP UI to build these two operations according to the White Paper.

Next…

In the next few days, the Load and Submit operations, the core of the integration, will be worked through and examined in Siebel and Oracle Policy Automation terms.

JavaScript Extension Custom Header as a Timer in Oracle Policy Modelling

JavaScript Extension Custom Header as a Timer in Oracle Policy Modelling

Sometimes I get distracted. I was supposed to be preparing for a workshop last night on an unrelated, Siebel-centric topic. I happened to be reading (again) through some material on our sister site, https://siebelhub.com, and I came across an example – which I have always been impressed by – from Duncan Ford, one of the Siebel Open UI and JavaScript gurus who contributes to the Siebel content on our blog. And it got me thinking about and Oracle Policy Automation JavaScript Extension Custom Header as a Timer.

The basic tenet of the script was building a set of statistics for timing performance : how long did such and such a page take to load and be ready, in a sense. In Siebel-world, this is a constant worry and ongoing process. So I got distracted by this and thought about Oracle Policy Automation and how we might use some of the ideas in our own script. I settled on the basic principle that I would want to know about how long it took people to finish a given Screen (ultimately you could extend it to the Stage concept as well). So not directly about performance, more about user time.

To do this, I figure we already have a bucket-load of exciting charts from the Hub :

JavaScript Extension Custom Header as a Timer

You know the sort of things I mean, available for each project : you can grab a set of information about a Project, change the type of chart, decide how to split the axes, decide which version to look at, filter on Service Cloud criteria and number of days and so forth.

These are great  tools. Of course, you also might have the mindbogglingly powerful In-Memory Policy Analysis with TimesTen and so on.

But you might not have any of that to hand, and you might want to work out how much time, each person spends on each Screen. Of course the navigation paradigm in Oracle Policy Automation is different to a Customer Relationship Management application like Siebel – you can go back and forth between the Screens quite a lot. All I really want to do in this case – because it was useful to me – was to identify the cumulative time spent on each Screen, and display it in the Browser at the end of the Interview:

JavaScript Extension Custom Header as a Timer

It sounds really easy but there are a couple of things that will be interesting to talk about along the way.

JavaScript Extension Custom Header as a Timer in Oracle Policy Modelling  РData

I decided to choose the customHeader as my starting point. The documentation states that this renders the header for an interview. So by logical extension it probably has the things we might need :

  • Access to the Interview Object
  • Access to the Stages and Screens in the Stage
  • Adding code that does not implement any UI probably won’t cause a problem, since the UI does not have to display a Header (it’s an option in the Styles dialog)

For the second part of the requirement, the display of the results, I decided to use the customLabel approach with jsGrid, similar to the example back in December of last year.

So I knew I would need 2 files, one for the custom Header and one for the custom Label. Since the results would only display on the last page (“Interview Complete”), I wanted to be able to pass the results from the Header to the Label easily. So how did the JavaScript Extension Custom Header as a Timer in Oracle Policy Modelling¬†work out? Well, as usual I was just experimenting so it is rough, ready and not very robust. But it is interesting enough to provide some talking points. Let’s look at the code for the Header first.

First the opening salvo of the customHeader:

JavaScript Extension Custom Header as a Timer

  1. We are going to store results in an array of JavaScript objects. This is similar to how the actual Screens are accessed in the Interview, and also it allows us to plug the data straight into the jsGrid component.
  2. So here is the Array
  3. I’m loading the set of Screens here. Be aware, that the Screens you load will only be those in the current Stage. So our myScreens array will be used to store (as you navigate) all the screens in all the stages, to have only one big array when you have finished.
  4. I’m checking in my Array of Objects to see if the Screen we are on has ever been visited : is it in my Screens array?
  5. If it is in my Array, this is not the first time you have been on the Screen in question. We update the information about the Screen in the Object, calculating the elapsed time using a very rough and ready technique.

JavaScript Extension Custom Header as a Timer

Here is the rest of the script, which I have split out into a second part for readability.

  1. If the Screen is not in myScreens, then it is a new Screen. We add it and set up the basic information.
  2. We hook our myScreens array to the Interview object.

JavaScript Extension Custom Header as a Timer in Oracle Policy Modelling – Label

Over in the Label code, the process is very familiar:

JavaScript Extension Custom Header as a Timer 5

  1. Create a custom DIV on the final Screen using the Custom Property “name” to make sure we only execute on the label we are interested in. Get a reference to our myScreens array.
  2. Spawn a jsGrid from the DIV (which implies of course that jQuery and jsGrid files are in the /resources folder of your Project).
  3. Build the field object, noting that you can format the fields, or add / remove fields as you see fit from your array of Objects.

So if all goes according to plan you might get something like this. Note that the whole thing only works if you navigate normally Рthat is to say you navigate using the navigation Buttons or stage Buttons. Using the Debugger tree on the left does not have the same effect at the array will be empty. The array will also be empty if you do not reset between each debugging session. Once deployed, there should be none of those issues of course, or you could Ctrl+F5 to debug in Chrome or your favorite browser.

OPA 12 - JavaScript Extension Custom Header as a Timer in Oracle Policy Modelling 6

This being a bit of an experiment, I didn’t go much beyond 5 screens in 4 different stages, nor did I add any events to time the Stages, or to time Controls¬† – such as “on Focus” and “on Blur” which I thought about doing to be able to get the times in and out of individual controls and which I might do at some point.

JavaScript Extension Custom Header as a Timer – Conclusion

Anyway I hope the ideas, if not the implementation, have given you some pause for thought – namely how to get the Screens and Stages and load them into your own Array, and pass them to other Controls. The experimental code is on the OPA Hub Shop, search for customHeader.

Have a nice day!

Custom Year Picker JavaScript Extension Example

Custom Year Picker JavaScript Extension Example

Continuing in our random series of examples of using the Oracle Policy Automation JavaScript Control Extension API, this one came up the other day. How to allow the user to only enter a year in a calendar? The data type underneath fully expects there to be a day, month and year to complete the picture, but suppose you are entering an attribute such as “Year of Registration” and the business rule states that the product is always registered as of January 1st of that year. We can call it a¬†Custom Year Picker JavaScript Extension.

Of course as always there are many ways to achieve this, and JavaScript is definitely not the only solution. As good citizens of the Oracle Policy Automation world, we should always try and reach our goals without resorting to scripting unless it is completely necessary. Since this is supposed to be an article about the technique rather than the business requirement, let’s push on and find out how you might do it.

Firstly, there are a couple of pre-requisites. This example uses jQuery, and jQuery UI plugin called, unsurprisingly perhaps given the topic, Year-Select. I am sure there are a multitude of different plugins or tools to do this. Year-Select has the advantage of being super small and easily styleable. In addition it requires minimal coding to get it to work. Two good reasons to use it for this example. Download the file and place it in your folder. Add the jQuery files that you can download from the official site.

Now your resources folder will probably look like this : note the three external files (two from jQuery and “yearpicker.js” for the Year Picker) and your own custom JavaScript file that you are about to create “datepicker.js”. For this example, you should also create the following

  1. A Word document with a global goal that relates to couple of date attributes
  2. The two date attributes just mentioned that you should also create. Give them names as well.
  3. A label which displays these pieces of information.
  4. A date control on the Screen with a custom Property called name, value “xDate” or anything else you might like to use instead. This is similar to the other examples already described on this site.

Here are the images to help you work all that out. First the screen, with the Date control and the two attributes in the label:

Custom Year Picker JavaScript Extension Example

And secondly, the actual content of the Word document. You will notice that I am just trying to usefully have two attributes, one which is the session timestamp (which we can use when the Interview starts up, to default the Year Picker to the current year, for example) and the second attribute is going to store the selected value chosen by the user.

For the avoidance of doubt, in this Custom Year Picker JavaScript Extension Example, dt_sess is the name given to the date of the session and dt_circ is the name given to the date of registration.

On to the JavaScript code. As usual this will take the form of several different sections. In the first mount section we will

  • Create an Input control, which is the basis of our Year Picker
  • Get the Session Timestamp
  • Convert it to a Date object
  • Extract the Year
  • Apply the magic CSS class and call the yearselect.js code to intialise the jQuery UI widget

Custom Year Picker JavaScript Extension Example

  • If the date of registration has no value, then set the value to the year of the Session Timestamp, January 1st (since this was the requirement)
  • If the date of registration already has a value – because someone has already edited the year in this Interview session, then get that value and apply it to the Year Selector

Custom Year Picker JavaScript Extension Example

That’s quite a lot going on there. Most of the code is actually spent getting the actual date from the attribute and converting it into something JavaScript believes is actually a Date. Then looking to see if the date is already set, and updating the picker control.

As usual the code is absolutely filled with console logging, and the code is willfully non-optimized in order to make it as easy to read as possible for someone who just wants to know what it does. The final parts of the code handles if the user decides to update the year with the picker, and the usual unmount clears the element from the DOM.

Custom Year Picker JavaScript Extension Example

Now, in your debug session if you have added a new Screen, you can flick back and forth between the End Screen and your New Screen to observe the changes. Your new Custom Year Picker JavaScript Extension should be up and running like the following screenshot.

Custom Year Picker JavaScript Extension Example

The OPA Hub Shop РDownload the Script for Custom Year Picker JavaScript Extension Example

And now for some good news (I got a lot of requests for this!). The code example, and all the other code examples, are free to download in the OPA Hub Website Shop as PDF files.

Remember if you have any ideas for examples, or you want to contribute your own, just leave a comment below!

Oracle Policy Automation – JavaScript Custom Options

Oracle Policy Automation – JavaScript Custom Options

Following on from the occasional series of posts that has dealt with  Oracle Policy Automation JavaScript Custom Labels and Oracle Policy Automation JavaScript Custom Search extensions, this short post is going to demonstrate how to use the custom Options extension to build an Oracle Policy Automation РJavaScript Custom Options example. The scenario is very simple, and can mostly be achieved using non-JavaScript functionality but the goal is to showcase the capability. You will need to imagine your own business requirement.

Let’s get started. In a simple Oracle Policy Automation Project I have three attributes : the Country, the Town and the Town Level. In each Country, there are a certain number of Towns. These can be considered as a dynamic list for the purposes of our demonstration. They will be stored in an Array of Objects. They could, naturally, be obtained from a REST call to some service or other, much like the example of Search Extension. For our purposes we will have only four towns per country. Each town has a level, which corresponds to its population size.

When the user selects a Country and Town Level, we will display in a Custom Options list, the Towns that have the same Town Level or higher. So if you choose level three, we would like to see towns of levels one, two and three. If we choose level two, we would like to see levels one and two in our Oracle Policy Automation – JavaScript Custom Options list. We wish to display them as radio buttons.

Oracle Policy Automation – JavaScript Custom Options Example

How can we achieve this goal:  here is the example in more detail.

The User Interface is prepared according to the following screenshots:

Oracle Policy Automation - JavaScript Custom Options - Setup CountryThe above shows the first Screen.

Oracle Policy Automation - JavaScript Custom Options - Setup Options Extension

The second Screen displays the future dynamic Options. Note how it is a simple Textbox.

Oracle Policy Automation - JavaScript Custom Options - Code Introduction

In the above image, the basic setup is performed. Values of the Country and Town Level are acquired. An empty Array of towns is created.

Oracle Policy Automation - JavaScript Custom Options - Code Array Creation

The second part of the code is too long to reproduce here, but the above image will give you the idea. According to the Country, the array of Town objects is built. Note the text and value properties which are required, and I have added a level property. I have also, of course, created an alternative set of towns for Ireland (but I won’t show it to save space). Now I will filter the array based on the town level chosen:

Oracle Policy Automation - JavaScript Custom Options - Code Return Array Filtered

In this final screenshot, you can see the filter is based on the level and the filtered array is passed out. In addition I have specified the display as radio buttons.

Oracle Policy Automation – JavaScript Custom Options Result

Executing the code in the Project we can see the following when we select the country as Ireland, and the town level as 2, for example:

Oracle Policy Automation - JavaScript Custom Options - Result Example One

In the same vein, when France is chosen, and town level 1, this is the result:

Oracle Policy Automation - JavaScript Custom Options - Result Example Two

Have a nice day! If you would like a copy of the example code and Oracle Policy Automation – JavaScript Custom Options Project, just leave a comment to that effect. As always the official documentation can be found on the Oracle website.

The OPA Assess Method in Oracle Policy Automation Determinations #2

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.

The OPA Assess Method in Oracle Policy Automation Determinations #1

The OPA Assess Method in Oracle Policy Automation Determinations #1

In this short series we are going to walk through using your Oracle Policy Automation Hub, which you have set up perhaps using our step-by-step guide, to create and execute a Web Service call using the OPA Assess method. This will require you to have the following ready to hand

  1. SOAP UI for testing purposes
  2. An Oracle Policy Automation Hub in your self-study environment
  3. Word and Excel
  4. The correct version of the Oracle Policy Modelling application for your Oracle Policy Automation Hub

Let’s get started:

For the purposes of this example, I created a simple Project that uses the following attributes. The details are not really important, but here is the rundown and the explanation.

  1. An entity named “the horse” and another called “the jockey”
  2. A relationship of type 1:1 between the horse and the jockey whose text is “the horse’s jockey”
  3. An attribute called “the jockey’s number” in addition to the default identifier attribute “jockey” which is automatically created
  4. An attribute called “the horse’s status”
  5. A Global attribute called “the date of the race”
  6. Make sure “all the instances of the horse” and “all the instances of the jockey” are changed to “the horses” and “the jockeys”
  7. Make sure that all attributes, entities and relationships have¬†names specified. In my case for the relationships I used contracted versions of the actual text, such as “thehorsesjockey” and “thehorses” and “thejockeys”. You can use whatever you would like.

The following “rules” were added. In Excel, the horses are instantiated. The logic is puerile and not important.

OPA Assess Method

Then a couple of extra goals are set up in a Word document.

OPA Assess Method - Word RulesThe main reason for having this silly structure is to be able to demonstrate handling the following :

  1. Passing Global attributes and Entity attributes in the Request
  2. Returning Inferred Instances in the Response as well as other goals

Now you can upload your version to the Repository and Deploy the Project. Once deployed, log in to the Oracle Policy Automation Hub and make the following changes for the Project in question, in the Deployments section: change the available access methods:

OPA Assess Method Setup

This ensures that for testing purposes, your Project is only available through Determinations API.

Verify that in the Permissions section, the username and password is required for Determinations API calls.

OPA Assess Method Permissions

Next, ensure that the user that you intend to use for the Web Service access, has the Determinations API access as part of their permissions:

OPA Assess Method

Finally, click the Web Service URL in the Deployment details for your Project and save the resulting file to a suitable location, ready for use in SOAP UI. This takes a couple of steps.

You will have to enter your username and password. If you are unable to proceed past this point, check that your user has the permissions shown in the previous screenshot. Now download the most recent (in terms of version) Web Service definition by clicking the link shown. This is the file that you need in SOAP UI.

Open Soap UI and create a New SOAP Project for the OPA Assess Method. The dialog box for the New Project will look a little like this. The items marked are as follows:

  1. The file you just saved
  2. A name you want to give to this series of tests

OPA Assess Method Soap UI Setup

Once the Web Service definition has been imported you should be looking at something like this, in the SOAP UI window:

OPA Assess Method

Well done on getting this far, you are now ready to test and investigate your Web Service. In part two, you will configure both of the available methods (Assess and ListGoals) in order to complete your work. Onward to part two!

Oracle Policy Automation Training – Toronto 25th September

Oracle Policy Automation Training – Toronto 25th September

We are seeking attendees for this training in Toronto Downtown in the week of 25th September 2017. The following training  courses are planned to run on those dates:

Introduction to Oracle Policy Automation (1 day – Monday 25 September)

“This¬†Oracle Policy Automation¬†training introduces you to the skills and tools for capturing, analyzing, publishing and maintaining business policies and regulations. … It is highly recommended for anyone working with¬†Policy Automation, or collaborating with a¬†Policy Automation¬†project team.” (from the Oracle University website). This training is ideal for anyone using Oracle Service Cloud (RightNow), or Oracle Siebel CRM, and who plans to work with Oracle Policy Automation. It gives a great overview of the capabilities and out-of-the-box functionality, making is suitable also for managers and key users who plan to be involved in the project. I am happy to answer any question about Oracle Policy Automation Cloud Service, or On-Premise version.

Oracle Policy Modelling for Policy Experts (3 days – starts Tuesday 26 September)

This Oracle Policy Modelling course is suitable for a wide variety of profiles who will be actively involved in writing and designing rules in Oracle Policy Automation. “This course provides many hands-on exercises with Oracle’s leading policy automation and modeling product. It is highly recommended for anyone working with Policy Modeling, or collaborating with a Policy Automation project team. All team members that complete the course will understand the key concepts and terminology for Policy Automation projects. The course is aimed at a non-technical audience” (from the Oracle University website). Again, this course is suitable for people on stand-alone projects, Oracle Service Cloud (RightNow) projects or Oracle Siebel CRM projects.

We are only 2 people short of a confirmed course, and I would very much hope that the community can pass this message on and hopefully we can make it happen. If you are interested in enroling in this official Oracle University sanctioned event (held at an Oracle Partner training centre), please contact Patrice Brown on the numbers on this page.

Veuillez nous contacter directement si vous êtes intéressé par cette formation en français.

Oracle Policy Automation 10 and 12 Differences in Architecture

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.

Siebel and Oracle Policy Automation May 2017 – In (em)bed together

Siebel and Oracle Policy Automation  12 May 2017 РIn (em)bed together

Siebel and Oracle Policy Automation 12 May 2017 : Since the release of Oracle Policy Automation May 2017 edition, teams of Siebel developers are breathing a sigh of relief. Finally, Oracle Policy Automation can fully integrate into the Siebel Open UI JavaScript API thanks to the arrival of it’s own Extension API.

It does not take long to compare the advantages of this Siebel and Oracle Policy Automation integration method :

  1. No longer having to use the static HTML file-based integration that was proposed in Siebel Innovation Pack 15.5 and above. This means that all the native Oracle Policy Modeling components (sliders, image controls, explanations, Form downloads just to name a few) can be displayed in Siebel Applets or any other element you can imagine in the Siebel Open UI object model (I’m thinking Plugin Wrappers and so on)
  2. Allowing the Oracle Policy Modeling users to concentrate on optimizing the experience and the Siebel Developers to concentrate on delivering the data model to Oracle Policy Modeling. Separation of concerns
  3. Avoiding IFRAME. Always a good thing.
  4. Implementing different Physical Renderers depending on user situation – perhaps to display the Oracle Policy Automation Interview in a jQuery Dialog if the screen is big enough, otherwise using the full Siebel Applet
  5. Potentially creating a Presentation Model with User Properties to allow Siebel Developers to pass properties into the JavaScript API which then can be used to implement some logic on the middle layer – perhaps passing the Rulebase name into a generic Applet.

It doesn’t really matter if you are not a Siebel person, this opens up a lot of great possibilities. Here are some of the basic steps

    1. Find a Form Applet in Siebel that you want to show an Interview from Oracle Policy Automation in. Using Duncan Ford’s template generator, create an empty Physical Renderer for a Form Applet. This is the starting point for any integration using¬†Siebel and Oracle Policy Automation 12 May 2017 Extension API.
    2. Populate the ShowUI Framework hook with your code to inject the Oracle Policy Automation interview into an available <SPAN> or just make space for yourself. You will want to write much tidier code than this example, but you can get the idea – select, inject.

Siebel and Oracle Policy Automation 12 May 2017 - ShowUI

    1. Add the new Physical Renderer to the Manifest, along with any other files that you downloaded (if you are referencing statics copies of the interviews.js and the CSS files for example)
    2. Restart Siebel and navigate to the View with your Applet in it.

Siebel and Oracle Policy Automation 12 May 2017 Embedded

No IFRAME, no HTML files. Just the magic of the new Extension API. It’s breathed new life into¬†Siebel and Oracle Policy Automation.