Welcome to the OPA Hub!


Category Archives: Ecosystem

Stunning Infographics with Oracle Policy Automation and Easelly #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.

Stunning Infographics with Oracle Policy Automation and Easelly #2

Stunning Infographics with Oracle Policy Automation and Easelly #2

So, in this part of the series we will look at how to integrate Easelly with Oracle Policy Automation. For this integration demonstration we chose to use the older Custom Control concept. In today’s Oracle Policy Automation, most of the customization of the user experience is driven through the JavaScript Extensions – which we regularly demonstrate on this site. But there are situations where the Custom Control concept from pre-August 2016 versions is still a good choice. In this case, we need a Custom Label, with a link. But the link is to be displayed once the server-side has generated a PDF file. So it is a good choice. For the language, PHP is easy to use, has thousands of examples, and can handle both XML and JSON.

Let’s look at the code then walk through it step by step. The code is also in the shop, for free, because this code viewer does not do a very good job of handling all the characters in the file.

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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Copyright The OPA Hub Website 2019
// For entertainment and education purposes only
// Example step by step PHP Custom Control and integration with Easelly Infographic
// Requires Easelly API Key 
// Thanks to Johanna and Vernon at Easelly easel.ly
 
//Set up a few key variables
$url = "https://www.easel.ly/pages/generatePDF";
// This is your API Key
$api_key = "XXXXXXX";
// This is the URL of your base infographic in Easelly
$canvas_id = "https://XXXX/easel.ly/all_easels/XXX/XXX";
 
// OPA data is passed into the PHP file as a  urlencoded XML post header. Decode it
$myOPAData = $_POST["opa-session"];
$decodedOPA =  urldecode ($myOPAData);
 
// Now we can manipulate it as XML
$final = new SimpleXMLElement($decodedOPA);
 
// Get the XML Nodes that represent our OPA Attributes using XPath queries
 
$account_name = $final->xpath("//*[@id='account_name']");
$product_one_name = $final->xpath("//*[@id='product_one_name']");
$product_one_avail = $final->xpath("//*[@id='product_one_avail']");
$product_one_margin = $final->xpath("//*[@id='product_one_margin']");
$product_one_trans_lost = $final->xpath("//*[@id='product_one_trans_lost']");
 
// Get Text of each OPA Attribute 
 
$account_name  = strip_tags($account_name[0]->asXML());
// Some Product Names have & in them so convert the characters properly
$product_one_name  = htmlspecialchars_decode ((strip_tags($product_one_name[0]->asXML())));
$product_one_avail  = strip_tags($product_one_avail[0]->asXML()) . "%";
$product_one_margin  = strip_tags($product_one_margin[0]->asXML());
$product_one_trans_lost  = strip_tags($product_one_trans_lost[0]->asXML());
 
// Build Object Array for the Easelly REST API. Each object represents an Easelly tagged item, mapped to an OPA attribute.
 
$myJSONdata = new stdClass();
$myJSONdata->id = "https://s3.amazonaws.com/easel.ly/all_easels/706616/SwanFoodsExample";
$myJSONdata->objects = array();
 
$myobjectfinal = new stdClass();
$myobjectfinal->tag = "account_name";
$myobjectfinal->type = "textbox";
$myobjectfinal->text = $account_name;
$myobjectfinal->fill = "#f9d423";
 
array_push($myJSONdata->objects, $myobjectfinal);
 
$myobjectfinal = new stdClass();
$myobjectfinal->tag = "product_one_name";
$myobjectfinal->type = "textbox";
$myobjectfinal->text = $product_one_name;
$myobjectfinal->fill = "#6bb38e";
 
array_push($myJSONdata->objects, $myobjectfinal);
 
$myobjectfinal = new stdClass();
$myobjectfinal->tag = "product_one_avail";
$myobjectfinal->type = "textbox";
$myobjectfinal->text = $product_one_avail;
$myobjectfinal->fill = "#f9d423";
 
array_push($myJSONdata->objects, $myobjectfinal);
 
$myobjectfinal = new stdClass();
$myobjectfinal->tag = "product_one_margin";
$myobjectfinal->type = "textbox";
$myobjectfinal->text = $product_one_margin;
$myobjectfinal->fill = "#ffffff";
 
array_push($myJSONdata->objects, $myobjectfinal);
 
$myobjectfinal = new stdClass();
$myobjectfinal->tag = "product_one_trans_lost";
$myobjectfinal->type = "textbox";
$myobjectfinal->text = $product_one_trans_lost;
$myobjectfinal->fill = "#ffffff";
 
array_push($myJSONdata->objects, $myobjectfinal);
 
// Convert the Object to JSON
 
$myJSONdataobject = json_encode($myJSONdata);
 
//Call Easelly with our JSON Object and Get Response
 
$context = stream_context_create(array(
			'http' => array(
				'method' => 'POST',
				'header' => "apiKey: {$api_key}\r\n".
				"Content-Type: application/json\r\n",
				"Accept' : application/json\r\n",
				'content' => $myJSONdataobject)));
$response = file_get_contents($url, FALSE, $context);
 
// Check Output
 
if ($response === FALSE) {
	echo("\r\n");
	die('An Error Occurred');
}
// Use a timestamp as the filename
$time = time();
$fileoutputname = $time . ".pdf";
file_put_contents($fileoutputname , $response);
 
// Show the Link to the User for clicking to access the generated file
?>
<a target="_blank" href="https://theopahub.com/main/external/<?php echo $fileoutputname ?>"
>Click Here</a>

Walk Through

The code has been broken down into it’s constituent parts – for learning purposes. Of course there are many areas that would be rewritten in a professional example, but this will help non-coders understand what is going on.

  • 1-15, Set up some basic stuff like the URL to your infographic. In the final part of this series, I’ll show you how to build a graphic and tag it correctly with the OPA attribute.
  • 17-25 The Oracle Policy Automation Custom Control integration passes the session data (your attributes and their values) into the PHP page as a series of XML nodes. So we need to get that XML and make sure we can read the parts we are interested in.
  • 29-25 We strip the attribute values out of the XML, and in one case, because the OPA attributes contain special characters like “&” we make sure they display properly.
  • 38-80 Overly simplified for the purposes of demonstration, we build a JSON object using standard objects and arrays, to create the JSON structure that Easelly is looking for. In the next part of this series I will show you where to get it.
  • 84 Convert the Object into a JSON Object
  • 88-106 Call Easelly with our API Key and JSON Object
  • 107 – End Process the output and draw the link for the user

Summary

Oracle Policy Automation and Easelly

So you can see the integration is fairly simple in this case – the PDF is generated before the user reaches the link, so the link should respond straight away. And we chose PDF but Easelly also can generate PNG for example, if you wanted to embed it directly as an image.

In the third part of this series, we will show you how to get Easelly to tag your infographic so you can use it in an Oracle Policy Automation integration.

Stunning Infographics with Oracle Policy Automation and Easelly #1

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.

Guest Post : Time Based Reasoning Worked Example

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.

Guest Post : Object-Oriented Design Patterns and Oracle Policy Automation #2

Guest Post : Object-Oriented Design Patterns and Oracle Policy Automation #2

In a previous post by our guest writer Dr Jason Sender, he investigated improvements in Oracle Policy Automation rules by applying some of the principles of refactoring, and then he began to discuss Object-Oriented Design Patterns and Oracle Policy Automation, and their application in real-world contexts.

As before, this third article draws on the work and publications of Martin Fowler, which we discussed in the previous post, those of Joshua Kerievsky from his highly regarded book “Refactoring to Patterns”, and the ground-breaking work on design patterns called “Design Patterns: Elements of Reusable Object-Oriented Software”, which had four authors known collectively as the Gang of Four (GoF).

Before studying some further examples of patterns and their application to Oracle Policy Automation, it is probably wise to step back and take a broad view of the context. Computer science is often defined as dealing in abstraction, and software engineering as managing complexity, and the connection is that only by considering different parts of programs and systems as abstract concepts are we better able to manage complexity.

Object-Oriented Design Patterns and Oracle Policy Automation in Context

To put it in terms more related to our daily jobs, Oracle Policy Automation is often integrated with other systems that the Oracle Policy Automation developer does not need to understand, and can think of in abstract terms. A good example would be the Siebel CRM or Oracle Service Cloud database that Oracle Policy Automation may interact with, but about which the Oracle Policy Automation developer may not need to know anything – beyond understanding the available attributes for mapping and having a brief overview of the context. Abstraction is about ignoring irrelevant details, and this is often accomplished by what is a theme running through many design patterns, which is to: “encapsulate the concept that varies” (GoF, p. 54).

We often obtain abstraction in Oracle Policy Automation by using indirection (interposing an intermediate attribute) to encapsulate the attribute that varies. This allows us to “Program to an interface, not an implementation“, as the GoF (p. 18) term it, the rationale for which is that the implementation can be changed if other parts of the program only depend on the interface.

If you come, like some of us here on the OPA Hub Website, from a CRM background, you will be familiar with the concept whereby access to a CRM Object is provided through an interface, and the interface does not change even if the Object undergoes modifications (such as when using the GetMetadata Operation of the Oracle Policy Automation Connector Framework).

Although design patterns and refactoring techniques should serve the goals of reduced duplication, reduced complexity, and increased clarity, these goals can be in conflict, not just with each other, but with certain Oracle Policy Automation-specific goals. Take for example one of the stand-out benefits of Oracle Policy Automation: Policy Isomorphism. This means having the same form (i.e., you can copy and paste legislation or other source material directly into Microsoft Word, and base your rules on this and compare them side-by-side) and this is in tension with the concept of intermediate attributes (adding more attributes to increase clarity).

Object-Oriented Design Patterns and Oracle Policy Automation : Strategy and Template Patterns

With that in mind we return to another example of how Object-Oriented Design patterns can be applied to Oracle Policy Automation. The following extended example will be given to demonstrate how useful the Strategy and Template Method design patterns (which we adapt from the GoF book) could be in reducing the number of tables and increasing the flexibility of calculations. We show this extended example to demonstrate the size of the reduction in rules from applying these design patterns to Oracle Policy Automation. We start with an information collection screen and associated Boolean rules to derive values from the drop down list items:

Object-Oriented Design Patterns and Oracle Policy Automation 1

We then look at the top level goals for determining the total profit of the company, which is our main goal:

Object-Oriented Design Patterns and Oracle Policy Automation

These are then derived from three very similar tables of calculations, which are listed in succession below:

Object-Oriented Design Patterns and Oracle Policy Automation 3

Object-Oriented Design Patterns and Oracle Policy Automation 4

Object-Oriented Design Patterns and Oracle Policy Automation 5

Object-Oriented Design Patterns and Oracle Policy Automation : Implementing the Design Pattern

We can now alter this to implement our design pattern. We first create a main rule to determine the total profit:

Object-Oriented Design Patterns and Oracle Policy Automation 6

This is the Template Method pattern since it delegates a part of the algorithm – the tax factor, a newly created attribute. Then, we employ the Strategy pattern to effectively split up the tax factor into one of three algorithms (in effect, we are treating the tax factor as an algorithm and then applying Strategy to it). We do this by parameterising, based on type of company, using a feature called Apply Sheet that avoids multiply proven attributes by letting the parameter determine which Excel Worksheet applies:

Object-Oriented Design Patterns and Oracle Policy Automation 7

Then each of the subsequent tabs has a small table. As an example, here is the mining sheet. The others have identical structure and adjusted values for the tax factor.

For the Strategy and Template Method patterns, applying these design patterns has transformed our example rulebase into something much more easily extensible.

Object-Oriented Design Patterns and Oracle Policy Automation : Improved Maintenance and Clarity

If we were to create another sector (e.g., oil), it would be very easy to add on another sheet in the Excel Workbook and add it to the Apply Sheet. In fact, we could easily add another 20 sectors, whereas there would be a lot of time-consuming ‘find and replace’ work to do in the original, and we would have ended up with dozens of pages of rules. Moreover, the original algorithm had a lot of code duplication, as the same Boolean attributes were repeated in row after row in table after table.

Furthermore, if we had needed to add or remove conditions from the tables it would have taken extensive work in order to verify that each and every table was updated correctly. In the reformed algorithm, the conditions were written only once and these are easily changeable. And, we were able to eliminate three (possibly confusing) and unnecessary sub-totals relating to each of the company types. The unvarying part of the algorithm (the total revenue – the total cost) is now written once, rather than 15 times, and so it is easily changeable.

Finally, our new algorithm mentions only the tax factor. This means that if all tax rates were harmonised, a single tax rate declared, or a new formula implemented that did not depend on the company type, since we have encapsulated the part of the algorithm that varies, we could just delete the Excel table and introduce a new table for the tax factor that did not mention the type of company. This would not have been so easy to do with the original algorithm.

Once again, even from a very simple set of examples, it should be clear that Oracle Policy Automation rules will benefit from the targeted application of principles from programming – in this case, the Strategy and Template Method design patterns. For more information about the ideas discussed in this article, Dr Sender can be reached using his LinkedIn profile, at the end of this article.

Object-Oriented Design Patterns and Oracle Policy Automation : Going Further

The OPA Hub and Dr Sender are currently working towards the launch of advanced training based on his work. If you are interested, please take a moment to answer the 1 question survey below (if you have not already registered for the OPA Hub you can do that here before you answer). Thank you!

What kind of advanced OPA training would you be interested in attending?

Magia Consulting are hiring

Friends of the OPA Hub Website Magia Consulting are hiring!

Leona Chauban, Director at Magia Consulting  got in touch to let us know.

“Magia Consulting is an innovative solution provider and consultancy in the technology industry, and our people are amongst the industry best in our field of expertise, who are embracing our journey of global expansion. As a team, we pride ourselves in our technical expertise and delivering excellence in our products, services and training. We are interested in speaking with talented, intelligent individuals with an aptitude for technology, who take pride in delivering customer value and have a “can do” attitude.”

The different career options are outlined below. You can directly apply from the relevant page. Hurry because not only will there be lots of applicants but the closing dates are coming up soon:

Sales Executive – Enterprise Software & Services

Magia Consulting are recruiting a full time Sales Executive to join our expanding UK based team. The role is offered on a permanent basis, and presents an exciting opportunity for a highly ambitious sales manager or business development executive to be involved in growth of an innovative organisation in the EMEA market.

The position involves collaborating with a skilled team to identify leads, secure opportunities and generate sales in licenses, consulting and support contracts.

This is a key role for Magia and the Sales Executive will report directly to Company Directors. Magia are offering the unique opportunity for a commission structure that is uncapped, so that when a candidate excels, they will rewarded accordingly. Magia also offer equity options for employees.

The role is London/South East based with travel as required within UK/EMEA.

Read More and Apply…

Oracle Policy Automation (OPA) consultant

Magia Consulting are recruiting an Oracle Policy Automation (OPA) consultant to join our expanding UK team. The role is offered on a permanent basis, and presents an exciting opportunity for the best and brightest to join an established consultancy on the verge of further global growth.

Good working knowledge of Oracle Policy Automation is required as a starting point, with training and support provided to advance your skills to expert level.

The role is based in Midlands with potential travel to client sites in other parts of the UK and EMEA.

Magia Consulting offer employee equity options, training, and the rare opportunity for a potentially varied role that will engage the smartest mind.

Read More and Apply…

Helix Solutions are looking for a Senior Oracle Policy Automation Functional Consultant

Helix Solutions are looking for a Senior Oracle Policy Automation Functional Consultant

Oracle Policy Automation Functional Consultant sought by Helix SolutionsFriends of the OPA Hub Website, Helix Solutions are looking to grow their CX team by recruiting the following profile (these are just the prerequisites, for more information follow the link at the bottom of this post). If you fit this description of an Oracle Policy Automation Functional Consultant or you know someone who does, then get in touch and tell them you saw the announcement on the OPA Hub Website.

Pre-requisites:

  • A minimum of 3 to 5 years of experience developing and testing rules using Oracle Policy Automation.
  • Experience in deploying Oracle Policy Automation Rulebases in a large integrated environment.
  • Previous experience in using Oracle Policy Automation in a SOA/ERP/CRM environment.
  • Understand how Oracle Policy Automation communicates via API’s and Web Services to other systems.
  • Ability to transfer knowledge and provide training for  Oracle Policy Automation is required.
  • Proven ability to identify, document and communicate “best practices” for Oracle Policy Automation  use in an Enterprise system.

Please submit your resume and contact Lowell Knighton directly through our website and/or lowellknighton@helixmail.com

If your company or organization is looking for Oracle Policy Automation talent or has active job offers, let us know by contacting the OPA Hub Website so we can get you listed on our Ecosystem page and post your job offering to a wide and active OPA-focussed audience.

Modern CX : Mundane to Modern : Innovating your Service Cloud Core THT1315

Mundane to Modern : Innovating your Service Cloud Core THT1315

Just time to tell you about this Theatre Session run by Eventus. In all this talk of IOT and super-modern stuff it is nice to get to see somebody focusing on the core application. Oracle Service Cloud core is great but the neat customisation they illustrated were perfect examples of how a step change can sometimes come from a small effort.

  • SMS Channel in Incident Creation and Responses
  • Predictive Searches in the Customer Portal

Eventus also produce a set of enhancements that they briefly touched on : agent desktop extensions, mail merge, credit card processing in the Customer Portal and so forth.

The SMS channel was presented with a cool demonstration (kudos for doing it live guys) and it was th opportunity to consider the uniqueness of SMS : sometimes it is as fluid and frequent as live chat, but it can just as easily segue back into an email-style timescale.
Service Cloud

One of the different tools that was part of the demonstration with Service Cloud was Mightytext.net : Text from your computer, sync’d with your Android phone & number.

I hope to pop on by their booth later.

Anyway it was a good theatre session and I enjoyed the relaxed style.

 

Mantis Solutions

Mantis Solutions OPA DB Connector : Part Two : Linked Tables, Bind URL variables and more

Mantis Solutions OPA DB Connector : Part Two : Linked Tables, Bind URL variables and more

Readers will recall that last week I provided a quick run-through of the capabilities of the Mantis Solutions OPA DB Connector. Simple to use and lightweight, I see it as a great way to open up legacy data sources easily to Oracle Policy Automation for rapid exploitation.

In this second short video, I wanted to keep going in the same direction as last time :

  • In the first part I decided to highlight a couple of neat features, the dashboard page which provides some neat and simple dynamic graphics for viewing calls to the connector
  • Secondly, the ability to quickly to create bindings to URL variables, for example a row_id (in my case) to load a set of data into the Web Interview. Although I didn’t look at it this time, there is also the ability to create bind mappings which I will investigate in the next video
  • Finally, the creation of a second, linked, table and how to add the necessary foreign key and so forth to be able to refresh the Connection in Oracle Policy Modeling and add a child entity and load that data. You’ll see it didn’t take me very long at all.

My apologies for the very croaky and quiet voice-over on this video, since the last one was recorded I have changed timezone which meant I brought back a cold as a souvenir of Canada. Hopefully by the next video in the series I will be back to full strength. Once again, many thanks to the Mantis Solutions team for putting the environment at my disposal. If you would like to reach out to them (and they would be delighted to chat with you I am quite sure!) then just head on over to their website at Mantis Solutions.com.au.

Mantis Solutions

Mantis Solutions OPA DB Connector : First Looks

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.