Many of our readers will be familiar with the Example Projects (which include Travel Compensation) that are provided with the download of Oracle Policy Modeler. If you are not, they are accessible here:
If you are not familiar with them, we encourage you to dive right in and to find out about all the wonderful examples you can find in there. It is a great learning tool and a good way to discover potential use cases. One of the more famous ones is the Project related to the legislation relating to Travel Compensation by Airlines, in the European Union (EU261/2004), mentioned above.
This allows the traveler to receive a compensation amount when their flight is delayed or they are refused boarding (among various criteria) if the flight meets certain conditions (there are various exclusions for territories such as Gibraltar and so on).
The provided example Project has a number of key learning points :
- The project has multiple translation files
- The project is mapped to a RightNow Connection
- The project uses the CurrentLocale() functions introduced in 18C
- It uses a number of Excel tables to maintain static data.
- It links to various websites for example to calculate distances.
The existence of Translation files is a good chance for new started to discover how multiple interfaces are built inside Oracle Policy Automation 12, and the mapping to RightNow has two side effects (even if you do not have access to the RightNow instance specified in the Connection).
Firstly if you have never seen the RightNow-specific (as opposed to the generic Web Service Connection dialog) window, it can come as a bit of a shock. If you need a primer as to what the different icons mean, you can check out our series about Service Cloud (RightNow) and OPA. The second side effect is the long set of Value Lists that are drawn down from Service Cloud as part of the Connection (even if they are not being used here).
We mentioned the arrival of locale-detection functions in our What’s New post a few weeks ago. The two most interesting things, and the point of this post, is the fact that Excel is used to store static data (in the case below, airline names and countries)
and that some of the information to be entered is referenced using URLs : in the case below, the need to calculate a distance between two airports:
In the example Project, the focus is on a clear definition of the Policy and a demonstration of how to implement a good design pattern. But the end user experience suffers a bit – this is not a criticism, since it obviously was not the learning focus – because of the kind of data to be entered.
Take for example the first screen, where we enter our journey details : departure and arrival airports. Given that the airport information is extremely useful (namely, every airport has an ICAO code, and a latitude and longitude), we are going to use a custom Search to let the user find the airport and we will capture some extra information : the Country and the ICAO code. The Country is used later in the rules, and the ICAO code will come in very handy in a moment.
We’ve actually two versions. The first version uses a website called http://geonames.org : they have a variety of free (registration required) web services for searching for places including airports. It does not have ICAO codes but has a lot of other information. The second version uses a freemium web service from https://market.mashape.com/marcusgoede/great-circle-mapper/ which includes an airport search which additionally returns an ICAO code. Both of them return the Country.
A later page asks for the name of the Airline : again we decided to use a custom Search, from a website called https://aviation-edge.com which has a variety of web services including an Airline lookup which includes the operating country (which is referenced in the rules).
Finally, the legislation bases compensation in part on the kilometer distance of the flight. It must be calculated using the Great Circle method according to the law, this method takes into account the curvature of the earth. We returned to the freemium web service listed above to take advantage of the airport to airport Great Circle mapping Web Service, which also can return duration (based on a supplied average airspeed) and many other nuggets of information.
For the above example we use a custom Label (which is not displayed) which drops the calculation into the Input box so the user can adjust it if required (but our tests proved it to be very accurate indeed).
You can find them in the Online Store as usual, search for Travel Compensation. Don’t forget the official Oracle Policy Automation Developer Guide Interview Extensions Reference.
More on similar topics: