Studio Visual Editor
-
Obtain your user Security Token from your Salesforce account.
Where do I get my Security Token?
-
Log in to your Salesforce account. From your account menu (your account is labeled with your name), select Setup.
-
In the left navigation bar, under the My Settings heading, click to expand the Personal folder.
-
Click Reset My Security Token. Salesforce resets the token and emails you the new one.
-
Access the email that Salesforce sent and copy the new token onto your local clipboard.
-
-
Create a new Mule Project and drag a Salesforce connector into your flow.
-
Specify the Topic value. This is a text string you use to organize records around common themes. Mule permits any topic string that Salesforce allows.
-
Enter the message processor’s properties editor, then click the green plus sign to create a new Global Element to set up connection parameters.
image::selectconnectorconfig.png[SelectConnectorConfig] -
You are prompted to select between two types of global elements. Pick the one named Salesforce.
-
Provide the required credentials: Username, Password, and Security Token. (URL is optional; configure this only if you want to override the default URL.)
In the image above, the fields hold parametrized references to a configuration file placed in the
src
folder of your project. You can also directly provide the actual values into the fields if you don’t plan to change these. -
Click Test Connection to make sure the credentials are valid.
XML Editor
-
Obtain your user Security Token from your Salesforce account.
Where do I get my Security Token? .. Log in to your Salesforce account. From your account menu (your account is labeled with your name), select *Setup*. .. In the left navigation bar, under the *My Settings* heading, click to expand the **Personal **folder. .. Click *Reset My Security Token*. Salesforce resets the token and emails you the new one. .. Access the email that Salesforce sent and copy the new token onto your local clipboard.
-
Create a new Mule Project and add an
sfdc:global-element
at the start of your file. Global Elements set up reusable connection parameters.<sfdc:config name="Salesforce" username="${mule.env}.properties.username" password="${mule.env}.properties.password" securityToken="${mule.env}.properties.securityToken" url="${mule.env}.properties.url" doc:name="Salesforce"> <sfdc:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/> </sfdc:config>
You must provide four required credentials: username, password, securityToken. The url parameter is optional. You can either directly provide these values in the fields or add parameterized references to a configuration file.
-
When adding a Salesforce message processor to a Mule flow, reference this global element through the attribute
config-ref
. The topic value is required and is a text string used to group records around a common theme. Mule permits any topic string that Salesforce allows.<sfdc:subscribe-topic config-ref="Salesforce" topic="" doc:name="Salesforce (Streaming)"/>