| Namespace | http://www.mulesoft.org/schema/mule/sfdc |
| Schema Location | http://www.mulesoft.org/schema/mule/sfdc/current/mule-sfdc.xsd (View Schema) |
| Schema Version | 5.0 |
| Minimum Mule Version | 3.5 |
Module Overview
The Salesforce Connector will allow to connect to the Salesforce application using OAuth as the authentication
mechanism. Almost every operation that can be done via the Salesforce's API can be done thru this connector.
This connector will also work if your Salesforce objects are customized with additional fields or even you are
working with custom objects.
Integrating with Salesforce consists of web service calls utilizing XML request/response setup
over an HTTPS connection. The technical details of this connection such as request headers,
error handling, HTTPS connection, etc. are all abstracted from the user to make implementation
quick and easy.
This version of the connector allows you to use OAuth for authentication instead of the
username/password/securityToken combination.
Summary
Utility Calls API calls that your client applications can invoke to obtain the system timestamp, user information, and change user passwords. |
|
<sfdc:get-updated-objects>
Retrieves the list of records that have been updated between the last time this method was called and now.
|
|
<sfdc:get-user-info>
Retrieves personal information for the user associated with the current session.
|
|
<sfdc:reset-updated-objects-timestamp>
Resets the timestamp of the last updated object.
|
|
<sfdc:set-password>
Change the password of a User or SelfServiceUser to a value that you specify.
|
Streaming API Create topics, to which applications can subscribe, receiving asynchronous notifications of changes to data in Salesforce, via the Bayeux protocol. |
|
<sfdc:publish-topic>
Creates a topic which represents a query that is the basis for notifying
listeners of changes to records in an organization.
|
|
<sfdc:subscribe-topic>
Subscribe to a topic.
|
Describe Calls A set of calls to describe record structure in Salesforce. |
|
<sfdc:describe-global>
Retrieves a list of available objects for your organization's data.
|
|
<sfdc:describe-sobject>
Describes metadata (field list and object properties) for the specified object.
|
Core Calls A set of calls that compromise the core of the API. |
|
<sfdc:convert-lead>
Converts a Lead into an Account, Contact, or (optionally) an Opportunity.
|
|
<sfdc:create>
Adds one or more new records to your organization's data.
|
|
<sfdc:create-single>
Adds one new records to your organization's data.
|
|
<sfdc:delete>
Deletes one or more records from your organization's data.
|
|
<sfdc:empty-recycle-bin>
The recycle bin lets you view and restore recently deleted records for 30 days before they are
permanently deleted.
|
|
<sfdc:get-deleted>
Retrieves the list of individual records that have been deleted between the range of now to the duration before now.
|
|
<sfdc:get-deleted-range>
Retrieves the list of individual records that have been deleted within the given timespan for the specified object.
|
|
<sfdc:get-server-timestamp>
Retrieves the current system timestamp (Coordinated Universal Time (UTC) time zone) from the API.
|
|
<sfdc:get-updated>
Retrieves the list of individual records that have been updated between the range of now to the duration before now.
|
|
<sfdc:get-updated-range>
Retrieves the list of individual records that have been created/updated within the given timespan for the specified object.
|
|
<sfdc:paginated-query>
Executes a paginated query against the specified object and returns data that matches the specified criteria.
|
|
<sfdc:query>
Executes a query against the specified object and returns data that matches the specified criteria.
|
|
<sfdc:query-all>
Retrieves data from specified objects, whether or not they have been deleted.
|
|
<sfdc:query-single>
Executes a query against the specified object and returns the first record that matches the specified criteria.
|
|
<sfdc:retrieve>
Retrieves one or more records based on the specified IDs.
|
<sfdc:search>
Search for objects using Salesforce Object Search Language
|
|
<sfdc:update>
Updates one or more existing records in your organization's data.
|
|
<sfdc:update-single>
Updates one or more existing records in your organization's data.
|
<sfdc:upsert>
Upserts
an homogeneous list of objects: creates new records and updates existing records, using a custom field to determine the presence of existing records.
|
Configuration
To use the this module within a flow the namespace to the module must be included. The resulting flow will look
similar to the following:
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sfdc="http://www.mulesoft.org/schema/mule/sfdc"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/sfdc
http://www.mulesoft.org/schema/mule/sfdc/current/mule-sfdc.xsd">
<!-- here goes your flows and configuration elements -->
</mule>
This module is configured using the config element. This element must be placed outside of your flows and at
the root of your Mule application. You can create as many configurations as you deem necessary as long as each carries
its own name.
Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to
specify which configuration to use.
| Attributes |
| Type | Name | Default Value | Description | Java Type | MIME Type | Encoding |
xs:string |
name |
|
Optional. Give a name to this configuration so it can be later referenced. |
| | |
|
xs:string |
consumerKey |
|
Your application's client identifier (consumer key in Remote Access Detail). |
|
|
|
|
xs:string |
consumerSecret |
|
Your application's client secret (consumer secret in Remote Access Detail). |
|
|
|
| xs:string |
authorizationUrl |
https://test.salesforce.com/services/oauth2/authorize |
Optional. The URL defined by the Service Provider where the resource owner will be redirected to grant authorization to the connector |
| xs:string |
accessTokenUrl |
https://test.salesforce.com/services/oauth2/token |
Optional. The URL defined by the Service Provider to obtain an access token |
OAuth2
This connector uses OAuth2 as an authorization and authentication mechanism. All the message processors or sources that require the connector
to be authorized by the service provider will throw a NotAuthorizedException until the connector is authorized properly.
Authorizing the connector is a simple process of calling:
<sfdc:authorize/>
The call to authorize the message processor must be made though a message coming from an HTTP inbound endpoint as the authorize process will
reply with a redirect to the service provider. The following is an example of how to use it in a flow with an HTTP inbound endpoint:
<flow name="authorizationAndAuthenticationFlow">
<http:inbound-endpoint host="localhost" port="8080" path="oauth-authorize"/>
<sfdc:authorize/>
</flow>
If you hit that endpoint via a web-browser it will initiate the OAuth dance, redirecting the user to the service provider page
and creating a callback endpoint so the service provider can call us back once the user has been authenticated. Once the callback
gets called then the connector will switch to an authorized state and any message processor or source that requires authentication
can be called.
The authorize message processor supports the following attributes:
| Authorize Attributes |
| Name | Default Value | Description |
| display |
|
Optional. Tailors the login page to the user\'s device type. |
| immediate |
FALSE |
Optional. Avoid interacting with the user. |
| prompt |
|
Optional. Specifies how the authorization server prompts the user for reauthentication and reapproval. |
| authorizationUrl |
https://test.salesforce.com/services/oauth2/authorize |
Optional. The URL defined by the Service Provider where the resource owner will be redirected to grant authorization to the connector |
| accessTokenUrl |
https://test.salesforce.com/services/oauth2/token |
Optional. The URL defined by the Service Provider to obtain an access token |
| accessTokenId |
|
Optional. The Id with which the obtained access token will be stored. If not provided, then it will be the config name |
After Authorization
The authorize message processor is an intercepting one. If something that requires authentication is requested but the connector
is not authorized yet, the authorize message processor will be triggered. It will redirect the user to the service provider so that he can authorize
the connector. This is why the authorize message processor needs to be behind an http:inbound-endpoint. Once authentication and authorization
are successful, the service provider will respond to the connector with a callback. The connector will extract information from this callback, set
its own internal state to authorized, and then move on to executing anything that had been interrupted by the authorization method.
<flow name="authorizationAndAuthenticationFlow">
<http:inbound-endpoint host="localhost" port="8080" path="oauth-authorize"/>
<sfdc:authorize/>
<http:response-builder status="200">
<set-payload value="You have successfully authorized the connector"/>
</http:response-builder>
</flow>
In the above example we added the http:response-builder (keep in mind that this element is available only in Mule 3.3.0 and later). If
the connector is not yet authorized, the execution of the response builder will be delayed until the callback is received.
On the other hand, if the connector had already been authorized before, then the flow execution will not be delayed; it will
continue and the http:response-builder will get executed right away rather than after the callback.
Error Handling during Authorization
If for any reason, an error occurs while processing the callback, the exception strategy of the flow containing the authorize will be executed.
So, if the callback sent the wrong information you can handle that situation by setting up an exception strategy as follows:
<flow name="authorizationAndAuthenticationFlow">
<http:inbound-endpoint host="localhost" port="8080" path="oauth-authorize"/>
<sfdc:authorize/>
<http:response-builder status="200">
<set-payload value="You have successfully authorized the connector"/>
</http:response-builder>
<catch-exception-strategy>
<http:response-builder status="404">
<set-payload value="An error has occurred authorizing the connector"/>
</http:response-builder>
</catch-exception-strategy>
</flow>
What happens if a tenant who is not yet authorized wants to perform an OAuth protected operation? You can set this with the onNoToken property:
<sfdc:config name="sfdcs" consumerKey="${consumerKey}" consumerSecret="${consumerSecret}" onNoToken="[STOP_FLOW|EXCEPTION]">
<sfdc:oauth-callback-config connector-ref="${oauth.http.connector}" domain="${oauth.url}" localPort="${https.port}" async="false" path="oauth2callback" />
</google-calendars:config-with-oauth>
The onNoToken property can be set to two different values:
- STOP_FLOW: acts as a filter and kills the execution of the flow
- EXCEPTION: throws an exception informing that the token is still not acquired
Unauthorize
Once this connector has been authorized further calls to the authorize message processor will be no-ops.
If you wish to reset the state of the connector back to a non-authorized state you must call:
<sfdc:unauthorize/>
Keep in mind that after the connector is unauthorized all future calls that attempt to access protected resources will fail until
the connector is re-authorized.
Callback Customization
As mentioned earlier, once authorize gets called and before we redirect the user to the service provider, we create a callback endpoint.
The callback endpoint will get called automatically by the service provider once the user is authenticated and he grants authorization to
the connector to access his private information.
The callback can be customized in the config element of the this connector as follows:
<sfdc:config>
<sfdc:oauth-callback-config domain="${fullDomain}" localPort="${http.port}" remotePort="80" defaultAccessTokenId="#[message.inboundProperties['tenantId']]" />
</sfdc:config>
The oauth-callback-config element can be used to customize the endpoint that gets created for the callback. It
features the following attributes:
| OAuth Callback Config Attributes |
| Name | Description |
| connector-ref |
Optional. Reference to a user-defined HTTP connector. |
| domain |
Optional. The domain portion of the callback URL. This is usually something like xxx.cloudhub.io if you are deploying to CloudHub for example. |
| localPort |
Optional. The local port number that the endpoint will listen on. Normally 80, in the case of CloudHub you can use the environment variable ${http.port}. |
| remotePort |
Optional. This is the port number that we will tell the service provider we are listening on. It is usually the same as localPort but it is separated in case your deployment features port forwarding or a proxy. |
| path |
Optional. Path under which the callback should be exposed. If not specified a random path will be generated. |
| defaultAccessTokenId |
Optional. A Mule Expression to use as access token id. If provided, this expression will be evaluated for all obtained access tokens and the result will be used as their id (except in the cases in which a specific acessTokenId was provided on the authorize processor |
The example shown above is what the configuration would look like if your app would be deployed to CloudHub.
Access Token Store
This connector has the capability of automatically saving and restoring access tokens. The connector will store in either the default user object store
or a user-defined one the acquired access tokens, refresh tokens, and any other pertinent information using the access token identifier as the key.
The object store can be configured as follows
<sfdc:config>
<sfdc:oauth-store-config objectStore-ref="my-object-store"/>
</sfdc:config>
There is only a single attribute entitled objectStore-ref in the oauth-store-config element that allows the user to specify the name
of the object store that he wishes to use to save and restore access tokens.
Another important aspect of the token store is the ids. This connector supports multi-tenancy, which means that each instance of this connector
is capable of supporting multiple concurrent users. Therefore, each access token is given an id to identify the owning tenant.
By default, the connector's config name is used the access token id. Also, by default, at the time of using a protected operation,
it's not mandatory to provide an accessTokenId since the config's name will also be used by default.
This defaults are fine for the single-tenant case or for CloudHub enabled multi-tenancy. If you are running on-premise or you are not using Cloudhub's multi-tenancy mode, there are a couple of ways in which you can easily handle your token ids manually.
First, you can specify a defaultAccessTokenId on the connector's callback element. Each time a callback is received, that expression will get evaluated and the resulting value will be used as the token id. At the same time, when using a protected operation
that expression will be evaluated to obtain the id of the access token to fetch.
Another option is to use to provide an accessTokenId expression on the authorize processor. If you do so, the expression's result will be used as the token id instead. Notice that if you choose to force the token id like this, then you also need to provide a matching accessTokenId expression on each
protected operation that uses that token.
Message Processors
<sfdc:get-updated-objects>
Retrieves the list of records that have been updated between the last time this method was called and now. This
method will save the timestamp of the latest date covered by Salesforce represented by GetUpdatedResult#latestDateCovered.
IMPORTANT: In order to use this method in a reliable way user must ensure that right after this method returns the result is
stored in a persistent way since the timestamp of the latest . In order to reset the latest update time
use resetUpdatedObjectsTimestamp
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Object type. The specified value must be a valid object for your organization. |
String |
*/* |
UTF-8 |
| initialTimeWindow |
|
Time window (in minutes) used to calculate the start time (in time range) the first time
this operation is called. E.g: if initialTimeWindow equals 2, the start time will be
the current time (now) minus 2 minutes, then the range to retrieve the updated object will
be (now - 2 minutes; now). After first call the start time will be calculated from the
object store getting the last time this operation was exec |
int |
*/* |
|
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:fields> |
#[payload] |
Optional. The fields to retrieve for the updated objects |
List<String> |
Returns
| Return Type |
Description |
| List<Map<String, Object>> |
List with the updated objects in the calculated time range |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:get-user-info>
Retrieves personal information for the user associated with the current session.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:reset-updated-objects-timestamp>
Resets the timestamp of the last updated object. After resetting this, a call to this#getUpdatedObjects will
use the initialTimeWindow to get the updated objects. If no timeObjectStore has been explicitly specified and this#getUpdatedObjects
has not been called then calling this method has no effect.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
The object type for which the timestamp should be reset. |
String |
*/* |
UTF-8 |
Exception Payloads
| Payload Class | Description |
| ObjectStoreException |
com.sforce.ws.ConnectionException when there is an error
|
<sfdc:set-password>
Change the password of a User or SelfServiceUser to a value that you specify.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| userId |
|
The user to set the password for. |
String |
*/* |
UTF-8 |
| newPassword |
|
The new password for the user. |
String |
*/* |
UTF-8 |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error
|
<sfdc:publish-topic>
Creates a topic which represents a query that is the basis for notifying
listeners of changes to records in an organization.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| topicName |
|
Descriptive name of the push topic, such as MyNewCases or TeamUpdatedContacts. The
maximum length is 25 characters. This value identifies the channel. |
String |
*/* |
UTF-8 |
| query |
|
The SOQL query statement that determines which records' changes trigger events to be sent to
the channel. Maximum length: 1200 characters |
String |
*/* |
UTF-8 |
| description |
|
Optional. Description of what kinds of records are returned by the query. Limit: 400 characters |
String |
*/* |
UTF-8 |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:describe-global>
Retrieves a list of available objects for your organization's data.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:describe-sobject>
Describes metadata (field list and object properties) for the specified object.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Object. The specified value must be a valid object for your organization. For a complete list
of objects, see Standard Objects |
String |
*/* |
UTF-8 |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:convert-lead>
Converts a Lead into an Account, Contact, or (optionally) an Opportunity.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| leadId |
|
ID of the Lead to convert. Required. For information on IDs, see ID Field Type. |
String |
*/* |
UTF-8 |
| contactId |
|
Optional. ID of the Contact into which the lead will be merged (this contact must be
associated with the specified accountId, and an accountId must be specified).
Required only when updating an existing contact.IMPORTANT if you are converting
a lead into a person account, do not specify the contactId or an error will result.
Specify only the accountId of the person account. If no contactID is specified,
then the API creates a new contact that is implicitly associated with the Account.
To create a new contact, the client application must be logged in with sufficient
access rights. To merge a lead into an existing contact, the client application
must be logged in with read/write access to the specified contact. The contact
name and other existing data are not overwritten (unless overwriteLeadSource is
set to true, in which case only the LeadSource field is overwritten).
For information on IDs, see ID Field Type. |
String |
*/* |
UTF-8 |
| accountId |
|
Optional. ID of the Account into which the lead will be merged. Required
only when updating an existing account, including person accounts.
If no accountID is specified, then the API creates a new account. To
create a new account, the client application must be logged in with
sufficient access rights. To merge a lead into an existing account,
the client application must be logged in with read/write access to the
specified account. The account name and other existing data are not overwritten.
For information on IDs, see ID Field Type. |
String |
*/* |
UTF-8 |
| overWriteLeadSource |
false |
Optional. Specifies whether to overwrite the LeadSource field on the target Contact object
with the contents of the LeadSource field in the source Lead object (true), or
not (false, the default). To set this field to true, the client application
must specify a contactId for the target contact. |
Boolean |
*/* |
|
| doNotCreateOpportunity |
false |
Optional. Specifies whether to create an Opportunity during lead conversion (false, the
default) or not (true). Set this flag to true only if you do not want to create
an opportunity from the lead. An opportunity is created by default. |
Boolean |
*/* |
|
| opportunityName |
|
Optional. Name of the opportunity to create. If no name is specified, then this value
defaults to the company name of the lead. The maximum length of this field is
80 characters. If doNotCreateOpportunity argument is true, then no Opportunity
is created and this field must be left blank; otherwise, an error is returned. |
String |
*/* |
UTF-8 |
| convertedStatus |
|
Valid LeadStatus value for a converted lead. Required.
To obtain the list of possible values, the client application queries the
LeadStatus object, as in:
Select Id, MasterLabel from LeadStatus where IsConverted=true |
String |
*/* |
UTF-8 |
| sendEmailToOwner |
false |
Optional. Specifies whether to send a notification email to the owner specified in the
ownerId (true) or not (false, the default). |
Boolean |
*/* |
|
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:create>
Adds one or more new records to your organization's data.
IMPORTANT: When you map your objects to the input of this message processor keep in mind that they need
to match the expected type of the object at Salesforce.
Take the CloseDate of an Opportunity as an example, if you set that field to a string of value "2011-12-13"
it will be sent to Salesforce as a string and operation will be rejected on the basis that CloseDate is not
of the expected type.
The proper way to actually map it is to generate a Java Date object, you can do so using Groovy expression
evaluator as
#[groovy:Date.parse("yyyy-MM-dd", "2011-12-13")].
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Type of object to create |
String |
*/* |
UTF-8 |
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:objects> |
#[payload] |
Optional. An array of one or more sObjects objects. |
List<Map<String, Object>> |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:create-single>
Adds one new records to your organization's data.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Type of object to create |
String |
*/* |
UTF-8 |
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:object> |
#[payload] |
Optional. SObject to create |
Map<String, Object> |
Returns
| Return Type |
Description |
| SaveResult |
An array of SaveResult |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:delete>
Deletes one or more records from your organization's data.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:ids> |
#[payload] |
Optional. Array of one or more IDs associated with the objects to delete. |
List<String> |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:empty-recycle-bin>
The recycle bin lets you view and restore recently deleted records for 30 days before they are
permanently deleted. Your organization can have up to 5000 records per license in the Recycle Bin at any
one time. For example, if your organization has five user licenses, 25,000 records can be stored in the
Recycle Bin. If your organization reaches its Recycle Bin limit, Salesforce.com automatically removes
the oldest records, as long as they have been in the recycle bin for at least two hours.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:ids> |
|
Array of one or more IDs associated with the records to delete from the recycle bin.
Maximum number of records is 200. |
List<String> |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:get-deleted>
Retrieves the list of individual records that have been deleted between the range of now to the duration before now.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Object type. The specified value must be a valid object for your organization. |
String |
*/* |
UTF-8 |
| duration |
|
The amount of time in minutes before now for which to return records from. |
int |
*/* |
|
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:get-deleted-range>
Retrieves the list of individual records that have been deleted within the given timespan for the specified object.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Object type. The specified value must be a valid object for your organization. |
String |
*/* |
UTF-8 |
| startTime |
|
Starting date/time (Coordinated Universal Time (UTC)not local timezone) of the timespan for
which to retrieve the data. The API ignores the seconds portion of the specified dateTime value '
(for example, 12:30:15 is interpreted as 12:30:00 UTC). |
Calendar |
*/* |
|
| endTime |
|
Optional. Ending date/time (Coordinated Universal Time (UTC)not local timezone) of the timespan for
which to retrieve the data. The API ignores the seconds portion of the specified dateTime value
(for example, 12:35:15 is interpreted as 12:35:00 UTC). If not specific, the current server
time will be used. |
Calendar |
*/* |
|
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:get-server-timestamp>
Retrieves the current system timestamp (Coordinated Universal Time (UTC) time zone) from the API.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
Returns
| Return Type |
Description |
| Calendar |
Calendar with the current timestamp |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:get-updated>
Retrieves the list of individual records that have been updated between the range of now to the duration before now.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Object type. The specified value must be a valid object for your organization. |
String |
*/* |
UTF-8 |
| duration |
|
The amount of time in minutes before now for which to return records from. |
int |
*/* |
|
Returns
| Return Type |
Description |
| GetUpdatedResult |
GetUpdatedResult object containing an array of GetUpdatedResult objects containing the ID of each
created or updated object and the date/time (Coordinated Universal Time (UTC) time zone) on which it was created
or updated, respectively |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:get-updated-range>
Retrieves the list of individual records that have been created/updated within the given timespan for the specified object.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Object type. The specified value must be a valid object for your organization. |
String |
*/* |
UTF-8 |
| startTime |
|
Starting date/time (Coordinated Universal Time (UTC)not local timezone) of the timespan for
which to retrieve the data. The API ignores the seconds portion of the specified dateTime value '
(for example, 12:30:15 is interpreted as 12:30:00 UTC). |
Calendar |
*/* |
|
| endTime |
|
Optional. Ending date/time (Coordinated Universal Time (UTC)not local timezone) of the timespan for
which to retrieve the data. The API ignores the seconds portion of the specified dateTime value
(for example, 12:35:15 is interpreted as 12:35:00 UTC). If it is not provided, the current
server time will be used. |
Calendar |
*/* |
|
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:paginated-query>
Executes a paginated query against the specified object and returns data that matches the specified criteria.
The returned class QueryResultObject provides the methods getData() to retrieve the results in a List
and hasMore() to check if there are more pages to retrieve from the server.
The query result object contains up to 500 rows of data by default and can be increased up to 2,000 rows.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| query |
|
Optional. Query string that specifies the object to query, the fields to return, and any conditions for
including a specific object in the query. For more information, see Salesforce Object Query
Language (SOQL). |
String |
*/* |
UTF-8 |
| queryResultObject |
|
Optional. QueryResultObject returned by a previous call to this operation.
If this is set the other parameter will be ignored. |
QueryResultObject |
*/* |
|
| withDeletedRecords |
false |
Optional. Flag that specifies whether or not to retrieve records that have been deleted. |
Boolean |
*/* |
|
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:query>
Executes a query against the specified object and returns data that matches the specified criteria.
This operation can potentially return a large amount of records that might exceed memory capacity.
To prevent this from being a problem, the output of this operation is automatically paginated into an iterable collection of objects. Regardless of the page-size, the iterator will be pushing out registries one at a time and fetching next pages on demand. If you wish to take advantage of the pagination, you must process the output through elements that can handle collections, such as a ForEach scope or DataMapper. In this way, Mule will execute the entire set of registries one at a time, but processing only a batch at a time and thus keeping memory usage from going over limits.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| query |
|
Query string that specifies the object to query, the fields to return, and any conditions for
including a specific object in the query. For more information, see Salesforce Object Query
Language (SOQL). |
String |
*/* |
UTF-8 |
| fetchSize |
100 |
Specify the number of objects that will be returned in each iteration |
int |
|
|
Returns
| Return Type |
Description |
|
Iterator
<
Map<String, Object>
>
|
A collection: each index contains a list of objects, each object with its own set of properties. It is possible to process it in parts thanks to its pagination. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:query-all>
Retrieves data from specified objects, whether or not they have been deleted.
This operation can potentially return a large amount of records that might exceed memory capacity.
To prevent this from being a problem, the output of this operation is automatically paginated into an iterable collection of objects. Regardless of the page-size, the iterator will be pushing out registries one at a time and fetching next pages on demand. If you wish to take advantage of the pagination, you must process the output through elements that can handle collections, such as a ForEach scope or DataMapper. In this way, Mule will execute the entire set of registries one at a time, but processing only a batch at a time and thus keeping memory usage from going over limits.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| query |
|
Query string that specifies the object to query, the fields to return, and any conditions for including a specific object in the query. For more information, see Salesforce Object Query Language (SOQL). |
String |
*/* |
UTF-8 |
| fetchSize |
100 |
Specify the number of objects that will be returned in each iteration |
int |
|
|
Returns
| Return Type |
Description |
|
Iterator
<
Map<String, Object>
>
|
A collection: each index contains a list of objects, each object with its own set of properties. It is possible to process it in parts thanks to its pagination. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:query-single>
Executes a query against the specified object and returns the first record that matches the specified criteria.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| query |
|
Query string that specifies the object to query, the fields to return, and any conditions for
including a specific object in the query. For more information, see Salesforce Object Query
Language (SOQL). |
String |
*/* |
UTF-8 |
Returns
| Return Type |
Description |
| Map<String, Object> |
A single SObject |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:retrieve>
Retrieves one or more records based on the specified IDs.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Object type. The sp ecified value must be a valid object for your organization. |
String |
*/* |
UTF-8 |
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:ids> |
|
The ids of the objects to retrieve |
List<String> |
| <sfdc:fields> |
|
The fields to return for the matching objects |
List<String> |
Returns
| Return Type |
Description |
| List<Map<String, Object>> |
An array of SObjects |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error
|
<sfdc:search>
Search for objects using Salesforce Object Search Language
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| query |
|
Query string that specifies the object to query, the fields to return, and any conditions for including a specific object in the query. For more information, see Salesforce Object Search Language (SOSL). |
String |
*/* |
UTF-8 |
Returns
| Return Type |
Description |
| List<Map<String, Object>> |
An array of SObjects |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:update>
Updates one or more existing records in your organization's data.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Type of object to update |
String |
*/* |
UTF-8 |
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:objects> |
#[payload] |
Optional. An array of one or more sObjects objects. |
List<Map<String, Object>> |
Returns
| Return Type |
Description |
| List<SaveResult> |
An array of SaveResult |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:update-single>
Updates one or more existing records in your organization's data.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Type of object to update |
String |
*/* |
UTF-8 |
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:object> |
#[payload] |
Optional. The object to be updated. |
Map<String, Object> |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:upsert>
Upserts
an homogeneous list of objects: creates new records and updates existing records, using a custom field to determine the presence of existing records.
In most cases, prefer upsert(String, String, List) over create(String, List),
to avoid creating unwanted duplicate records.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| externalIdFieldName |
|
Contains the name of the field on this object with the external ID field attribute
for custom objects or the idLookup field property for standard objects. |
String |
*/* |
UTF-8 |
| type |
|
The type of the given objects. The list of objects to upsert must be homogeneous |
String |
*/* |
UTF-8 |
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:objects> |
#[payload] |
Optional. The objects to upsert |
List<Map<String, Object>> |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error if a connection error occurs |
<sfdc:abort-job>
Aborts an open Job given its ID.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| jobId |
|
The Job ID identifying the Job to be aborted. |
String |
*/* |
UTF-8 |
Returns
| Return Type |
Description |
| JobInfo |
A JobInfo that identifies the aborted Job. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:batch-info>
Access latest BatchInfo of a submitted BatchInfo. Allows to track execution status.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| batchInfo |
#[payload:] |
Optional. The BatchInfo being monitored |
BatchInfo |
*/* |
|
Returns
| Return Type |
Description |
| BatchInfo |
Latest BatchInfo representing status of the batch job result. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:batch-result>
Access com.sforce.async.BatchResult of a submitted BatchInfo.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| batchInfo |
#[payload:] |
Optional. The BatchInfo being monitored |
BatchInfo |
*/* |
|
Returns
| Return Type |
Description |
| BatchResult |
com.sforce.async.BatchResult representing result of the batch job result. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:batch-result-stream>
Access com.sforce.async.BatchResult of a submitted BatchInfo.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| batchInfo |
#[payload:] |
Optional. The BatchInfo being monitored |
BatchInfo |
*/* |
|
Returns
| Return Type |
Description |
| InputStream |
java.io.InputStream representing result of the batch job result. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:close-job>
Closes an open Job given its ID.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| jobId |
|
The Job ID identifying the Job to be closed. |
String |
*/* |
UTF-8 |
Returns
| Return Type |
Description |
| JobInfo |
A JobInfo that identifies the closed Job. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:create-batch>
Creates a Batch using the given objects within the specified Job.
This call uses the Bulk API. The operation will be done in asynchronous fashion.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| jobInfo |
|
The JobInfo in which the batch will be created. |
JobInfo |
*/* |
|
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:objects> |
#[payload] |
Optional. A list of one or more sObjects objects. This parameter defaults to payload content. |
List<Map<String, Object>> |
Returns
| Return Type |
Description |
| BatchInfo |
A com.sforce.async.BatchInfo that identifies the batch job. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:create-batch-for-query>
Creates a Batch using the given query.
This call uses the Bulk API. The operation will be done in asynchronous fashion.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| jobInfo |
|
The JobInfo in which the batch will be created. |
JobInfo |
*/* |
|
| query |
#[payload] |
Optional. The query to be executed. |
String |
*/* |
UTF-8 |
Returns
| Return Type |
Description |
| BatchInfo |
A BatchInfo that identifies the batch job. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:create-batch-stream>
Creates a Batch using the given stream within the specified Job.
This call uses the Bulk API. The operation will be done in asynchronous fashion.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| jobInfo |
|
The JobInfo in which the batch will be created. |
JobInfo |
*/* |
|
| stream |
#[payload] |
Optional. A stream containing the data. This parameter defaults to payload content. |
InputStream |
*/* |
|
Returns
| Return Type |
Description |
| BatchInfo |
A com.sforce.async.BatchInfo that identifies the batch job. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:create-bulk>
Adds one or more new records to your organization's data.
This call uses the Bulk API. The creation will be done in asynchronous fashion.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Type of object to create |
String |
*/* |
UTF-8 |
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:objects> |
#[payload] |
Optional. An array of one or more sObjects objects. |
List<Map<String, Object>> |
Returns
| Return Type |
Description |
| BatchInfo |
A BatchInfo that identifies the batch job. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:create-job>
Creates a Job in order to perform one or more batches through Bulk API Operations.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| operation |
|
The com.sforce.async.OperationEnum that will be executed by the job. |
OperationEnum |
*/* |
|
| type |
|
The type of Salesforce object that the job will process. |
String |
*/* |
UTF-8 |
| externalIdFieldName |
|
Optional. Contains the name of the field on this object with the external ID field attribute
for custom objects or the idLookup field property for standard objects
(only required for Upsert Operations). |
String |
*/* |
UTF-8 |
| contentType |
|
Optional. The Content Type for this Job results. When specifying a content type different from
XML for a query type use queryResultStream(com.sforce.async.BatchInfo)
batchResultStream} method to retrieve results. |
ContentType |
*/* |
|
| concurrencyMode |
|
Optional. The concurrency mode of the job, either Parallel or Serial. |
ConcurrencyMode |
*/* |
|
Returns
| Return Type |
Description |
| JobInfo |
A com.sforce.async.JobInfo that identifies the created Job. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:hard-delete-bulk>
Deletes one or more records from your organization's data.
The deleted records are not stored in the Recycle Bin.
Instead, they become immediately eligible for deletion.
This call uses the Bulk API. The creation will be done in asynchronous fashion.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Type of object to update |
String |
*/* |
UTF-8 |
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:objects> |
#[payload] |
Optional. An array of one or more sObjects objects. |
List<Map<String, Object>> |
Returns
| Return Type |
Description |
| BatchInfo |
A BatchInfo that identifies the batch job. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:query-result-stream>
Returns an InputStream with the query results of a submitted BatchInfo
Internally the InputStreams contained in the sequence will be requested on-demand (lazy-loading)
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| batchInfo |
#[payload:] |
Optional. The BatchInfo being monitored |
BatchInfo |
*/* |
|
Returns
| Return Type |
Description |
| InputStream |
InputStream with the results of the Batch. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:update-bulk>
Updates one or more existing records in your organization's data.
This call uses the Bulk API. The creation will be done in asynchronous fashion.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
Type of object to update |
String |
*/* |
UTF-8 |
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:objects> |
#[payload] |
Optional. An array of one or more sObjects objects. |
List<Map<String, Object>> |
Returns
| Return Type |
Description |
| BatchInfo |
A BatchInfo that identifies the batch job. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
<sfdc:upsert-bulk>
Upserts
an homogeneous list of objects: creates new records and updates existing records, using a custom field to determine the presence of existing records.
In most cases, prefer upsert(String, String, List) over create(String, List),
to avoid creating unwanted duplicate records.
This call uses the Bulk API. The creation will be done in asynchronous fashion.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| type |
|
The type of the given objects. The list of objects to upsert must be homogeneous |
String |
*/* |
UTF-8 |
| externalIdFieldName |
|
Contains the name of the field on this object with the external ID field attribute
for custom objects or the idLookup field property for standard objects. |
String |
*/* |
UTF-8 |
Child Elements
| Name | Default Value | Description | Java Type |
|---|
| <sfdc:objects> |
#[payload] |
Optional. The objects to upsert |
List<Map<String, Object>> |
Returns
| Return Type |
Description |
| BatchInfo |
A BatchInfo that identifies the batch job. |
Exception Payloads
| Payload Class | Description |
| Exception |
com.sforce.ws.ConnectionException when there is an error |
Message Sources
<sfdc:subscribe-topic>
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| topic |
|
The name of the topic to subscribe to |
String |
*/* |
UTF-8 |
| callback |
|
The callback to be called when a message is received |
SourceCallback |
*/* |
|
Returns
| Return Type |
Description |
| StopSourceCallback |
org.mule.api.callback.StopSourceCallback |
Transformers