Oracle Cloud Adapter for Salesforce.com (aka Salesforce adapter) possesses capability to receive the events from Salesforce.com to help customers to achieve true real time integration with Salesforce.com. Salesforce, currently exposes 4 patterns to receive the events from Salesforce.com.
- Workflow-driven outbound messaging (with or without callback)
- This is most popular integration (and recommended by salesforce) pattern for Remote Process Invocation if you want to go with one-way (fire and forget) or asynchronous (with call back) integration. Salesforce adapter support this pattern and we will be discussing on how to configure salesforce adapter to utilize Salesforce.com’s outbound messaging feature.
Apex SOAP callout
- User supposed to write Apex class. more details can be found at here.
- Apex HTTP Callout
- Same as point #2. More details about it can be found here.
- Streaming API
- This is still not mature and in current state it does not guarantee the delivery of messages. This option is out from the integration list until Salesforce comes up with durable streaming API.
Let’s now talk about how to configure Salesforce adapter at source side on ICS to receive the events from Salesforce.com. It is 3 steps process.
- Create Workflow and Outbound Messaging for the Integration
- Configure Salesforce Adapter on ICS
- Configure endpoint URL into Salesforce.com Outbound Messaging
Create Workflow and Outbound Messaging for the Integration on Salesforce.com:
For ease of understanding let’s take one example and put the steps around it. It will make this post relate to scenario and steps will be similar to other scenarios too.
Suppose integration requirement is to sync case those has been escalated due to any reason to other application like ServiceNow or ERP. So Object to deal with at the salesforce side is Case.
- login to Salesforce.com organization
- click on setup
- type Workflows on quick search box and click on Workflow Rules or navigate to Build section and create -> Workflows & Approvals -> Workflow Rules
- Create on New button to create new workflow rule
- Select the object with which you want to work. This should be the same object on which event trigger needs to be created. For above scenario let’s select object ‘Case’. Press Next button.
- Provide the name of the rule and criteria to trigger the event. for above scenario, criteria should be ‘Case: Escalated EQUALS True‘ as shown in the below diagram.
- Click Save and Next button
- Click on ‘Add Workflow Action’ button and Select ‘New Outbound Message’ from the list as shown in the diagram below.
- Page to create new Outbound Message will open up. Provide all mandatory fields there. As shown below
- provide the name
- provide the unique name or go with the default
- In the end point URL section, just provide dummy URL
- Chose the fields those needs to be synced with target
- Click on Save Button. you will be back on Workflow rules page and just create outbound message will be selected already.
- Click on Done button.
- Now you should be able to see Activate button. Click on it and workflow rules started listening based on criteria.
- Now navigate to Setup -> AppSetup -> Create -> Workflow & Approvals -> Outbound Messages
- Click on the outbound message we just create (Case_OM).
- There you should be able to see Endpoint WSDL. Click on the link.
- It will open up the WSDL for you. Download this WSDL. (we will use this WSDL in ICS during adapter configuration)
Configure Salesforce Adapter on ICS:
- Login into ICS instance with ICS credentials.
- Create a new Salesforce adapter connection on ICS (How to create Salesforce Connection on ICS)
- Now click on Integrations link to open Integration canvas on ICS to create a new flow.
- Drag and drop Salesforce adapter from the list (right hand side) to source side.
- Provide the information on Basic Info page. And click to Next.
- In this page you will find the instructions for generating outbound messaging WSDL first from Salesforce those we already covered in detail in previous section.
- In this page you should be able to find button Browse to upload the WSDL file.
- Click on Browse button.
- Select the downloaded WSDL (as per step 16 from previous section). Make a note that only one WSDL can be uploaded to this page if you upload WSDL again it will replace previous WSDL.
- You should be able to see uploaded WSDL on this page now. Click on Next.
- In case you want to configure call back you go ahead and configure success and failure scenarios. but for this blog, we will uncheck ‘Send a Response’ checkbox. (I will cover how to configure callback later)
- Click to next.
- you now landed on Summery page where again you should see instructions for post activation steps.
- Click on the done button and adapter configuration is complete.
- Complete the integration flow by configuring target side adapter and mapping and activate the flow.
- once the flow is activated, click on information icon on flow landing page and you should be able to get endpoint URI of just newely activated flow. Copy that URL.
- Note: Please note above URL will be WSDL URL, remove the ?wsdl from that URL and remaining will become end point URL.
Configure endpoint URL into Salesforce.com Outbound Messaging:
- Navigate to Setup -> AppSetup -> Create -> Workflow & Approvals -> Outbound Messages again.
- Click on the outbound Message ‘Case_OM’ from the list and click on Edit button.
- Now replace the dummy URL with URL you copied in step 17 from above section.
- Click on save.
You are good to start receiving messages from Salesforce for Case object into ICS.
Note: Steps will remain same if you want to deal with some other object.