Pages

Monday, April 15, 2019

Oracle Service Cloud to Eloqua - Bulk Opportunity Import using Service Cloud ROQL and OIC !!!

I have already blogged two different integration pattern between Service Cloud to Eloqua.
This first integration pattern was using Standard Object e.g. Contact object, documented in this blog
The second integration pattern was using Custom Object e.g. Degree Object, documented in this blog.
Now, in this current blog, I am going to cover another integration pattern where bulk data can be imported from Service Cloud to Eloqua using Service Cloud ROQL statement.
In both my previous blogs, data was getting exchanged real time but one transaction at a time, but in this blog data will be transmitted from Service Cloud to Eloqua in bulk for Opportunity Business Object.

Usecase:-

This could be one of useful use case wherein you run some marketing campaign recently, which resulted some of the opportunities in Service Cloud and in Marketing cloud you want to reassess campaign performance by looking opportunities data from Service Cloud. Hence, Opportunities data need to be synch with Eloqua in Bulk.
In this use case we will running scheduler integration which will trigger by its own in 10 minute interval and will first get the lists of all new and updated opportunities from Service cloud and then will create the Opportunity Import job in Eloqua and will upload the data to that particular opportunity import job, as result your Opportunities data form Service Cloud to Eloqua will be synched.
Below are the high level steps need to execute to Sync Opportunities in bulk from Service Cloud to Eloqua-
Picture01.png

Eloqua Configuration - Opportunity Stage Creation

We have to create similar opportunity stage inside Eloqua what exists inside Service Cloud until unless you want to do cross referring using OIC, to simplified the example I just created same Opportunities stage in Eloqua what exists in Service Cloud, so that no lookup needs to maintain in OIC.
Navigate to Orchestration >> Campaign >> Opportunities setting
Picture02.png
Click on Add new Opportunity Stage, add multiple stage e.g. open, active, lost and closed
Picture03.png
Picture04.png

OIC - Create Eloqua Rest Adapter Connection

We will be invoking Eloqua using its REST API, hence need to Create a REST Adapter connection for Eloqua, where we can specify Opportunities Import and actual data JSON payload.
Chose any relevant name for adapter and specify Eloqua Portal URL e.g. https://secure.p03.eloqua.com
For authentication make sure you are including Company and username together, refer below snap.
Picture05.png
Note: Company name need to pre-fixed with user name as per above snap

OIC - Service Cloud REST Adapter Connection

Similarly, we need to Invoke Service Cloud using its REST API, hence need a REST Adapter to invoke Service Cloud ROQL statement to get the list of stored opportunities
Note: Service Cloud Adapter also support Rightnow Object Query Language (ROQL) statement but I find easy to deal with REST API, hence used REST Adapter but you can always using Service Cloud Adapter to invoke ROQL statement as well.
Give meaningful name and specify Service Cloud WSLD and Service Cloud credentials.
Rest URL e.g. https://rnowgse00xxx-x.rightnowdemo.com/services/rest/connect/v1.4
Picture06.png

Service Cloud - ROQL Creation and Testing

Its good idea to first develop ROQL and test that using postman or any other REST API based tool. For more information about ROQL, refer this link.
Below is the ROQL which I have used in my integration.
https://rnowgse00xxx-x.rightnowdemo.com/services/rest/connect/v1.4/queryResults/?query=select id, name, statusWithType.statusType.lookupName, costOfSale.value from opportunities
Make sure to include authentication and “OSvC-CREST-Application-Context” header key parameter



Now, all the ingredients are ready and we need to start creating integration.

OIC - Create Integration

Create new “Scheduled Orchestration” type of Integration, given some meaningful name.
Picture08.png
Picture09.png
You will get blank canvas something like below –
Picture10.png
Click on Picture11.pngsign button and use Service Cloud REST Adapter Connection to Invoke Service Cloud and pass the ROQL query and get the response.
Once you drop the Service Cloud REST Adapter, it open-ups Wizard, given some sensible endpoint name, endpoint relative URI name, GET action, tick add and review parameter, tick receive response and custom header.
Picture12.png
Add a query parameter, the purpose of this query parameter to pass the queryString which contains the ROQL statement
Picture13.png
You also need to pass 2 custom header parameters, its pre-requisite to invoke Service Cloud using REST API.
OSvC-CREST-Application-Context
x-ics-use-x-www-form-urlencoded (This one I added later due to error I was facing)
Picture14.png
For response provide below JSON payload, which we get once we run the query from Postman tool
{   "items": [     {       "tableName": "opportunities",       "count": 11,       "columnNames": [         "id",         "name",         "lookupName",         "value"       ],       "rows": [         [           "1",           "Insurance coverage for family",           "Active",           null         ]       ]     }   ] }

Picture15.png
And finish the wizard.
Integration will look like something below, and map option to “synchOpportunities” will also appear.
Picture16.png
Go inside mapper Picture17.png to do the mapping.
Map the value as per below table-
Target Element nameTarget Element Value
OSvC-CREST-Application-Context“Test”
x-ics-use-x-www-form-urlencoded/‘false’
Query'select id, name, statusWithType.statusType.lookupName, costOfSale.value from opportunities'
Picture18.png
Once mapping done, validate mapping, save mapping and save integration.
By now we have called Service Cloud with ROQL statement and will get reply from Service Cloud using JSON payload.
Now, we need to invoke Eloqua, but we need to invoke Eloqua twice, 1) creating Import definition and tell Eloqua what the fields are will be include as part of that definition and 2) upload the data into that particular Import JOB.
Again, click onPicture11and this time use Eloqua REST Adapter connection and wizard will open-up.
Give some sensible name to endpoint, endpoint relative URL must be same as highlighted, select POST Action and tick request and response configuration.
/api/bulk/2.0/opportunities/imports
Picture19.png
Refer opportunity import REST API documentation for more details.
Chose, Inline JSON option, specified this payload
{
"name": "Opportunity Import",
"fields": {
"OpportunityID": "{{Opportunity.Id}}",
"OpportunityName": "{{Opportunity.Field(Name)}}",
"Amount": "{{Opportunity.Field(Amount)}}",
"Stage": "{{Opportunity.Field(Stage)}}"},
"identifierFieldName": "OpportunityID",
"isIdentifierFieldCaseSensitive": false,
"isSyncTriggeredOnImport": true
}
Picture20.png
And Inline JSON Response payload.
{
"isIdentifierFieldCaseSensitive": false,
"name": "Opportunity Import",
"fields": {
"OpportunityID": "{{Opportunity.Id}}",
"OpportunityName": "{{Opportunity.Field(Name)}}",
"Amount": "{{Opportunity.Field(Amount)}}",
"Stage": "{{Opportunity.Field(Stage)}}"
},
"identifierFieldName": "OpportunityID",
"isSyncTriggeredOnImport": true,
"dataRetentionDuration": "P7D",
"uri": "/opportunities/imports/36",
"createdBy": "Eloqua.Config",
"createdAt": "2019-03-25T04:39:32.3753849Z",
"updatedBy": "Eloqua.Config",
"updatedAt": "2019-03-25T04:39:32.3753849Z"
}
Picture21.png
And finish the adapter connection.
Now, we need to do mapping for Create Import Definition step.
Do the mapping as per below table-
Target Element/Node NameTarget Element/Node value
Content-Type"application/json"
name"Opportunity Import"
fields:OpportunityID/"{{Opportunity.Id}}"
Fields: OpportunityName/"{{Opportunity.Field(Name)}}"
Fields:Amout"{{Opportunity.Field(Amount)}}"
Fields:Stage"{{Opportunity.Field(Stage)}}"
identifierFieldName"OpportunityID"
isIdentifierFieldCaseSensitive‘false’
sSyncTriggeredOnImport‘true’
Picture22.png
Note: All values in this mapping mapped with static value.
Once you finish with that, your integration will something like this.
Picture23.png

Till this stage you have invoked Service Cloud with ROQL, got the reply, you have invoked Eloqua with Opportunity definition and got its reply with opportunity job id.
So far so good. The JSON reply from Eloqua for Opportunity definition should be like this–
{
"isIdentifierFieldCaseSensitive": false,
"name": "Opportunity Import",
"fields": {
"OpportunityID": "{{Opportunity.Id}}",
"OpportunityName": "{{Opportunity.Field(Name)}}",
"Amount": "{{Opportunity.Field(Amount)}}",
"Stage": "{{Opportunity.Field(Stage)}}"
},
"identifierFieldName": "OpportunityID",
"isSyncTriggeredOnImport": true,
"dataRetentionDuration": "P7D",
    "uri": "/opportunities/imports/36",
"createdBy": "Eloqua.Config",
"createdAt": "2019-03-25T04:39:32.3753849Z",
"updatedBy": "Eloqua.Config",
"updatedAt": "2019-03-25T04:39:32.3753849Z"
}
The highlighted element “uri” value has an important role for next step.
"/opportunities/imports/36", is the number of opportunity job id created in Eloqua system.
In our next step we need to upload the data to this import job id. However, the REST API for upload need to build dynamically by passing this number e.g. 36 in this case.
The REST API for data upload is this-
https://secure.p03.eloqua.com/api/bulk/2.0/opportunities/imports/36/data
Now, how to do that is quite simple if you know, if not then might take a while to workout.
So, let’s have a look how to do that.
When you drop the Eloqua Adapter connection again, wizard will get open and it will ask endpoint relative URI, what you need to do is pass the relative URI like this –
/api/bulk/2.0{importURI}/data
Picture24.png
importURI in this case become a variable which we will map dynamically during mapping for this invoke with the value which we will get back from Import definition “uri” element.
So, let’s move to next step and invoke Eloqua once again using same connection and call data upload REST API and do the mapping.
Click on again Picture11sign to add Eloqua Adapter connection and specified things as per below snap and click next –
Picture25.png
Below screen just accept everything default.
Picture26.png
Now, again specified inline JSON payload
[{
"OpportunityID": "2ABC",
"OpportunityName": "2ABC Company",
"Amount": "1000000",
"Stage": "Closed"
},
{
"OpportunityID": "3ABC",
"OpportunityName": "3ABC Company",
"Amount": "1000000",
"Stage": "Closed"
}
]
Picture27.png
Response JSON Payload
{
"syncedInstanceUri": "/opportunities/imports/36",
"status": "pending",
"createdAt": "2019-03-25T04:46:14.8249322Z",
"createdBy": "Eloqua.Config",
"uri": "/syncs/1446"
}
Picture28.png
Finish the wizard and start doing mapping for this invoke.
In this mapping we are going to map the Service Cloud ROQL response with Import Definition Data upload into Eloqua. Both side data structure is in different format. This mapping also using for-each function as both side we have reoccurring data coming. Service Cloud also sending data for multiple opportunities in nested array and Eloqua also we need to send multiple opportunity in object array form.
Follow below mapping table to do the mapping
Source ElementTarget ElementMapping FunctionValue
Content-TypeStatic value mapping"application/json"
uriImportURIOne to one
nestedArrayItem[1]OpportunityIDOne to one (Under for each)
nestedArrayItem[2]OpportunityName/One to one (Under for each)
nestedArrayItem[3]StageOne to one (Under for each)
nestedArrayItem[4]AmountOne to one (Under for each)
Picture29.png
Save your mapping, save your integration, after complete flow, your integration should look like this.
Picture30.png
Now, activate this integration and test the same. Since we are using scheduler, you may try to use option just “Active” without auto scheduling or “Activate and Schedule” which will pop-up another window where you can define scheduler setting such as frequency etc
Picture31.png
In Scheduler window, select frequency to hourly and define 10 minute which is lowest frequency allowed at this stage.
Picture32.png
Once you define the frequency, you get another window to start the schedule, as soon as you click “start scheduler” it will start running in every 10 minute of your defined frequency.
Picture33.png

Testing

Login to Service Cloud Desktop Application, open the Demo Opportunity page.
Note: The Demo opportunity page is not standard page, it’s been developed for Service Cloud expert and refer Service Cloud document how to create such pages. There is no standard path to access the Demo Opportunity page and create a demo opportunities.




Once Opportunities been created, you can also run ROQL manually using postman to cross verify whether ROQL query picking up newly created opportunities.
ROQL Query –
https://rnowgse00XXX-X.rightnowdemo.com/services/rest/connect/v1.4/queryResults/?query=select id, name, statusWithType.statusType.lookupName, costOfSale.value from opportunities
header must contain “OSvC-CREST-Application-Context” parameter along with authorization.




Next, wait for scheduler to pick this newly added opportunity of you can run the scheduler any time by choosing option “Submit now”
Once you submitted the scheduler job, you get request id, click on that and you will find status of that transactions –
Picture37.png
Picture38.png
Jump to Eloqua, Navigate to Orchestration >> Campaign >> Opportunity Search
Picture39.png
Picture40.png
You can further click on Demo Opportunity 8 to see more details e.g. deal amount, stage etc.
Picture41.png
With this blog, I am pretty much done with 3 different scenarios / use case/ Integration pattern whatever you want to call out, been completed. I hope the information provided in this blog must help you when you deal integration between Service Cloud to Eloqua.
Enjoy your time :)


Monday, December 17, 2018

Oracle Engagement Cloud Event Processing using Sales Cloud Adapter within Oracle Integration Cloud !!!


Recently, I been part of one POC where I have learned how we can consume Business Events from Oracle Engagement Cloud.


Oracle Engagement Cloud is a Software as a Service (SaaS) offering from Oracle which provides unified Sales and Service Capabilities, includes sales force automation to manage the full sales lifecycle including leads, accounts, contacts, opportunities, assets, activities, assessments, and forecasts. Leverage content on mobile, the web, and email applications etc.Beneath the hood, there are several business object e.g. Account, Contact, Plan, Opportunity, service request etc. which form the data model to store data in back-end and exchange data with other systems.

In this blog, I will be simply demonstrating the prerequisite which are required to configure inside Oracle Engagement Cloud and OIC Sales Cloud Adapter configuration. Below Instruction applicable for Fusion Application Release 13 or later version, and Integration Cloud versions 18.4.1, if your environment version is different then given instruction may or may not work.

Sample Use Case - When user updating any existing Service Request Status in Oracle Engagement Cloud e.g. Open >> In-Progress, the SR Status need to be updated back to Banking Complaint Management Portal.

Assigning Role to Integration User- In order to consume Event from Oracle Engagement Cloud in OIC, the Integration user need to be exist or created with required roles. Either use existing user or create a new one in Engagement Cloud.

Note: You must be having Admin privilege to do that.

You can create new USER in Engagement Cloud by navigating to Oracle Cloud Home page >>Oracle Engagement Cloud  (Login with Admin Account) >> Navigator>> More >> Securi >> Create new user and add below specified roles -
Role  = "Customer Relationship Management Application Administrator"
Role Code = "ZCA_CUSTOMER_RELATIONSHIP_MANAGEMENT_APPLICATION_ADMINISTRATOR_JOB"
Note: Documentation talks about adding two more roles 1) SOAOperator and 2) FND_MANAGE_CATALOG_SERVICE_PRIV.  In my environment I couldn't find these two pre-existing roles. So I haven't added. If you found these two roles in your environment please feel free to add these roles to newly created user.


01-HomePage

02-OEClogin
03-securityconsole
04-Adduser
5-AddUser

Once user created, you will be getting mail on specified mail id with temporary password, logout from existing user and login using your new credentials and change the password.

Configure CSF Key
You must create a CSF key to subscribe to events in Oracle Sales Cloud. This will hold the credentials of Integration Cloud user and password and will be used when Sales Cloud will make outbound request to Integration Cloud Service to raise an Event.
Access SOA Composer to create CSF key using below example URL -

https://ucf6-fap0XXXX-fa-ext.oracledemos.com/soa/composer

In above URL, make sure you use right Sales Cloud Environment hostname, above name is just for an example. /soa/composer URI part is fixed.
Once open SOA Composer, click on Manage Security  and and register CSF KEY using below values description -

CSF-KEY - The CSF-Key name must be the Identity Domain name of Oracle Integration Cloud Service. You can get the Identity Domain value by clicking "About" option inside Integration Cloud Service.

7-IdentityDomain

UserName- Enter Oracle Integration Cloud User and Password, make sure this user must assign "IntegrationServiceRuntime" role.
Password and Confirm Password - Specify per password policy.

6-CSF-Key


Once above part is done, next steps are very simple to create connection and connection instance inside Integration which I won't cover too much in details as its same as common step followed for any other integration.

Oracle Sales Cloud Connection for Engagement Cloud -

Login to Oracle Integration Cloud >> Integration >> Connection >> Create  >> specify Oracle Sales Cloud Catalog WSDL and Event Catalog URL along with user name and password.
Defining the URL for Service Catalog WSDL and Event Catalog WSDL is quite easy from Release 13 onward. Most of the URL part if fixed, the only environment host name needs to be changed.
e.g. in below values green color highlighted part is predefined and doesn't need any change, only host name needs to be changed to point correct Sales Cloud environment.

https://ucf6-fapXXXX-fa-ext.oracledemos.com/fscmService/ServiceCatalogService?WSDL

https://ucf6-fapXXXX-fa-ext.oracledemos.com/soa-infra

8-OECConn

Once connection tested, save the connection and create the Integration using this connection. Inside integration drag and drop newly created Oracle Engagement Cloud Connection and specify which particular business event you want to listen e.g. in my case I was willing to get update whenever a Service Request status gets updated, so I selected "Service Request Update Event"

9-Integration

and Response type "None".

10-Integration

Once Oracle Engagement Cloud Connection instance configuration done. Similar drag and drop right/target hand side Connection instance object as well, it could be any system depending up where you want to process this event which you will consume from Oracle Engagement Cloud. I am not covering in details because those are very common step and most developers know how to do that. Once both side Connection instance configuration is done, perform the mapping.

11-Mapping

Once mapping done, your integration is ready to be activated and use.

Testing- 
In order to test this, I just need to change a SR status in Engagement Cloud e.g. "In-Progress" to "Waiting" which will trigger an Business event and Fusion application will call my Integration process to provide that business event object, once Integration will receive the event it will push that event to target system. In my case target system was Visual Builder Data Object using REST Adapter.

Updating SR status from In-progress to waiting-
12-EC-SRUpdate
Here is the snap of Integration execution flow -
13-OIC-SRUpdateProcess
Below the web app snap which is consuming Visual Builder Data Object to show the notification from Engagement Cloud.

webappStatus

Conclusion:
In this blog I have tired to show you the prerequisite which we need to configure at Oracle Engagement Cloud to consume Business Event using Oracle Integration Cloud.
Also, given very high level steps of Integration and testing steps, but that can vary drastically use case basis. Hence, I haven't explained too much on those topic. I hope you must have go the core idea about Oracle Engagement Cloud Business Event processing using Oracle Integration Cloud.

Friday, June 1, 2018

Invoking HTTPS Service Request from Oracle API Platform

Oracle API Platform's API Implementation has two service naming convention 1) API Request 2) Service Request.

API Request - is the endpoint to which users or applications send requests for your API.

Service Request - is the URL at which your back-end service receives requests.

In this blog we are going to discuss what are the additional configuration we need to done inside API Platform Gateway Server while invoking a HTTPS Service Request URL.

Since, its HTTPS URL obviously there is associated SSL cert with that URL which is signed by Certificate Authority.

Recently, I have been doing one POC where I was invoking a Service Request HTTPS URL but it was not working and later found out it's because of associated SSL certificate was not configured in Weblogic JKS Keystore.

Before, I get into detailed solution, let me tell you bit more about problem. At very initial stage when I tried creating an API which is in-turn calling an HTTPS service request, it was failing while invoking that service from rest POSTMAN tool and was getting "Internal Server error" as per below snap.


1

It was quite tricky to find out what's went wrong in back-end which was resulting above error. After struggling a bit I found one very important log file "Default.log" for API Gateway server aka Oracle Communication Service Gatekeeper (OCSG) Server, located at e.g. /u01/apics/install/domain/gateway1/servers/managedServer1/trace/ path. In your case "/u01/apics" might be different, but rest PATH should be same.

This logs, clearly state there was issue with SSL Handshake and was getting "javax.net.ssl.SSLHandshakeException: General SSLEngine problem" error as per given snap-


2


Thursday, May 31, 2018

Oracle API Platform Gateway Log files Summary

 
Is Troubleshooting Important for you ? I hope, the answer is Yes. If that's the case for you then first thing we need to know where to look for the detailed error message when something going wrong e.g. Gateway server not pooling API configuration from Management tier, while Invoking API end user getting "Internal Server Error", "Resource not found" etc etc. There could be many types of error but often its hard to find out root cause of exact error.

Recently, I have created an API which was further calling and HTTPS endpoint. While, invoking that API I was getting error "Internal server error", However, there was nowhere I could easily locate the details error about this problem. I had looked Managed server.log, ManagedServer.out, APICS EDR file and many other files but couldn't find useful error message related to my error. Later, I found one log file "default.log" which helped me to get root cause of my error. Hence, I decided to compile a list of all logs files, their location and bit of description, so that next time when I hit the some issue, it could be much easier for me to find out root cause by looking relevant log file. This blogs definitely helps to reader as well if they got stuck with API Gateway Error.

Note: The path given in my explanation could be different than your environment but I hope you can very well workout your environment path after looking my sample PATH which I have mentioned in this blog. My base location of installation was "/u01/apics", the rest PATH should be same in your environment.

Also, before enabling debug/trace severity make sure it's impact on file size because some of the files start getting thousand of lines of logs once you enabled the debug/trace log severity.
So, here is my comprehensive logs files list, their location and bit of description which you won't find in Oracle APICS documentation.

Thursday, May 10, 2018

Create and Delete Users in Weblogic using WLST Script

In one of my recent Event engagement, I was expected to provision 50+ users in Weblogic. Creating users in Weblogic is not cumbersome process, it's fairly easy. However, when you need to do in bulk it can take hours.

So, I just came up with simple WLST script which take an configuration file as input which contains all the server credentials required to make connectivity and list of users, description and group name etc and create and delete users in Weblogic.

Note: I have tested this script in Weblogic 12.2.1.2 but it should work in all Weblogic version as long as the beans which I have used inside python not been change in particular Weblogic Version.

Creating Users


Configure Letsencrypt SSL Certificate in Weblogic 12c

Who doesn't like the security. This is one of critical element of our IT Infrastructure. Recently I was doing one POC and got requirement to setup a valid SSL certificate in Weblogic. However, since it was just an POC we were not having any valid SSL certificate issued by some Certificate Authority. Later, I came across for one website called https://letsencrypt.org/ . Let’s Encrypt is a free, automated, and open certificate authority (CA). they give people the digital certificates they need in order to enable HTTPS (SSL/TLS) for websites, and its free, yes you heard correctly It's FREE !!!. You don't need to pay them at all. So if you need a valid SSL certificate for your POC or even for Production environment you can get one from them. Although their certificate comes with 3 month validity, so while using for Production environment user need to keep renewing with them with simple automated process.

In this blog we will be learning how we can generate letsencrypt SSL certificate, what's prerequisite to get the certificate and setup that certificate in Weblogic server to enable SSL communication.
So, Lets move on. We will be doing below stuff in sequence -
  1. Get a registered domain name (This required while generating SSL Cert)
  2. Install Certbot ACME Tool and Apache HTTP Server
  3. Generate Letsencrypt SSL Certificate
  4. Configure Letsencrypt SSL in Weblogic Identity Store