[7th April 2021]
Surat MuleSoft Meetup Group
MuleSoft Salesforce Composite Connector
Organizers
2
About Organizer:
Working as Senior Solution Architect at Capgemini.
12.5 Years of Integration and APIs Experience.
MuleSoft Ambassador
Surat MuleSoft Meetup Leader
MuleSoft Certified Integration and Platform Architect.
3
Organizers
Nitish Jain
Consultant
IBM
About the Organizer :
Working as Consultant at IBM.
Surat MuleSoft Meetup Leader.
2.5+ Years of Experience in Integrations and API Technologies.
Certified MuleSoft Developer and Platform Architect.
Speaker
4
About Speaker:
11 years of Technical Experience.
6 years of Experience in the Integration Domain.
Certified Mulesoft Architect.
Mule Meetup Speaker.
Coimbatore Mule Meetup Leader
CHEERS..!!
We have prizes to give away!
3 Winners a special prize is ready
5
A SHOW OF HANDS:
New Members With Us.!!
❖ Pain Points with Traditional Approach
❖ What is Salesforce Composite API?
❖ What an sObject is, Batch is and Composite Request is?
❖ How to create nested records of the same type?
❖ How to create multiple, unrelated records of the same type?
❖ Limitations of the Salesforce composite connectors
❖ Comparison between Batch, Composite Request and sObject Tree
❖ Live Demo
Agenda
6
Use Case: Create Account And Contact as Parent-Child Relationship
● Multiple round trips between Mulesoft and SFDC
● Manually need to extract details for Subsequent API Call
● Multiple API Calls towards API Limits
● No Transaction management
Pain points with Traditional Approach
7
● Mulesoft OOTB Connector
● Its Composite - single call towards our API limits.
● It uses a single REST API call to access several individual Salesforce services
○ Thereby simplifying your code.
○ Reducing network overhead by reducing round trips between Mulesoft and SFDC.
○ Improving your app’s performance.
○ Transaction management.
● Always returns HTTP Status as 200 by top level request.
● Single response body with all subrequest’s responses.
What is Salesforce Composite API Connector?
8
Single API call for upto 25 subrequest
One Request-Response
One Subrequest response can be used as
request for other subrequest
It expects payload as an Object
Transaction Management
Rollback on Failure
allOrNone= true/false
Top level request always returns HTTP 200
in either case
Response includes all subrequest
responses
Composite Request
9
{
"allOrNone":true,
"compositeRequest":[
{
"method":"POST",
"url":"/services/data/v51.0/sobjects/Account",
"referenceld":"refAccount",
"body":{
"Name":"Composite Request Account"
}
},
{
"method":"GET",
"url":"/services/data/v51.0/query/?q=select+id+from+contact+where+lastname='Barr'",
"referenceld":"refContact"
},
{
"method":"PATCH",
"url":"/services/data/v51.0/sobjects/Contact/@{refContact.records[0].Id}",
"referenceld":"refContactUpdated",
"body":{
"Accountld":"@{refAccount.id}"
}
}
]
}
Single API call for upto 25 independent
subrequest
One Request-Response
Each subrequest counts against rate limits
It expects payload as an Array
Transaction Management
Rollback on Failure
haltOnError = true/false
Sequential and Synchronous
Composite Batch
10
{
"batchRequests":[
{
"method":"PATCH",
"url":"v51.0/sobjects/account/0010000000KORXOIAZ",
"richInput":{
"Name":"NewName"
}
},
{
"method":"GET",
"url":"v51.0/sobjects/account/0010000000KofXOIAZ?fields=Name, BillingPostalCode"
}
]
}
Creates one or more sObject trees with root
records of the specified type.
An sObject tree is a collection of nested,
parent-child records with a single root record.
It expects Payload to be an Array.
Limitations:
Up to a total of 200 records across all
trees.
Up to five records of different types.
sObject trees up to five levels deep.
sObject Tree
11
{
"records":[ {
"attributes":{ "type":"Account","referenceId":"ref1" },
"name":"SampleAccount",
"phone":"1234567890",
"website":"www.salesforce.com",
"numberofEmployees":"100",
"industry":"Banking",
"Contacts":{
"records":[ {
"attributes":{ "type":"Contact", "referenceId":"ref2"},
"lastname":"Smith",
"title":"President",
"email":"sample@salesforce.com"
},{
"attributes":{"type":"Contact", "referenceId":"ref3" },
"lastname":"Evans",
"title":"Vice President",
"email":"sample@salesforce.com"
} ] }
},{
"attributes":{ "type":"Account", "referenceId":"ref4"},
"name":"SampleAccount2",
"phone":"1234567890",
"website":"www.salesforce2.com",
"numberofEmployees":"100",
"industry":"Banking"
} ]
}
Demo Time!!!
Consumer Key
The consumer key for the Salesforce connected app
Consumer Secret
The consumer secret for the connector to access Salesforce
Username
The Salesforce username
Password
The corresponding password
Security Token
The corresponding security token
Required Parameters
13
Q&A
Get ready to WIN a Special Gift from MuleSoft Community
Quiz Time
Question 1
Requests in a composite call are called...?
a. Subrequests
b. Duplicaterequests
c. Childrequests
d. None of the Above
16
Question 2
What is max Object limit of Composite Request?
a. 15
b. 20
c. 25
d. 30
17
Question 3
How many objects does sObject collection support in one
single request?
a. 100
b. 200
c. 300
d. 400
18
19
Share:
○ Tweet your pictures using the hashtag #SuratMuleSoftMeetup
○ Invite your network to join: https://meetups.mulesoft.com/surat/
Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program
○ Reach out to either Jitendra Bafna or Nitish Jainto suggest topics for next Meetup
What’s next?
Thank you

MuleSoft Surat Live Demonstration Virtual Meetup#5 - Salesforce Composite Connector

  • 1.
    [7th April 2021] SuratMuleSoft Meetup Group MuleSoft Salesforce Composite Connector
  • 2.
    Organizers 2 About Organizer: Working asSenior Solution Architect at Capgemini. 12.5 Years of Integration and APIs Experience. MuleSoft Ambassador Surat MuleSoft Meetup Leader MuleSoft Certified Integration and Platform Architect.
  • 3.
    3 Organizers Nitish Jain Consultant IBM About theOrganizer : Working as Consultant at IBM. Surat MuleSoft Meetup Leader. 2.5+ Years of Experience in Integrations and API Technologies. Certified MuleSoft Developer and Platform Architect.
  • 4.
    Speaker 4 About Speaker: 11 yearsof Technical Experience. 6 years of Experience in the Integration Domain. Certified Mulesoft Architect. Mule Meetup Speaker. Coimbatore Mule Meetup Leader
  • 5.
    CHEERS..!! We have prizesto give away! 3 Winners a special prize is ready 5 A SHOW OF HANDS: New Members With Us.!!
  • 6.
    ❖ Pain Pointswith Traditional Approach ❖ What is Salesforce Composite API? ❖ What an sObject is, Batch is and Composite Request is? ❖ How to create nested records of the same type? ❖ How to create multiple, unrelated records of the same type? ❖ Limitations of the Salesforce composite connectors ❖ Comparison between Batch, Composite Request and sObject Tree ❖ Live Demo Agenda 6
  • 7.
    Use Case: CreateAccount And Contact as Parent-Child Relationship ● Multiple round trips between Mulesoft and SFDC ● Manually need to extract details for Subsequent API Call ● Multiple API Calls towards API Limits ● No Transaction management Pain points with Traditional Approach 7
  • 8.
    ● Mulesoft OOTBConnector ● Its Composite - single call towards our API limits. ● It uses a single REST API call to access several individual Salesforce services ○ Thereby simplifying your code. ○ Reducing network overhead by reducing round trips between Mulesoft and SFDC. ○ Improving your app’s performance. ○ Transaction management. ● Always returns HTTP Status as 200 by top level request. ● Single response body with all subrequest’s responses. What is Salesforce Composite API Connector? 8
  • 9.
    Single API callfor upto 25 subrequest One Request-Response One Subrequest response can be used as request for other subrequest It expects payload as an Object Transaction Management Rollback on Failure allOrNone= true/false Top level request always returns HTTP 200 in either case Response includes all subrequest responses Composite Request 9 { "allOrNone":true, "compositeRequest":[ { "method":"POST", "url":"/services/data/v51.0/sobjects/Account", "referenceld":"refAccount", "body":{ "Name":"Composite Request Account" } }, { "method":"GET", "url":"/services/data/v51.0/query/?q=select+id+from+contact+where+lastname='Barr'", "referenceld":"refContact" }, { "method":"PATCH", "url":"/services/data/v51.0/sobjects/Contact/@{refContact.records[0].Id}", "referenceld":"refContactUpdated", "body":{ "Accountld":"@{refAccount.id}" } } ] }
  • 10.
    Single API callfor upto 25 independent subrequest One Request-Response Each subrequest counts against rate limits It expects payload as an Array Transaction Management Rollback on Failure haltOnError = true/false Sequential and Synchronous Composite Batch 10 { "batchRequests":[ { "method":"PATCH", "url":"v51.0/sobjects/account/0010000000KORXOIAZ", "richInput":{ "Name":"NewName" } }, { "method":"GET", "url":"v51.0/sobjects/account/0010000000KofXOIAZ?fields=Name, BillingPostalCode" } ] }
  • 11.
    Creates one ormore sObject trees with root records of the specified type. An sObject tree is a collection of nested, parent-child records with a single root record. It expects Payload to be an Array. Limitations: Up to a total of 200 records across all trees. Up to five records of different types. sObject trees up to five levels deep. sObject Tree 11 { "records":[ { "attributes":{ "type":"Account","referenceId":"ref1" }, "name":"SampleAccount", "phone":"1234567890", "website":"www.salesforce.com", "numberofEmployees":"100", "industry":"Banking", "Contacts":{ "records":[ { "attributes":{ "type":"Contact", "referenceId":"ref2"}, "lastname":"Smith", "title":"President", "email":"sample@salesforce.com" },{ "attributes":{"type":"Contact", "referenceId":"ref3" }, "lastname":"Evans", "title":"Vice President", "email":"sample@salesforce.com" } ] } },{ "attributes":{ "type":"Account", "referenceId":"ref4"}, "name":"SampleAccount2", "phone":"1234567890", "website":"www.salesforce2.com", "numberofEmployees":"100", "industry":"Banking" } ] }
  • 12.
  • 13.
    Consumer Key The consumerkey for the Salesforce connected app Consumer Secret The consumer secret for the connector to access Salesforce Username The Salesforce username Password The corresponding password Security Token The corresponding security token Required Parameters 13
  • 14.
  • 15.
    Get ready toWIN a Special Gift from MuleSoft Community Quiz Time
  • 16.
    Question 1 Requests ina composite call are called...? a. Subrequests b. Duplicaterequests c. Childrequests d. None of the Above 16
  • 17.
    Question 2 What ismax Object limit of Composite Request? a. 15 b. 20 c. 25 d. 30 17
  • 18.
    Question 3 How manyobjects does sObject collection support in one single request? a. 100 b. 200 c. 300 d. 400 18
  • 19.
    19 Share: ○ Tweet yourpictures using the hashtag #SuratMuleSoftMeetup ○ Invite your network to join: https://meetups.mulesoft.com/surat/ Feedback: ○ Fill out the survey feedback and suggest topics for upcoming events ○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program ○ Reach out to either Jitendra Bafna or Nitish Jainto suggest topics for next Meetup What’s next?
  • 20.