Welcome to the OPA Hub!


Category Archives: Version 12

Input REST Batch Requests into Debugger

Input REST Batch Requests into Debugger

One of the new features introduced in 19C is the ability to use REST batch sessions (or requests, to give them their real name) directly in the Debugger. This is a great leap forward. Up to now, where I am working at the moment, we had built a tool to translate the REST into XML but it was still less than optimal.

So you can imagine how excited I was when I saw this new feature arrive in the product. There is, however, one major issue that I still find very frustrating. You will understand perhaps if I show you an example. Let’s consider the following. I have a batch of 10000 REST Batch cases that have been used in our testing and saved in JSON format. Now I want to open one of these in my Debugger to investigate what is happening. I open the project in Oracle Policy Modeling and I rush to the Debugger.

REST Batch

The pop-up window shows that my JSON file has been loaded, and shows me…the case id. Which from a functional point of view, of course, tells me nothing at all. Most of the testers here would be unable to remember which case represents which testing scenario. What we would have loved (and we are going to ask for) is the possibility to choose what to display in that window. For example, in our case, maybe if we show the identifying attribute from one of the entities being used, that would be more than enough for us to be able to recognize which case it is.

This might not seem a big deal but when you have an operations department who simply sends you the file and says it does not work i(they don’t necessarily know anything about Oracle Policy Automation apart from how to run it) it can be frustrating working backwards from REST case numbers back to scenarios that we can relate to our Test Cases in Excel.

I’m going to be accused of mixing everything up but it would be nice to have something easier to recognize, or perhaps a parameter that we could change.

What’s new in Oracle Policy Automation 19C?

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.

Fun with Aliases and Strings #3

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.

Certification Workshop Example

Oracle Policy Automation Cloud 2019 Certification #2

Oracle Policy Automation Cloud 2019 Certification #2

I don’t normally comment on certification examinations – I don’t really feel that a website like this should focus on getting people certified – sure, we can help you prepare and give you lots of fun things to do while you get ready. But we are never going to be selling “certification dumps” or any nonsense like that. If you cannot prepare for an examination, you shouldn’t be taking it. End of story.

But, since I just took the Oracle Policy Automation Cloud 2019 Certification today, I thought I would give you some heads-up on the kinds of questions that I noticed (and bear in mind, that my memory is not what it used to be). Again, I’m not going to give you the questions, I’m going to give you some pointers as to the kind of question you might see.

Firstly, this is clearly an update of the 2017 Certification, so if you took it and passed, many of the question styles and content will be familiar to you. But the vast majority of them have undergone review, editing and minor changes.

Question Styles That Might Bug You

You need to do X. Place the following things (1-9) in order of doing them to achieve X. If a step is required more than once, only mark the first time the step is used.

The steps are unclear, the answers are unclear, and some of the terminology used is dubious.

You have an entity model X to achieve Y. What kind of relationship is Z?

Beware your terminology – get in your head that it’s asking for a relationship even if the example provided is not obvious.

Which of the following is a good example of the correct phrasing for X

Be very clear about what that question style is asking. Many of them look like they are asking Y but they want X. Re-read the question several times!

Choose four things that are true about X functionality

Some of the examples I saw were completely generic – you know the sort of thing. They ask you about swimming 100 meters, and one of the answers is “a swimming pool is full of water” whilst all the other answers are about breathing, swimming technique, strokes. Watch out for these “sleeping choices”.

Which of the following are incorrect when talking about AND and OR

These questions require a certain amount of time to consider – which ones have the correct combinations of AND, OR, ANY, ALL, BOTH, EITHER and all the other combinations of grouping words. Read it slowly!

Poor Quality Graphics

Aside from these bugbears, the other thing that still annoys me is the quality of the screenshots used. And of course, this is dependent on the software used for the certification examination, I know that. But at least try and give clear, large images without any silly stuff (like the Word examples that have clearly gotten the grammar and spelling check with the blue line underneath the text). It’s a question of quality.

Web Page Not up to date

One thing that bothers me is that the Certification page on the Oracle Website does not specify which version this examination has been validated against. And I saw at least 1 question for which the answer would have been different, depending on the version.

Good Luck!

Good luck to you all. If I have any more thoughts, I’ll let you know. And yes, I did pass :). If you are interested in accelerating your learning, read about our workshops here.

 

Fun with Aliases and Strings #2

Fun with Aliases and Strings #2

Returning to the ” Aliases and Strings”  theme of the previous post, where we looked into an example of String concatenation. Just a reminder, in the previous article you created the entity model and set up a couple of relationships, before using a rule to decide if the ticker tape instance is a member of a relationship called  the next ticker tapes.

So here is the continuation of the document you saw in the previous steps:

Aliases and Strings #2

The first part should look reasonably familiar, since it builds on the example with the next ticker tapes. But is uses the second relationship, called the closest ticker tape. Note the wording closest ticker tape not ticker tapes. We are aiming for the closest one, or if you prefer, the next one in line. So for ticker tape number 3, the closest would be number 4.

Dodgey Ticker

We again use an alias, but things get a bit sticky in the following parts. Where did the further ticker tape come from? Well, perhaps unsurprisingly, it’s another alias. You see, we already used the other ticker tape in the conclusion so we need to use another word : in this case further was my personal choice, but it could have been another word that meant something in this context. So by now we have the following, expressed in conversational style :

Compare ticker tape A (with other tapes, let’s say B, C and D). B,C or D will be called the closest ticker tape if the following is true.

  1. B,C or D have an ID that is higher than the ID for A
  2. Using the next ticker tapes as your starting point (so, B C and D)
  3. Compare them (so B compared to C, B compared to D etc) to this rule
  4. Is B’s ID is less than or equal to C (for example)?

So we end up with the ticker tape that is in the next ticker tapes AND has an ID that is less than or equal to the other next ticker tapes. So it is the closest one.

I’m reminded of this excellent conversation from Monty Python since it can get a bit confusing at first:

video

The final rule concerns whichever ticker tape has the longest string. And that string is what you are about to create, for each and every instance of your entity.

We’re coming with you!

You will generate a string of text for each of the entity instances (so, for each of the ticker tape instances). And this string will be the driver of a logical loop.

Firstly, let’s set your scene and remind of the context:

  1. “Text 1”
  2. “Text 2”
  3. “Text 3”

Each ticker tape has a text message, for example “Text 1” . This message should be concatenated with the other text messages to form a long “final” string. Each should have a comma inserted between them, into the final string, and of course a “.” at the end. Just to make a nice tidy “final” string. It might look like “Text 1, Text 2, Text 3.”.

Aliases and Strings #2

So each instance has a text string, and a “final text”. The “final text” will be the ticker tape text string concatenated with the closest ticker tape’s text string, plus a comma if required – for example if there are no “next ticker tapes” for a given tape, it’s because we have reached the end of the instances (number 4 , if there is no number 5).

The following attributes give us the numbers used in the table above:

Aliases and Strings #2

And the final (final) global attribute:

Final String Result

Aliases and Strings #2

In the next part of this series, there will be a chance to look back on the techniques, observe the warning message and generally investigate your logical loop.

Aliases and Strings part three will be with you in a few days, In the meantime of course you can read the online help here.

OPA Word Rules – Level Up!

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.

What's new in Oracle Policy Automation 19B

Whats New in Oracle Policy Automation 19B

Whats New in Oracle Policy Automation 19B

It’s here! The latest version of Oracle Policy Automation for Private Cloud is now available for download from edelivery software cloud (or whatever it is called now). Whats New in Oracle Policy Automation 19B?

Whats New in Oracle Policy Automation 19B

Here are some of the highlights of this version.

The New Value() Function

The new function makes it possible to retrieve the language dependent values of a Value List with ease. Consider the following Value List in 19B:

Whats New in Oracle Policy Automation 19B - Value()

And consider the following rules in a Word document:

What's new in Oracle Policy Automation 19B

The first line will return  the value, and the second line will return the text of the title. We can now return the actual value as well as the text, reliably.

New Deployment Functionality in REST

If you are a REST user in the administrative area, two new elements have been added to the deployment resources – locale and urlParameters. You can now get these in your REST calls.

More Extension Capabilities

If you are working in complex JavaScript extensions, then the following will be of use to you. Now you can retrieve more information about the underlying definition of the fullCustomInput Control extension:

  • getQuestionLayout()
  • getSideQuestionWidth()
  • getMultiLineTextRows()

All of these refer to Styles settings that the designer might have implemented on the original Control so that you can pick them up and work with them in your JavaScript code.

API Warnings

If you created a static metadata connection a long time ago, or built a connector which is long in the tooth, you will now see warnings to remind you to upgrade the connector or risk being caught out by a version which will no longer be supported.

Chat API New Features

The Chat API has moved swiftly since it’s inception just a few months ago. Now we have better input options for users who need to select something, we also have document (attachment) storage capability both in Oracle Service Cloud and other connections, and better access to Chat data.

New UI Language

To my friends in Budapest – the Hungarian UI for Oracle Policy Modeling and Oracle Policy Automation Hub has been released. No parser so far, but at least you can build a custom language and work in Hungarian menus!

Office Support

Office 2019 is now supported and certified.

Summary Whats New in Oracle Policy Automation 19B

What’s New in Oracle Policy Automation 19B – lots of things! Hopefully you (and I) will learn more about these in the Oracle Policy Automation Focus Groups around the world. See you there!

Importing Data into an Interview : Excel Example

Importing Data into an Interview : Excel Example

Readers will remember a while ago I explained briefly how to use Microsoft Excel to act as a Connection Datasource – in this overview article, followed by this one in a little more detail. Now we look at another challenge : Importing Data into an Interview.

Well, here comes another example of the ubiquitous nature of Microsoft Excel. The customer requirement was as follows:

Using a simple mechanism, let the user upload an existing Excel spreadsheet into the Interview. Parse the spreadsheet, read the data in it, create corresponding rows in an Entity. Let the user review the data but do not require any new data entry. There may be up to 250 rows of data to import. So how do you go about about Importing Data into an Interview?

So how can we face up to a challenge like that? We need:

  • An upload that isn’t a standard File Upload Group
  • A parsing mechanism to read Excel and extract the data in a given tab, or wherever
  • A custom Entity Collect to handle the data import / create the rows in a Screen

The shopping list above isn’t that long.

The File Upload is essentially an HTML 5 component to let the user select a file on their computer. We cannot access an arbitrary local path from JavaScript, so we need the user to point to the file they want to upload.

There are a number of JavaScript-based Excel parsers, including the excellent SheetJS js-xlsx which we used. It is capable of converting to and from Excel, which is no easy task when you consider that an Excel file is basically a Zip file with a bunch of complicated stuff inside it. The library can convert to HTML, CSV and magically (for our requirement) JSON. Awesome!

Plus, in a previous post we’ve also looked at the (large amount of) work required to build a Custom Entity Collect Extension. In fact when I was writing that article I was thinking, for goodness sake Richard, when do you think you will actually need to go to the trouble of building that Entity Collect Extension? Well, I’ve finally found a use for it – Importing Data into an Interview!

We need an Entity Collect Extension since we need some way of getting the Excel data into the Entity Collect, which ultimately means we need to do some work behind the scenes between the import of the data and the display of the Entity Collect. We need to rewire the Entity Collect temporarily so that it sucks our Excel data up, before we show it to the user so they can examine the results.

For the purposes of a raw demo, I unplugged all the other functionality (delete buttons, add buttons, etc.) and just concentrated on getting the data into the Entity Collect. There are how ever a few caveats. Once you get into the larger imports, at least in the Debugger, you can expect to see “concurrent record editing” errors. I’m trying to find out what the limit is exactly. But up to a few hundred I think it’s OK.

So let’s look at the items in turn.

File Upload and Data Load

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
31
32
33
34
35
36
37
38
39
40
41
{
					//console.log("Starting customInput Mount");
					var div = document.createElement("input");
					div.id = "myFile";
					div.type = "File";
					//div.value = control.getValue();
					el.appendChild(div);
 
					function handleFile(e) {
						var files = e.target.files,
						f = files[0];
						var reader = new FileReader();
						reader.onload = function (e) {
							var data = new Uint8Array(e.target.result);
							//console.log("In Change");
							var workbook = XLSX.read(data, {
									type: 'array'
								});
 
							worksheet = workbook.Sheets["YOURWORKSHEET"];
							jsonoutput = XLSX.utils.sheet_to_json(worksheet, {
						raw: true, header : 1
							});
						//console.log("Read " + jsonoutput );
						};
 
						reader.readAsArrayBuffer(f);	
						var completepath = $(':file').val();
							//console.log(completepath);
						interview.setInputValue("rest_filenameandpath", completepath);
					}
 
 
				var filedialog = document.getElementById("myFile");
					filedialog.addEventListener('change', handleFile, false);
 
					var completepath = $(':file').val();
						control.setValue(completepath);
						//console.log("Hello " + completepath);
						//console.log("Ending customInput Mount");
				}

Assuming you have a custom Input framework as your starting point, the above code will be in the mount. This will build an HTML5 file upload control, and attach an event handler. The code regarding Excel depends upon xlsx.full.min.js being in the resources directory. But that’s it. You’ve loaded the Excel file into a JSON object.

Entity Collect

The next step is to include a Custom Entity Collect in your project, and use the jsonoutput object (which you just created from the imported file above) in the mount of the Entity Collect to load the JSON into the Entity Collect. The following is an extract from the mount code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var numEntities = Object.size(jsonoutput);
					//console.log(numEntities);
					// Remove header row if the file has one
					jsonoutput.shift();
					// load records into the Entity Collect
 
					if (control.getRows() == 0) {
						for (j = 0; j < numEntities - 1; j++) {
							control.addNewRow();
							var mycurrentrecords = control.getRows();
							mycurrentrecords[j][0].setValue(jsonoutput[j][0]);
							mycurrentrecords[j][1].setValue(jsonoutput[j][1]);
							mycurrentrecords[j][2].setValue(jsonoutput[j][2]);
							mycurrentrecords[j][3].setValue(jsonoutput[j][3])
drawrows();

The end result is something like this:

Importing Data into an Interview

The File is loaded into the Entity Collect, and the contents displayed to the user. In my case I unhooked all the code related to modification (the onchange stuff from the original idea) and removed the add / delete buttons, since it was designed to just allow the user to see the loaded result, not modify it.

Importing Data into an Interview

If you want to have a look at the project, just download the very basic example here.

OPA Entity Model Viewer 1.0

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 OPA Basics : Oracle Policy Modeling Features

Back to OPA Basics : Oracle Policy Modeling Features

Welcome to another in our periodic back to OPA basics series. At the moment I am watching a lot of new starters join a set of experienced developers. And funnily enough, both groups sometimes are stuck in their routine. For the new people, they fall back on what they know from other rules engines. For the more experienced people, that are familiar with Oracle Policy Modeling, they repeat what they learned long ago and do not necessarily see anything that has been added to the application in the intervening time since they first started using it.

So here are my top five cool time savers and useful things you can find in Oracle Policy Modeling today.

  • The Rule Assistant

I still find it strange that many people don’t use the Assistant in Word. If there was ever a tool to avoid having to remember the arcane spelling and phraseology of an Oracle Policy Automation attribute, this is it!

Back to OPA Basics - Rule Assistant

  • The Convert to Test Case Export

Watching people filling in every cell in their Test Case spreadsheet, when they probably have already saved many of the initial scenarios as debug sessions, I think they should remember the fact that they can move a unit test into a Test Case, and vice-versa.

Back to OPA Basics - Export as Test Case

  • The Find Unused Attribute Filter

I tend to use this one when the Rule Assistant has not been used very much, so we are looking for duplicate / mispelled attributes in our Project (see Rule Assistant, above).

Back to OPA Basics - Unused Attributes

  • The Inclusion Report

OK, so I’m probably cheating as far as this one is concerned, but it is a real time saver. In 19A, the introduction of the Inclusion Report has saved me time already. Great for beginning an impact assessment when some sort of surgery is required on Project structure. Find out more here.

Back to OPA Basics - Inclusion Report

  • The Export Entity Data Model Option

This is a tiny little option hidden away in the toolbar but I’m often asked by non-OPA people for the data model and I find this export really simple and quick to use.

Tiny Button - Export Data Model

Well, that’s our top five for now. What other tricks do you use to get the most out of Oracle Policy Modeling?

Let us know in the comments!