Category: May 2017

Signature Control Oracle Policy Automation JavaScript Extensions

Signature Control Oracle Policy Automation JavaScript Extensions

Here at the OPA Hub we have already gotten back into gear after the holidays and in fact next week we will be off to Finland for some exciting OPA-related things but in the meantime, here are some thoughts about the Signature Control. Actually it is not just about the Signature Control. Rather, in this post, we want to look at some ways of extending the unextendable. If you check out the documentation regarding the Oracle Policy Automation JavaScript Interview Extensions, the Signature Control is not in the list (except for the styling possibilities- there are no extension capabilities). So what if you need to change it’s behaviour? Can we invent Signature Control Oracle Policy Automation JavaScript Extensions?

Of course I can hear you say that the likelihood of wanting to use the Signature Control Oracle Policy Automation JavaScript Extensions is small : after all we should never be using the JavaScript extensions to do anything too crazy (remember the guidelines at the bottom of this page). What on earth would people want to change for the Signature Control – or indeed for any Control that is not currently listed as having that capability?

Well, here is a simple example :

Signature Control Oracle Policy Automation JavaScript Extensions

The Signature Control is not responsive. Of course I could tell my phone and tablet users to zoom in or out, or switch orientation. But I don’t want to. Look, I’m just trying to make a point. Customers will always come up with things that we might not expect, and the Signature Control will be no exception.

The width of the control is fixed, by the parameter entered at Design Time :

Signature Control Oracle Policy Automation JavaScript Extensions

Since we cannot extend the behaviour of the Signature, maybe we need another approach. Let’s look at some useful things we came across while researching this article.

  1. The most obvious way to extend the Signature Control is to add a blank Control to the Interview that can be extended, and leverage the keys (mount, unmount and so on) of that Control to work on the Signature. In the case shown below, a blank Container has been added to the Interview for that purpose. It has a custom property to help identify it in the JavaScript later, like most of the examples shown on this site and elsewhere.

Signature Control Oracle Policy Automation JavaScript Extensions

2. Secondly, We should be aware that the value set at Design Time for the Signature Control width (and a lot of other useful information about your Interview) can be referenced in JavaScript :

var currentWidth = interview._session.config.interviewProperties["signature-width"];

This might be useful for some sort of fallback or default value.

3. Thirdly we should be good citizens and not forget that the styling options in Oracle Policy Automation do give us a fairly broad range of options without resorting to JavaScript code. For example:

Signature Control Oracle Policy Automation JavaScript Extensions

In the above example, we use the styling capabilities of the Signature Control to change the ink colour, and we apply a CSS style to the Control as a whole. With that in mind, we can leverage media queries in the CSS to establish different sizes of display for different users:

In the example CSS below, the outline (the border) of the Signature can be changed depending on the size of the viewport / screen that the user is holding. Smaller viewports will use a one pixel border, larger ones will use 2 pixel. It’s a simple example.

4. The Signature Control might only need extending during the mount or unmount process – which makes a Container Control a good choice. For the update we will simply leave that blank since there is nothing on the Signature Control we want to work with.

The client didn’t like that funny dotted line you get when you need to sign the signature panel. Using our newly added Class, we can select the siblings of the Signature and remove the line:

var myDiv = $('.eca-signature');
var myLine = $("canvas.eca-signature").siblings();

Signature Control Oracle Policy Automation JavaScript Extensions

5.  We might also use jQuery to add a resize handler to the Interview window, and based on that we could resize the Signature to a certain degree. We can also trigger the resize handler when the window is first shown, to make sure our Signature Control is always presented in the right size. And that opens up a world of opportunities.

So what does all this give us? The following video shows some of the results. This is just a scratchpad idea – so as usual the example is given with no warranties. You can get the example code from the OPA Hub Shop by searching the code examples for Signature Control.

Signature Control Oracle Policy Automation JavaScript Extensions – Summary

It’s a work in progress, but piggybacking on top of an extendable Control like the Container (which is also pretty much invisible, which is a bonus) let’s us imagine all sorts of trickery on the Signature Control. Plus, as good citizens we have learned along the way of some interesting standard styling and customization.

In the example code there are, as usual, a number of console logs as well as some experimental code that probably does nothing : as I always say, this is for educational purposes!

Oracle Policy Automation May 2017 – New Features #5

Oracle Policy Automation May 2017 – New Features #5

In every release of Oracle Policy Automation there are stand-out features. Already in this series about Oracle Policy Automation May 2017 we have seen so many great features :-

  • PDF Templates for Forms
  • Dynamic List Values
  • Styling via The JavaScript Extension API
  • Control Extensions via The JavaScript Extension API

For this, the fifth post in the series about Oracle Policy Automation May 2017 we have definitely arrived at a major, triumphant upgrade in functionality. Finally we are able to embed our interviews without the use of the hated IFRAME tag. For too long we have been stymied by the use of an outdated, unresponsive and frankly quite horrible tag to get our great interviews into existing website content. The JavaScript extension that we looked at in videos three and four in this series once again comes into play, and using a simple technique redolent of jQuery we embed the interview in a DIV tag.

To accompany this new feature we also have two pieces of required infrastructure : firstly the style sheets and JavaScript files to support the embedding, and secondly the new administration feature in the Oracle Policy Automation Hub, whereby we can add the required external sites to our “Authorized” list, thereby removing Cross Origin scripting issues from the browser and ensuring the functionality works smoothly.

Oracle Policy Automation May 2017- CORS

In the video that accompanies this article, you will discover the basic structure of an example HTML file, observe live debugging and updating of the “Authorized” list and lastly you can watch my jubilation as the interview kicks off in my embedded DIV without a single IFRAME in site. I look forward to helping my clients move away from the various hacks and other cosmetic touches to hide an IFRAME to a more modern, JavaScript extension-based approach.

For more videos you can check out our Video Gallery. The other posts in this series concerning Oracle Policy Automation May 2017  are parts 1, 2, 3 and 4.

Oracle Policy Automation May 2017 – New Features #3

Oracle Policy Automation May 2017 – New Features #3

Following on from the previous post, in this third video about the Oracle Policy Automation May 2017 New Features, we look briefly at the second capability of the JavaScript extension API. Yesterday I looked at custom styling, and today we look at custom rendering. Providing a more robust and upgrade-proof framework for customized interview experiences, it can be used to modify the behavior of labels, input boxes and other controls as well as major elements like the header or the navigation elements of the interview. There are a few examples of the new API in the Example Projects, but I found that they did not really explain to a neophyte how this works!

The API provides for several event handlers, to manage the life cycle of the DOM and your custom control renderer. In addition there are a raft of interesting Methods available to get property values such as the current value of the control, or the control type and so forth.

Oracle Policy Automation May 2017

The format of the JavaScript file will have a structure very similar to the previous example, essentially a JavaScript Object using a familiar notation. In future videos we will investigate further controls but in this first demonstration of the Oracle Policy Automation May 2017 New Features we will produce a custom renderer for the Labels in our interview.

In the example, we will use three of the four handlers available, and demonstrate how the API provides enough information to enable us to quickly add our rendering engine to the Interview.

You can find the YouTube Playlist for these videos here. The next post in this Oracle Policy Automation May 2017 series will look at the return of dynamic values in lists, as well as the (most welcome) capability to embed interviews in something other than an IFRAME. See you soon for more!

Oracle Policy Automation May 2017 – New Features #2

Oracle Policy Automation May 2017 – New Features #2

Following on from the first article in this series, which dealt with the new features in respect of PDF Forms and using PDF as the basic template instead of an RTF File for use with Oracle BI Publisher, this second video from the Oracle Policy Automation May 2017 – New Features series looks at the enhancements around JavaScript.

To be more specific, this video looks at the use of JavaScript to handle styling of interviews or controls on screens. Unlike previous iterations, this new version manages the process in a much more robust and upgrade-friendly way. Gone are the jumble of JavaScript files, to be replaced by JavaScript Extensions of the Oracle Policy Automation space. You will be using JavaScript objects to define the styling attributes of your controls or interviews.

There are a couple of pitfalls along the way which I draw attention to – not necessarily bad things, just points to be aware of when you begin using this styling technique. In a later video I will look at using the same Extension concept to move beyond styling into actual customizing of controls with handlers and so forth. The official documentation regarding Styling Extensions can be found online, at this address at time of writing.

Oracle Policy Automation May 2017 JavaScript Extensions

I’m very pleased to see the return of this functionality, in a much improved, more industrial grade framework. Until the next article, enjoy the video and Oracle Policy Automation May 2017 New Features Part Two.

In the next articles we will look at JavaScript Extensions again, and then the new features around dynamic values in selection lists (back to the future again!). Until then, have fun!

Oracle Policy Automation May 2017 – New Features #1

Oracle Policy Automation May 2017 – New Features #1

As you may have noticed the latest version of Oracle Policy Automation has hit the virtual shelves. And so, in the fine tradition of the OPA Hub Website, we are going to be reviewing some of these new features.

The first subject is an easy one – the ability to add and work with PDF files as Forms, as well as the traditional RTF files. The workflow is exactly the same – create attributes, give them public names, write rules, then bind explanations to the Form in the Project Tab, Form Pane before opening the Form in your chosen Editor – Word for BI Publisher Desktop, or any PDF Form editor. Clearly Acrobat Reader will not do the job.

The new possibility is accompanied by a new PDF Form Assistant, that looks a little like the screenshot you can see here – notice the ability to select Fields or Explanations, Repeating Fields and so forth to add to the PDF document you are building.

OPA - PDF Form Assistant

For those of you that prefer to watch a walk-through video, we have that too. Just click on the video at the end of the post and see the OPA Hub Website running through a quick PDF Form creation with an example Project as a sort of mini OPA tutorial, with as a bonus some magic disappearing menu items. There will be more about Oracle Policy Automation May 2017 in the next few posts here on the OPA Hub Website.



Logo by Southpaw Projects LLC