Oct 21, 2020
Toronto MuleSoft Meetup Group
How to use Salesforce composite request connector
in Mule
3
● Introductions
● How to use Salesforce composite request connector in Mule
● What’s next?
● Next event
Agenda
#MuleSoftMeetups
4
Organizers
#MuleSoftMeetups
Alexandra Martinez
Senior MuleSoft Developer
at Bits In Glass
MuleSoft Ambassadress
Founder and Content
Creator at ProstDev
3+ years using MuleSoft
5x MuleSoft certified
Mahesh Pujari
MuleSoft Developer
at Mackenzie Investments
Around 6 years of
integration expertise
Pravallika Nagaraja
Senior MuleSoft Developer
at Roche
Overall 10 years of
experience developing
integration solutions using
MuleSoft and other
integration technologies
3+ years using MuleSoft
4x MuleSoft certified
Content Creator at
ProstDev
Kishore Reddy Paluri
Senior Consultant
at MuleSoft
Certified Solutions Architect
14+ years of experience
building Integration, ESB,
SOA, API, Security and
Middleware solutions on
Cloud, On-Prem, and
Hybrid environments
Rajiv Mishra
Associate at Cognizant Technology Solutions
How to use Salesforce composite
request connector in Mule
6
● Introductions
● What is Salesforce composite connector?
● What exactly sObject Tree , sObjectCollection , BATCH & Execute composite request
operation?
● How composite request operation works in MULE .
● Advantages of using composite connector.
● Q&A.
Agenda
7
● Associate -Projects in Cognizant Technology Solutions
● Over 9+ Years of experience in Integration Platform .
● MULE Certified Developer .
Introduction.
8
● The Anypoint Connector for Salesforce Composite provides a way to integrate with Salesforce
Composite API which enables MULE to use a single API call to access several individual
Salesforce services .
● The connector exposes convenient methods for preparing sub-requests, execute them in one
batch and parse the results.
● The response bodies and HTTP status of the requests are returned in a single response body.
The entire series of requests counts as a single call toward your API limits.
● The requests in a composite call are called subrequests.
● All subrequests are executed in the context of the same user.
Composite connector.
9
● An sObject tree is a collection of nested, parent-child records with a single root record.
● Up to a total of 200 records across all trees
● hasErrors field : True/False indicate success/failure in response .
sObject Tree.
10
● An sObject collection execute actions on multiple records aka Objects in one request.
● Max 200 objects can processed in one go .
● allOrNone field : true/false option to specify a rollback behavior in the case of partial failure.
sObject Collection.
11
● Batch allows up to 25 separate unrelated actions to be executed in a single call.
● Each executes independently and information is not shared between the calls.
● haltOnError field : true/false option to specify if batch should stop processing in the case of sub-
request failed . Default is false .
Batch.
12
● Output of one request can be used as the input to a subsequent request .
● Sequentially execute a series of actions in a single call .
● Max 25 Objects allows in single request .
● allOrNone field : true/false option to specify a rollback behavior in the case of partial failure.
Composite.
13
● Anypoint version 6.3.0
● Mule Runtime version: 3.9.1
● In the mule palette , type Salesforce composite
Composite Set Up .
14
● Username:Username used to initialize the session
● Password:Password used to authenticate the user
● Consumer Key:Consumer key for Salesforce connected app.
● Consumer Secret:Your application’s client secret (consumer secret in Remote Access Detail).
● Security Token:User’s security token. It can be omitted if your IP has been white listed on Salesforce.
Salesforce Composite Global set up.
15
Consider a scenario ,we need to update the Account and contact, where Contact has the relationship
with Account and it only can be updated using Account ID .
Continue..
16
Mule Flow
Continue..
17
Salesforce Composite Operation  Execute composite request
Continue..
18
Composite response:
Continue..
19
Consider same scenario without using composite .
The flow will look like something like this
Continue..
20
● Reducing Processing time and no of API call .
● In the above example we have seen that the interaction is happening within 1 call so the round trip
execution time much shorter in compare to individual call.
● Offers the ability to create a collection of nested parent-child records.
● Enables a user to execute dependent requests in a single API call. For example, use the connector to
invoke a single composite resource that creates an account and retrieves its information to use it to
create a contact.
Advantages..
Quiz time!
How does the quiz work?
1. Organizers show the question.
2. Organizers read the question out loud.
3. Organizers will write in the chat the following message: “Answers from question n start
here” after reading the question.
4. Only answers that appear after this message will be taken into account.
5. A final raffle, with the people that answered the quiz correctly, will take place after the quiz,
where the 3 lucky winners will receive a training or certification voucher.
6. The 3 winners will send their email in the chat so we can contact them for further steps.
22
#MuleSoftMeetups
Rules:
1. First person to give the correct answer in the chat will enter the final raffle.
2. If you already answered one question correctly, please stop answering and give a chance to
the rest. You don’t receive “extra points” for answering correctly more than once.
3. If the answer is sent before the “Answers from question n start here” message appears in the
chat, it won’t be taken into account.
23
#MuleSoftMeetups
1. Requests in a composite call are called…?
24
#MuleSoftMeetups
1. Requests in a composite call are called…?
A: Subrequests
25
#MuleSoftMeetups
2. For sObject tree what is the field name which
indicates success/failure in the response?
26
#MuleSoftMeetups
2. For sObject tree what is the field name which
indicates success/failure in the response?
A: hasErrors
27
#MuleSoftMeetups
3. How many objects does sObject collection
support in one single request?
28
#MuleSoftMeetups
3. How many objects does sObject collection
support in one single request?
A: 200
29
#MuleSoftMeetups
4. What is the field name and value in BATCH
request to roll-back the whole transaction in a
single request?
30
#MuleSoftMeetups
4. What is the field name and value in BATCH
request to roll-back the whole transaction in a
single request?
A: haltOnError-true
31
#MuleSoftMeetups
5. What is max Object limit of CompositeRequest?
32
#MuleSoftMeetups
5. What is max Object limit of CompositeRequest?
A: 25
33
#MuleSoftMeetups
6. Which operation best suites in case we need to
execute sequentially in a single call?
34
#MuleSoftMeetups
6. Which operation best suites in case we need to
execute sequentially in a single call?
A: Composite
35
#MuleSoftMeetups
7. All subrequests are executed in the context of
the same user?
36
#MuleSoftMeetups
7. All subrequests are executed in the context of
the same user?
A: True
37
#MuleSoftMeetups
8. Is the Consumer Secret a mandatory parameter
to setup the Composite connector in Mule?
38
#MuleSoftMeetups
8. Is the Consumer Secret a mandatory parameter
to setup the Composite connector in Mule?
A: True
39
#MuleSoftMeetups
40
● Share:
○ Tweet using the hashtag #MuleSoftMeetups
○ Invite your network to join: https://meetups.mulesoft.com/toronto/
● Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program
What’s next?
#MuleSoftMeetups
41
● Toronto Virtual Meetup #7 – Anypoint VPC, VPN and DLB Architecture
○ Tue, Nov 3, 2020
○ 5:30 PM (EDT)
● Speaker:
○ Jitendra Bafna
○ Senior Solution Architect at Capgemini
● https://meetups.mulesoft.com/events/details/mulesoft-toronto-presents-toronto-virtual-meetup-
7-anypoint-vpc-vpn-and-dlb-architecture/#/
Next event
#MuleSoftMeetups
Thank you

How to use Salesforce composite request connector in Mule

  • 1.
    Oct 21, 2020 TorontoMuleSoft Meetup Group How to use Salesforce composite request connector in Mule
  • 2.
    3 ● Introductions ● Howto use Salesforce composite request connector in Mule ● What’s next? ● Next event Agenda #MuleSoftMeetups
  • 3.
    4 Organizers #MuleSoftMeetups Alexandra Martinez Senior MuleSoftDeveloper at Bits In Glass MuleSoft Ambassadress Founder and Content Creator at ProstDev 3+ years using MuleSoft 5x MuleSoft certified Mahesh Pujari MuleSoft Developer at Mackenzie Investments Around 6 years of integration expertise Pravallika Nagaraja Senior MuleSoft Developer at Roche Overall 10 years of experience developing integration solutions using MuleSoft and other integration technologies 3+ years using MuleSoft 4x MuleSoft certified Content Creator at ProstDev Kishore Reddy Paluri Senior Consultant at MuleSoft Certified Solutions Architect 14+ years of experience building Integration, ESB, SOA, API, Security and Middleware solutions on Cloud, On-Prem, and Hybrid environments
  • 4.
    Rajiv Mishra Associate atCognizant Technology Solutions How to use Salesforce composite request connector in Mule
  • 5.
    6 ● Introductions ● Whatis Salesforce composite connector? ● What exactly sObject Tree , sObjectCollection , BATCH & Execute composite request operation? ● How composite request operation works in MULE . ● Advantages of using composite connector. ● Q&A. Agenda
  • 6.
    7 ● Associate -Projectsin Cognizant Technology Solutions ● Over 9+ Years of experience in Integration Platform . ● MULE Certified Developer . Introduction.
  • 7.
    8 ● The AnypointConnector for Salesforce Composite provides a way to integrate with Salesforce Composite API which enables MULE to use a single API call to access several individual Salesforce services . ● The connector exposes convenient methods for preparing sub-requests, execute them in one batch and parse the results. ● The response bodies and HTTP status of the requests are returned in a single response body. The entire series of requests counts as a single call toward your API limits. ● The requests in a composite call are called subrequests. ● All subrequests are executed in the context of the same user. Composite connector.
  • 8.
    9 ● An sObjecttree is a collection of nested, parent-child records with a single root record. ● Up to a total of 200 records across all trees ● hasErrors field : True/False indicate success/failure in response . sObject Tree.
  • 9.
    10 ● An sObjectcollection execute actions on multiple records aka Objects in one request. ● Max 200 objects can processed in one go . ● allOrNone field : true/false option to specify a rollback behavior in the case of partial failure. sObject Collection.
  • 10.
    11 ● Batch allowsup to 25 separate unrelated actions to be executed in a single call. ● Each executes independently and information is not shared between the calls. ● haltOnError field : true/false option to specify if batch should stop processing in the case of sub- request failed . Default is false . Batch.
  • 11.
    12 ● Output ofone request can be used as the input to a subsequent request . ● Sequentially execute a series of actions in a single call . ● Max 25 Objects allows in single request . ● allOrNone field : true/false option to specify a rollback behavior in the case of partial failure. Composite.
  • 12.
    13 ● Anypoint version6.3.0 ● Mule Runtime version: 3.9.1 ● In the mule palette , type Salesforce composite Composite Set Up .
  • 13.
    14 ● Username:Username usedto initialize the session ● Password:Password used to authenticate the user ● Consumer Key:Consumer key for Salesforce connected app. ● Consumer Secret:Your application’s client secret (consumer secret in Remote Access Detail). ● Security Token:User’s security token. It can be omitted if your IP has been white listed on Salesforce. Salesforce Composite Global set up.
  • 14.
    15 Consider a scenario,we need to update the Account and contact, where Contact has the relationship with Account and it only can be updated using Account ID . Continue..
  • 15.
  • 16.
    17 Salesforce Composite Operation Execute composite request Continue..
  • 17.
  • 18.
    19 Consider same scenariowithout using composite . The flow will look like something like this Continue..
  • 19.
    20 ● Reducing Processingtime and no of API call . ● In the above example we have seen that the interaction is happening within 1 call so the round trip execution time much shorter in compare to individual call. ● Offers the ability to create a collection of nested parent-child records. ● Enables a user to execute dependent requests in a single API call. For example, use the connector to invoke a single composite resource that creates an account and retrieves its information to use it to create a contact. Advantages..
  • 20.
  • 21.
    How does thequiz work? 1. Organizers show the question. 2. Organizers read the question out loud. 3. Organizers will write in the chat the following message: “Answers from question n start here” after reading the question. 4. Only answers that appear after this message will be taken into account. 5. A final raffle, with the people that answered the quiz correctly, will take place after the quiz, where the 3 lucky winners will receive a training or certification voucher. 6. The 3 winners will send their email in the chat so we can contact them for further steps. 22 #MuleSoftMeetups
  • 22.
    Rules: 1. First personto give the correct answer in the chat will enter the final raffle. 2. If you already answered one question correctly, please stop answering and give a chance to the rest. You don’t receive “extra points” for answering correctly more than once. 3. If the answer is sent before the “Answers from question n start here” message appears in the chat, it won’t be taken into account. 23 #MuleSoftMeetups
  • 23.
    1. Requests ina composite call are called…? 24 #MuleSoftMeetups
  • 24.
    1. Requests ina composite call are called…? A: Subrequests 25 #MuleSoftMeetups
  • 25.
    2. For sObjecttree what is the field name which indicates success/failure in the response? 26 #MuleSoftMeetups
  • 26.
    2. For sObjecttree what is the field name which indicates success/failure in the response? A: hasErrors 27 #MuleSoftMeetups
  • 27.
    3. How manyobjects does sObject collection support in one single request? 28 #MuleSoftMeetups
  • 28.
    3. How manyobjects does sObject collection support in one single request? A: 200 29 #MuleSoftMeetups
  • 29.
    4. What isthe field name and value in BATCH request to roll-back the whole transaction in a single request? 30 #MuleSoftMeetups
  • 30.
    4. What isthe field name and value in BATCH request to roll-back the whole transaction in a single request? A: haltOnError-true 31 #MuleSoftMeetups
  • 31.
    5. What ismax Object limit of CompositeRequest? 32 #MuleSoftMeetups
  • 32.
    5. What ismax Object limit of CompositeRequest? A: 25 33 #MuleSoftMeetups
  • 33.
    6. Which operationbest suites in case we need to execute sequentially in a single call? 34 #MuleSoftMeetups
  • 34.
    6. Which operationbest suites in case we need to execute sequentially in a single call? A: Composite 35 #MuleSoftMeetups
  • 35.
    7. All subrequestsare executed in the context of the same user? 36 #MuleSoftMeetups
  • 36.
    7. All subrequestsare executed in the context of the same user? A: True 37 #MuleSoftMeetups
  • 37.
    8. Is theConsumer Secret a mandatory parameter to setup the Composite connector in Mule? 38 #MuleSoftMeetups
  • 38.
    8. Is theConsumer Secret a mandatory parameter to setup the Composite connector in Mule? A: True 39 #MuleSoftMeetups
  • 39.
    40 ● Share: ○ Tweetusing the hashtag #MuleSoftMeetups ○ Invite your network to join: https://meetups.mulesoft.com/toronto/ ● Feedback: ○ Fill out the survey feedback and suggest topics for upcoming events ○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program What’s next? #MuleSoftMeetups
  • 40.
    41 ● Toronto VirtualMeetup #7 – Anypoint VPC, VPN and DLB Architecture ○ Tue, Nov 3, 2020 ○ 5:30 PM (EDT) ● Speaker: ○ Jitendra Bafna ○ Senior Solution Architect at Capgemini ● https://meetups.mulesoft.com/events/details/mulesoft-toronto-presents-toronto-virtual-meetup- 7-anypoint-vpc-vpn-and-dlb-architecture/#/ Next event #MuleSoftMeetups
  • 41.