Using Oracle Policy Automation Public Cloud with Oracle Service Cloud
We are continuing our Lazy Expert series of posts, with an explanation of how OPA Public Cloud, and the rulebases deployed there, can be used within the Oracle Service Cloud application. In case you have missed out on our first part of this series, you can find it here. With the right Nudge, our Lazy Expert is not so lazy after all.
One of the earliest pre-built connectors for OPA comes from the Oracle Service Cloud Service, to connect with an Oracle Policy Automation Public Cloud Instance. Since then, we have seen multiple releases of this connector and each subsequent release improves the functionality available with the OPA Public Cloud Service, as well as how it is used together with the Oracle Service Cloud Service. For the rest of this content, we will be referring to these applications as OPA Cloud and Service Cloud respectively to gain a few centimeters of white space.
|OPA Runtime||Nudge (Trigger)||Possible Scale of Invocations / Volume||Typical Application / Solution Architecture||Use by Service Cloud|
|Policy Hub (OPA Public Cloud)||HTTP(s) URL based invocation of the Interview Service||100s of Thousands of invocations a day||OPA Policy Hub, as another Web Application, provides the Interview Session screens using the UI as configured by the rule author.|
This Assessment wizard can be made available within the “Agent Desktop” for the agent who is providing assisted service as well as embedded into the “Consumer Portal” for the consumer who is interested in achieving self-service.
It is possible to pass additional parameters through the URL, pre-load the Interview session with data from Oracle Service Cloud application and,
Persist / Save the data back into the Service Cloud application itself on completion of the interview and an appropriate assessment is made by our expert.
|OPA RightNow Connector is a special implementation of the Web Service Connector architecture provided by OPA Policy Hub.|
This “Connector” connects to a Service Cloud Instance as a data source and supports pre-loading and saving of data to / from the connected Service Cloud Instance.
For those of us trying to figure out the inner working of this connector, we will be using the sample rulebases provided by OPA Cloud. The complete list of example projects for the (freshly minted) Nov 2016 release of OPA can be found here. Such a hands-on exploration works best if you know both the applications well enough to administer and configure them, or spend some time together as a team that has the collective knowledge of both the applications.
The sample rulebase we use for this post is “RightNowSimple”. This is a fairly simple project that can be used to test the connectivity with the Service Cloud Instance from OPA Cloud and without making any changes to the Service Cloud Application. The supported objectives of this rulebase are
- To collect the basic user profile information and their opt-in preference for marketing emails
- If they opt-in, and only if, then collect the additional email address information
- With the collected information and preferences, create a new “Contact” Record and the associated follow-up “Tasks” to be performed in the connected Service Cloud Instance.
- OPA Cloud Instance provisioned with the necessary connection to the Service Cloud Instance. This is an improvement from earlier versions in that Oracle, along with provisioning the OPA Cloud Instance, will also perform some of the initial setup tasks needed to connect to a Service Cloud Instance from OPA Cloud. If this is all done correctly during provisioning, you should see the following entry in the “Connections” tab of the OPA Policy Hub administration site. The green check mark against the Oracle Service Cloud Connection signifies that the provisioning is all done correctly and that the Oracle Service Cloud connection is ready to use. Please also note the use of the SOAP service end-point for the associated Service Cloud Instance.
- The new Permission model in OPA Cloud allows for “Collections” to be created, for the purpose of grouping rulebases and granting permissions to users at the Collection-level. In our case, we created a collection named “Service Cloud Collection” to group all the rulebases related to Service Cloud. If this is not available, you can always use the “Default Collection”, which is made available by default in OPA Cloud. Also the OPA Cloud Admin can specify which connections each of these collections will have access to. You will further see its impact when we are ready to deploy the rulebase.
- Oracle Policy Modeling Version 2016 is installed on your local machine with all its pre-requisites like Java RunTime Environment and Microsoft Office Word and Excel. Note that the Java RunTime requirement is now for version 8.
Explore the RightNowSimple Rulebase:
- Open Oracle Policy Modeling Nov 2016 release
- Click on “Example Projects”, search for RightNowSimple and select the project to create the local project on your default Projects folder.
- Review the Rules.docx rule document and the Data tab for the included entity model, its usage of Inferred Entity Instances and application of additional reasoning with the inferred entity instance attributes.
- Review the Interview screen design and its usage of rules for Screen Visibility (for “email address” Screen) and Screen Control Visibility (for “Interview Complete” Screen).
- Review the Data Model for the entities “Global” and “the task”, their containment relationship, their respective mapping to “Contact” and “Task” entities of Service Cloud, their attributes and public “Names” for those attributes, “Mapped Out” attributes for all the inputs being sent to “Service Cloud” and the “Mapped In” attributes for the outputs being received from Service Cloud.
- As per the above rulebase configuration, when the Interview is saved / submitted, a new contact record and the associated follow-up tasks are created in the Service Cloud database.
Deploy and run the RightNowSimple Rulebase
Let us now deploy this RightNowSimple rulebase to the OPA Cloud Policy Hub, using the Service Cloud Collection that is now available in the Policy Hub.
- Connect to the OPA Cloud Policy Hub using the appropriate admin credentials for your instance.
- Update the Connection used by the RightNowSimple rulebase, to make it ready for deployment.
This can be done by clicking on the “Mapping Settings” in the tool bar or the “Global” Entity to open the “Mapping Settings” dialog, changing/selecting the Service Cloud connection used by the rulebase and then refreshing the “meta data” that is made available through this Service Cloud connection. This meta data is required to accomplish the necessary mapping between the OPA Entity model and the Service Cloud entities.
- Deploy a Snapshot / Activate the rulebase on the OPA Cloud Policy Hub, using the appropriate Policy Hub Admin credentials for your OPA Cloud instance. For a quick deployment and test of the rulebase, make sure that the “Activate Immediately” check box is selected and deploy. Note Down the URL.
- Once the deployment is complete in the previous step, you will be able to copy the Interview launch URL for this rulebase. Go ahead and launch run the interview session with any input you would like to use and complete the Interview as per the instructions provided on the screen.
Verify the results in Oracle Service Cloud:
- The New Contact ID displayed on the summary screen, on Interview Completion indicates that the connector worked behind the scene, using the mapping configuration modeled in the rulebase, and created the contact record in the Service Cloud instance.
- Now login to your Oracle Service Cloud instance to verify the new Contact record created and the associated tasks, as inferred in the rulebase. Also compare the mapping settings in the rulebase to the actual filed values that are now inserted into the Service Cloud Instance.
With this detailed background, check this space when we will continue next with part 2 of this blog that focuses on embedding such interview sessions into the Consumer Portal of Oracle Service Cloud.