The Anypoint(TM) Connector for Salesforce Composite provides you a way to integrate with Salesforce Composite API link:https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite.htm[Salesforce Composite API]. The connector exposes convenient methods for preparing sub-requests, execute them in one batch and parse the results. It provides DataSense on both preparation of sub-requests and parsing response of their execution.

Additional Info

Requires Mule Enterprise License

Yes  

Requires Entitlement

No  

Mule Version

3.7.0 or higher

Configs


Configuration

<sfdc-composite:config>

Connection Management

Salesforce Composite connector configuration that uses "OAuth 2.0 Username-Password" authentication for establishing connection with Salesforce system.

Attributes

Name Java Type Description Default Value Required

name

String

The name of this configuration. With this name can be later referenced.

x 

username

String

Username used to initialize the session

x 

password

String

Password used to authenticate the user

x 

consumerKey

String

Your application's client identifier (consumer key in Remote Access Detail).

x 

consumerSecret

String

Your application's client secret (consumer secret in Remote Access Detail).

x 

securityToken

String

User's security token. It can be omitted if your IP has been whitelisted on Salesforce

x 

tokenEndpoint

String

URL pointing the server responsible of providing authentication token. According to Salesforce it should be https://login.salesforce.com/services/oauth2/token, or, if implementing for a community, https://acme.force.com/customers/services/oauth2/token (where acme.force.com/customers is your community URL).

https://login.salesforce.com/services/oauth2/token

 

proxyHost

String

 

proxyPort

Integer

 

proxyUsername

String

 

proxyPassword

String

 

Processors


Pre create

<sfdc-composite:pre-create>

  DataSense enabled

The purpose of this method is to provide metadata for create based on object that is going to be created and generates a sub-request to be given for execution to org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).

XML Sample

<sfdc-composite:pre-create config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config" type="#[map-payload:type]"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

type

String

- type of object that is going to be created

x 

sObject

Map<String,Object>

- object that is going to be created as a map that sticks to metadata for selected type

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

Map<String,Object>

generated sub-request that is going to be executed by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String,


Post create

<sfdc-composite:post-create>

The purpose of this method is to provide metadata for the result of create. It takes as input one record from the result returned by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List) which belongs to create sub-request generated by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#preCreate(String, java.util.Map).

XML Sample

<sfdc-composite:post-create config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config" type="#[map-payload:type]"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

createResult

Map<String,Object>

- the result of create sub-request

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

Map<String,Object>

transformed result in format that sticks to metadata for create method


Pre update

<sfdc-composite:pre-update>

  DataSense enabled

The purpose of this method is to provide metadata for update based on object that is going to be updated and generates a sub-request to be given for execution to org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(java.util.List, MuleEvent).

XML Sample

<sfdc-composite:pre-update config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config" type="#[map-payload:type]"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

type

String

- type of object that is going to be updated

x 

sObject

Map<String,Object>

- object that is going to be updated as a map that sticks to metadata for selected type

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

Map<String,Object>

generated sub-request that is going to be executed by List, MuleEvent)


Post update

<sfdc-composite:post-update>

The purpose of this method is to provide metadata for the result of update. It takes as input one record from the result returned by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List) which belongs to update sub-request generated by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#preUpdate(String, java.util.Map).

XML Sample

<sfdc-composite:post-update config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

updateResult

Map<String,Object>

- the result of update sub-request

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 


Pre delete

<sfdc-composite:pre-delete>

  DataSense enabled

The purpose of this method is to provide metadata for delete based on object that is going to be deleted and generates a sub-request to be given for execution to org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).

XML Sample

<sfdc-composite:pre-delete config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config" type="#[map-payload:type]"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

type

String

- type of object that is going to be deleted

x 

sObject

Map<String,Object>

- map with the id of the object that is going to be deleted mapped to "Id" key

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

Map<String,Object>

generated sub-request that is going to be executed by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String,


Post delete

<sfdc-composite:post-delete>

The purpose of this method is to provide metadata for the result of delete. It takes as input one record from the result returned by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List) which belongs to delete sub-request generated by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#preDelete(String, java.util.Map).

XML Sample

<sfdc-composite:post-delete config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

deleteResult

Map<String,Object>

- the result of delete sub-request

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 


Pre get limits

<sfdc-composite:pre-get-limits>

The purpose of this method is to provide metadata for getLimits and generates a sub-request to be given for execution to org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).

XML Sample

<sfdc-composite:pre-get-limits config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config"
            subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

Map<String,Object>

generated sub-request that is going to be executed by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String,


Post get limits

<sfdc-composite:post-get-limits>

The purpose of this method is to provide metadata for the result of create. It takes as input one record from the result returned by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List) which belongs to create sub-request generated by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#preCreate(String, java.util.Map).

XML Sample

<sfdc-composite:post-get-limits config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config"
            subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

getLimitsResult

Map<String,Object>

- the result of create sub-request

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

Map<String,Object>

transformed result in format that sticks to metadata for create method


Pre query

<sfdc-composite:pre-query>

The purpose of this method is to provide metadata for query based on object that is going to be queried and generates a sub-request to be given for execution to org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).

XML Sample

<sfdc-composite:pre-query config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config" query="dsql:SELECT Id,Name,Type FROM Account"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

query

String

- the query that is going to be ran in executeCompositeBatch

x 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

Map<String,Object>

generated sub-request that is going to be executed by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(java.util.List)


Pre query all

<sfdc-composite:pre-query-all>

The purpose of this method is to provide metadata for query based on object that is going to be queried and generates a sub-request to be given for execution to org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).

XML Sample

<sfdc-composite:pre-query-all config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config" query="dsql:SELECT Id,Name,Type FROM Account"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

query

String

- the query that is going to be ran in executeCompositeBatch

x 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

Map<String,Object>

generated sub-request that is going to be executed by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(java.util.List)


Post query

<sfdc-composite:post-query>

  Paged Operation

The purpose of this method is to provide metadata for the result of query. It takes as input one record from the result returned by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List) which belongs to query sub-request generated by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#preQuery(String, java.util.Map).

XML Sample

<sfdc-composite:post-query config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config" query="dsql:SELECT Id,Name,Type FROM Account"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

query

String

- the query ran in executeCompositeBatch - needed for datasense, to bring the output metadata

x 

queryResult

Map<String,Object>

- the result of query sub-request

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

pagingConfiguration

PagingConfiguration

- Paging configuration

x 

Returns

Return Java Type Description

ProviderAwarePagingDelegate<Map<String,Object>,SalesforceCompositeConnector>

transformed result in format that sticks to metadata for query method


Post query all

<sfdc-composite:post-query-all>

  Paged Operation

The purpose of this method is to provide metadata for the result of create. It takes as input one record from the result returned by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List) which belongs to create sub-request generated by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#preCreate(String, java.util.Map).

XML Sample

<sfdc-composite:post-query-all config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config" query="dsql:SELECT Id,Name,Type FROM Account"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

query

String

- the query ran in executeCompositeBatch - needed for datasense, to bring the output metadata

x 

queryResult

Map<String,Object>

- the result of create sub-request

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

pagingConfiguration

PagingConfiguration

- Paging configuration

x 

Returns

Return Java Type Description

ProviderAwarePagingDelegate<Map<String,Object>,SalesforceCompositeConnector>

transformed result in format that sticks to metadata for create method


<sfdc-composite:pre-search>

The purpose of this method is to provide the user a way to input a SOSL String and generates a sub-request to be given for execution to org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(java.util.List).

XML Sample

<sfdc-composite:pre-search config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config" doc:name="Salesforce Composite Batch" search="'FIND {Acme*} IN Name FIELDS RETURNING Contact(Id, Phone, FirstName, LastName), Account(Id, Phone, Name)'"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

search

String

- the SOSL string that is going to be ran in executeCompositeBatch

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

Map<String,Object>

generated sub-request that is going to be executed by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(java.util.List)


Post search

<sfdc-composite:post-search>

The purpose of this method is to provide metadata for the result of search. It takes as input one record from the result returned by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List) which belongs to search sub-request generated by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#preSearch(String, java.util.Map).

XML Sample

<sfdc-composite:post-search config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config" doc:name="Salesforce Composite Batch"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

searchResult

Map<String,Object>

- the result of search sub-request

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

List<Map<String,Object>>

transformed result in format that sticks to metadata for search method


Execute composite batch

<sfdc-composite:execute-composite-batch>

Sends all the sub-requests in one batch for execution to server.

XML Sample

<sfdc-composite:execute-composite-batch config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

subRequests

List<Map<String,Object>>

- sub-requests to be sent to server

#[payload]

 

Returns

Return Java Type Description

List<Map<String,Object>>

the list of responses that the server returned


Create sobject tree

<sfdc-composite:create-sobject-tree>

  DataSense enabled

Sends a list of SObject trees to Salesforce to be created.

XML Sample

<sfdc-composite:create-sobject-tree config-ref="Salesforce_Composite__Configuration" type="Account" doc:name="Salesforce Composite"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

type

String

- the sObject type of the root of the trees

x 

sObjects

List<Map<String,Object>>

- a list of maps containing representing the list of trees that need to be created

#[payload]

 

Returns

Return Java Type Description

Map<String,Object>

the response sent by Salesforce


Pre retrieve

<sfdc-composite:pre-retrieve>

  DataSense enabled

The purpose of this method is to provide metadata for retrieve based on object that is going to be retrieved and generates a sub-request to be given for execution to org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).

XML Sample

<sfdc-composite:pre-retrieve config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config" type="#[map-payload:type]"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

retrieveData

Map<String,Object>

- object that is going to be retrieved as a map that sticks to metadata for selected type

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

Map<String,Object>

generated sub-request that is going to be executed by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(java.util.List)


Post retrieve

<sfdc-composite:post-retrieve>

  DataSense enabled

The purpose of this method is to provide metadata for the result of retrieve. It takes as input one record from the result returned by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List) which belongs to retrieve sub-request generated by org.mule.modules.salesforce.composite.SalesforceCompositeConnector#preRetrieve(String, java.util.Map).

XML Sample

<sfdc-composite:post-retrieve config-ref="Salesforce_Composite_Batch__Basic_Auth_type_config"
        subRequestCorrelationId="#[map-payload:subRequestCorrelationId]"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

type

String

- type of object that is going to be retrieved

x 

retrieveData

Map<String,Object>

- the result of retrieve sub-request

#[payload]

 

subRequestCorrelationId

String

- this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result

x 

Returns

Return Java Type Description

Map<String,Object>

transformed result in format that sticks to metadata for retrieve method