Since Camel 2.12
Both producer and consumer are supported
This component supports producer and consumer endpoints to communicate with Salesforce using Java DTOs. There is a companion maven plugin that generates these DTOs.
Note
|
Developers wishing to contribute to the component are instructed to look at the README.md file on instructions on how to get started and set up your environment for running integration tests. |
Follow these steps to get started with the Salesforce component.
-
Create a salesforce org. If you don’t already have access to a salesforce org, you can create a free developer org.
-
Create a Connected App. In salesforce, go to Setup > Apps > App Manager, then click on New Connected App. Make sure to check Enable OAuth Settings and include relevant OAuth Scopes, including the scope called Perform requests at any time. Click Save.
-
Get the Consumer Key and Consumer Secret. You’ll need these to configure salesforce authentication. View your new connected app, then copy the key and secret and save in a safe place.
-
Add Maven depdendency.
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-salesforce</artifactId> </dependency>
Spring Boot users should use the starter instead.
<dependency> <groupId>org.apache.camel.springboot</groupId> <artifactId>camel-salesforce-starter</artifactId> </dependency>
-
Generate DTOs. Optionally, generate Java DTOs to represent your salesforce objects. This step isn’t a hard requirement per se, but most use cases will benefit from the type safety and auto-completion. Use the maven plugin to generate DTOs for the salesforce objects you’ll be working with.
-
Configure authentication. Using the OAuth key and secret, you generated previously, configure salesforce authentication.
-
Create routes. Starting creating routes that interact with salesforce!
The component supports three OAuth authentication flows:
For each of the flows, different sets of properties need to be set:
Property | Where to find it on Salesforce | Flow |
---|---|---|
|
Connected App, Consumer Key |
All flows |
|
Connected App, Consumer Secret |
Username-Password, Refresh Token, Client Credentials |
|
Salesforce user username |
Username-Password, JWT Bearer Token |
|
Salesforce user password |
Username-Password |
|
From OAuth flow callback |
Refresh Token |
|
Connected App, Digital Certificate |
JWT Bearer Token |
The component auto determines what flow you’re trying to configure. In order to be explicit, set the
authenticationType
property.
Note
|
Using Username-Password Flow in production is not encouraged. |
Note
|
The certificate used in JWT Bearer Token Flow can be a self-signed certificate. The KeyStore holding the certificate and the private key must contain only a single certificate-private key entry. |
When used as a consumer, receiving streaming events, the URI scheme is:
salesforce:subscribe:topic?options
When used as a producer, invoking the Salesforce REST APIs, the URI scheme is:
salesforce:operationName?options
As a general example on using the operations in this salesforce component, the following producer endpoint uses the upsertSObject API, with the sObjectIdName parameter specifying 'Name' as the external id field. The request message body should be an SObject DTO generated using the maven plugin.
...to("salesforce:upsertSObject?sObjectIdName=Name")...
There is support to pass Salesforce headers
via inbound message headers, header names that start with Sforce
or
x-sfdc
on the Camel message will be passed on in the request, and
response headers that start with Sforce
will be present in the outbound
message headers.
For example, to fetch API limits, you can specify:
// in your Camel route set the header before Salesforce endpoint
//...
.setHeader("Sforce-Limit-Info", constant("api-usage"))
.to("salesforce:getGlobalObjects")
.to(myProcessor);
// myProcessor will receive `Sforce-Limit-Info` header on the outbound
// message
class MyProcessor implements Processor {
public void process(Exchange exchange) throws Exception {
Message in = exchange.getIn();
String apiLimits = in.getHeader("Sforce-Limit-Info", String.class);
}
}
In addition, HTTP response status code and text are available as headers Exchange.HTTP_RESPONSE_CODE
and
Exchange.HTTP_RESPONSE_TEXT
.
Camel supports the following Salesforce APIs:
The following operations are supported:
-
getVersions - Gets supported Salesforce REST API versions.
-
getResources - Gets available Salesforce REST Resource endpoints.
-
limits - Lists information about limits in your org.
-
recent - Gets the most recently accessed items that were viewed or referenced by the current user.
-
getGlobalObjects - Gets metadata for all available SObject types.
-
getBasicInfo - Gets basic metadata for a specific SObject type.
-
getDescription - Gets comprehensive metadata for a specific SObject type.
-
getSObject - Gets an SObject.
-
getSObjectWithId - Gets an SObject using an External Id (user defined) field.
-
getBlobField - Retrieves the specified blob field from an individual record.
-
createSObject - Creates an SObject.
-
updateSObject - Updates an SObject.
-
deleteSObject - Deletes an SObject.
-
upsertSObject - Inserts or updates an SObject using an External Id.
-
deleteSObjectWithId - Deletes an SObject using an External Id.
-
query - Runs a Salesforce SOQL query.
-
queryMore - Retrieves more results (in case of a large number of results) using the result link returned from the 'query' API.
-
queryAll - Runs a SOQL query. Unlike the query operation, queryAll returns records that are deleted because of a merge or delete. queryAll also returns information about archived task and event records.
-
search - Runs a Salesforce SOSL query.
-
apexCall - Executes a user defined APEX REST API call.
-
approval - Submits a record or records (batch) for approval process.
-
approvals - Fetches a list of all approval processes.
-
composite - Executes up to 25 REST API requests in a single call. You can use the output of one request as the input to a subsequent request.
-
composite-tree - Creates up to 200 records with parent-child relationships (up to 5 levels) in one go.
-
composite-batch - Executes up to 25 sub-requests in a single request.
-
compositeRetrieveSObjectCollections - Retrieves one or more records of the same object type.
-
compositeCreateSObjectCollections - Creates up to 200 records.
-
compositeUpdateSObjectCollections - Update up to 200 records.
-
compositeUpsertSObjectCollections - Creates or updates up to 200 records based on an External Id field.
-
compositeDeleteSObjectCollections - Deletes up to 200 records.
-
getEventSchema - Gets the event schema for Plaform Events, Change Data Capture events, etc.
Unless otherwise specified, DTO types for the following options are from org.apache.camel.component.salesforce.api.dto
or one if its sub-packages.
getVersions
Lists summary information about each Salesforce version currently available, including the version, label, and a link to each version’s root.
Output
Type: List<Version>
getResources
Lists available resources for the current API version, including resource name and URI.
Output
Type: Map<String, String>
limits
Lists information about limits in your org. For each limit, this resource returns the maximum allocation and the remaining allocation based on usage.
Output
Type: Limits
Additional Usage Information
With salesforce:limits
operation you can fetch of API limits from Salesforce and then act upon that data received.
The result of salesforce:limits
operation is mapped to org.apache.camel.component.salesforce.api.dto.Limits
class and can be used in a custom processors or expressions.
For instance, consider that you need to limit the API usage of Salesforce so that 10% of daily API requests is left for
other routes. The body of output message contains an instance of
org.apache.camel.component.salesforce.api.dto.Limits
object that can be used in conjunction with
Content Based Router and Content Based Router and
Spring Expression Language (SpEL) to choose when to perform queries.
Notice how multiplying 1.0
with the integer value held in body.dailyApiRequests.remaining
makes the expression
evaluate as with floating point arithmetic, without it - it would end up making integral division which would result
with either 0
(some API limits consumed) or 1
(no API limits consumed).
from("direct:querySalesforce")
.to("salesforce:limits")
.choice()
.when(spel("#{1.0 * body.dailyApiRequests.remaining / body.dailyApiRequests.max < 0.1}"))
.to("salesforce:query?...")
.otherwise()
.setBody(constant("Used up Salesforce API limits, leaving 10% for critical routes"))
.endChoice()
recent
Gets the most recently accessed items that were viewed or referenced by the current user. Salesforce stores information about record views in the interface and uses it to generate a list of recently viewed and referenced records, such as in the sidebar and for the auto-complete options in search.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
An optional limit that specifies the maximum number of records to be returned. If this parameter is not specified, the default maximum number of records returned is the maximum number of entries in RecentlyViewed, which is 200 records per object. |
Output
Type: List<RecentItem>
Additional Usage Information
To fetch the recent items use salesforce:recent
operation. This operation returns an java.util.List
of
org.apache.camel.component.salesforce.api.dto.RecentItem
objects (List<RecentItem>
) that in turn contain
the Id
, Name
and Attributes
(with type
and url
properties). You can limit the number of returned items
by specifying limit
parameter set to maximum number of records to return. For example:
from("direct:fetchRecentItems")
to("salesforce:recent")
.split().body()
.log("${body.name} at ${body.attributes.url}");
getGlobalObjects
Lists the available objects and their metadata for your organization’s data. In addition, it provides the organization encoding, as well as the maximum batch size permitted in queries.
Output
Type: GlobalObjects
getBasicInfo
Describes the individual metadata for the specified object.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Name of SObject, e.g. |
x |
Output
Type: SObjectBasicInfo
getDescription
Completely describes the individual metadata at all levels for the specified object. For example, this can be used to retrieve the fields, URLs, and child relationships for the Account object.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Name of SObject, e.g. |
x |
Output
Type: SObjectDescription
getSObject
Accesses record based on the specified object ID. This operation requires the packages
option to be set.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Name of SObject, e.g. |
x |
|
|
|
Id of record to retrieve. |
x |
|
|
|
Comma-separated list of fields to retrieve |
||
Body |
|
Instance of SObject that is used to query salesforce. If supplied,
overrides |
Output
Type: Subclass of AbstractSObjectBase
getSObjectWithId
Accesses record based on an External ID value. This operation requires the packages
option to be set.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Name of External ID field |
x |
|
|
|
External ID value |
x |
|
|
|
Name of SObject, e.g. |
x |
|
Body |
|
Instance of SObject that is used to query salesforce. If supplied,
overrides |
Output
Type: Subclass of AbstractSObjectBase
getBlobField
Retrieves the specified blob field from an individual record.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
SOSL query |
x |
|
|
|
Name of SObject, e.g., Account |
Required if SObject not supplied in body |
|
|
|
Id of SObject |
Required if SObject not supplied in body |
|
Body |
|
SObject to determine type and Id from. If not supplied, |
Required if |
Output
Type: InputStream
createSObject
Creates a record in salesforce.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Instance of SObject to create. |
x |
|
|
|
Name of SObject, e.g. |
If Body is a |
Output
Type: CreateSObjectResult
updateSObject
Updates a record in salesforce.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Instance of SObject to update. |
x |
|
|
|
Name of SObject, e.g. |
If Body is a |
|
|
|
Id of record to update. Only used if Camel cannot determine from Body. |
If Body is a |
upsertSObject
Upserts a record by External ID.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
SObject to update. |
x |
|
|
|
External ID field name. |
x |
|
|
|
External ID value |
If Body is a |
|
|
|
Name of SObject, e.g. |
If Body is a |
Output
Type: UpsertSObjectResult
deleteSObject
Deletes a record in salesforce.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Instance of SObject to delete. |
||
|
|
Name of SObject, e.g. |
If Body is not an |
|
|
|
Id of record to delete. |
If Body is not an |
deleteSObjectWithId
Deletes a record in salesforce by External ID.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Instance of SObject to delete. |
||
|
|
Name of External ID field |
If Body is not an |
|
|
|
External ID value |
If Body is not an |
|
|
|
Name of SObject, e.g. |
If Body is not an |
query
Runs a Salesforce SOQL query. If neither sObjectClass
nor sObjectName
are set, Camel will attempt to determine
the correct AbstractQueryRecordsBase
sublcass based on the response.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body or |
|
SOQL query |
x |
|
streamQueryResult |
|
If true, returns a streaming |
false |
|
|
|
Fully qualified name of class to deserialize response to. Usually a subclass of |
||
|
|
Simple name of class to deserialize response to. Usually a subclass of |
Output
Type: Instance of class supplied in sObjectClass
, or Iterator<SomeSObject>
if streamQueryResult
is true. If streamQueryResult
is true, the header CamelSalesforceQueryResultTotalSize
is set to the number of records that matched the query.
queryMore
Retrieves more results (in case of large number of results) using result link returned from the query
and queryAll
operations. If neither sObjectClass
nor sObjectName
are set, Camel will attempt to determine the correct
AbstractQueryRecordsBase
sublcass based on the response.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body or |
|
|
X |
|
|
|
Fully qualified name of class to deserialize response to. Usually a subclass of |
||
|
|
Simple name of class to deserialize response to. Usually a subclass of |
Output
Type: Instance of class supplied in sObjectClass
queryAll
Executes the specified SOQL query. Unlike the query
operation , queryAll
returns records that are deleted because
of a merge or delete. It also returns information about archived task and event records. If neither sObjectClass
nor
sObjectName
are set, Camel will attempt to determine the correct AbstractQueryRecordsBase
sublcass based on the
response.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body or |
|
SOQL query |
x |
|
streamQueryResult |
|
If true, returns a streaming |
false |
|
|
|
Fully qualified name of class to deserialize response to. Usually a subclass of |
||
|
|
Simple name of class to deserialize response to. Usually a subclass of |
Output
Type: Instance of class supplied in sObjectClass
, or Iterator<SomeSObject>
if streamQueryResult
is true.
search
Runs a Salesforce SOSL search
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body or |
|
Name of field to retrieve |
x |
Output
Type: SearchResult2
approval
Submit a record or records (batch) for approval process.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
|
||
|
Prefixed headers or endpoint options in lieu of passing an |
Output
Type: ApprovalResult
Additional usage information
All the properties are named exactly the same as in the Salesforce REST API prefixed with approval.
. You can set
approval properties by setting approval.PropertyName
of the Endpoint these will be used as template — meaning
that any property not present in either body or header will be taken from the Endpoint configuration. Or you can set
the approval template on the Endpoint by assigning approval
property to a reference onto a bean in the Registry.
You can also provide header values using the same approval.PropertyName
in the incoming message headers.
And finally body can contain one AprovalRequest
or an Iterable
of ApprovalRequest
objects to process as
a batch.
The important thing to remember is the priority of the values specified in these three mechanisms:
-
value in body takes precedence before any other
-
value in message header takes precedence before template value
-
value in template is set if no other value in header or body was given
For example, to send one record for approval using values in headers use:
Given a route:
from("direct:example1")//
.setHeader("approval.ContextId", simple("${body['contextId']}"))
.setHeader("approval.NextApproverIds", simple("${body['nextApproverIds']}"))
.to("salesforce:approval?"//
+ "approval.actionType=Submit"//
+ "&approval.comments=this is a test"//
+ "&approval.processDefinitionNameOrId=Test_Account_Process"//
+ "&approval.skipEntryCriteria=true");
You could send a record for approval using:
final Map<String, String> body = new HashMap<>();
body.put("contextId", accountIds.iterator().next());
body.put("nextApproverIds", userId);
final ApprovalResult result = template.requestBody("direct:example1", body, ApprovalResult.class);
composite
Executes up to 25 REST API requests in a single call. You can use the output of one request as the input to a subsequent request. The response bodies and HTTP statuses of the requests are returned in a single response body. The entire series of requests counts as a single call toward your API limits. Use Salesforce Composite API to submit multiple chained requests. Individual requests and responses are linked with the provided reference.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Contains REST API sub-requests to be executed. |
x |
|
|
|
Any (un)marshaling of requests and responses are assumed to be handled by the route |
false |
x |
|
|
HTTP method to use for rawPayload requests. |
|
Output
Type: SObjectCompositeResponse
Note
|
Composite API supports only JSON payloads. |
Note
|
As with the batch API, the results can vary from API to API so the body of each |
Let’s look at an example:
SObjectComposite composite = new SObjectComposite("38.0", true);
// first insert operation via an external id
final Account updateAccount = new TestAccount();
updateAccount.setName("Salesforce");
updateAccount.setBillingStreet("Landmark @ 1 Market Street");
updateAccount.setBillingCity("San Francisco");
updateAccount.setBillingState("California");
updateAccount.setIndustry(Account_IndustryEnum.TECHNOLOGY);
composite.addUpdate("Account", "001xx000003DIpcAAG", updateAccount, "UpdatedAccount");
final Contact newContact = new TestContact();
newContact.setLastName("John Doe");
newContact.setPhone("1234567890");
composite.addCreate(newContact, "NewContact");
final AccountContactJunction__c junction = new AccountContactJunction__c();
junction.setAccount__c("001xx000003DIpcAAG");
junction.setContactId__c("@{NewContact.id}");
composite.addCreate(junction, "JunctionRecord");
final SObjectCompositeResponse response = template.requestBody("salesforce:composite", composite, SObjectCompositeResponse.class);
final List<SObjectCompositeResult> results = response.getCompositeResponse();
final SObjectCompositeResult accountUpdateResult = results.stream().filter(r -> "UpdatedAccount".equals(r.getReferenceId())).findFirst().get()
final int statusCode = accountUpdateResult.getHttpStatusCode(); // should be 200
final Map<String, ?> accountUpdateBody = accountUpdateResult.getBody();
final SObjectCompositeResult contactCreationResult = results.stream().filter(r -> "JunctionRecord".equals(r.getReferenceId())).findFirst().get()
Using the rawPayload
option
It’s possible to directly call Salesforce composite by preparing the Salesforce JSON request in the route thanks to the rawPayload
option.
For instance, you can have the following route:
from("timer:fire?period=2000").setBody(constant("{\n" + " \"allOrNone\" : true,\n" + " \"records\" : [ { \n" + " \"attributes\" : {\"type\" : \"FOO\"},\n" + " \"Name\" : \"123456789\",\n" + " \"FOO\" : \"XXXX\",\n" + " \"ACCOUNT\" : 2100.0\n" + " \"ExternalID\" : \"EXTERNAL\"\n" " }]\n" + "}") .to("salesforce:composite?rawPayload=true") .log("${body}");
The route directly creates the body as JSON and directly submit to salesforce endpoint using rawPayload=true
option.
With this approach, you have complete control on the Salesforce request.
POST
is the default HTTP method used to send raw Composite requests to salesforce. Use the
compositeMethod
option to override to the other supported value, GET
, which returns a list of
other available composite resources.
composite-tree
Create up to 200 records with parent-child relationships (up to 5 levels) in one go.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Contains REST API sub-requests to be executed. |
x |
Output
Type: SObjectTree
To create up to 200 records including parent-child relationships use salesforce:composite-tree
operation. This
requires an instance of org.apache.camel.component.salesforce.api.dto.composite.SObjectTree
in the input
message and returns the same tree of objects in the output message. The
org.apache.camel.component.salesforce.api.dto.AbstractSObjectBase
instances within the tree get updated with
the identifier values (Id
property) or their corresponding
org.apache.camel.component.salesforce.api.dto.composite.SObjectNode
is populated with errors
on failure.
Note that for some records operation can succeed and for some it can fail — so you need to manually check for errors.
The easiest way to use this functionality is to use the DTOs generated by the camel-salesforce-maven-plugin
, but you
also have the option of customizing the references that identify each object in the tree, for instance primary keys
from your database.
Let’s look at an example:
Account account = ...
Contact president = ...
Contact marketing = ...
Account anotherAccount = ...
Contact sales = ...
Asset someAsset = ...
// build the tree
SObjectTree request = new SObjectTree();
request.addObject(account).addChildren(president, marketing);
request.addObject(anotherAccount).addChild(sales).addChild(someAsset);
final SObjectTree response = template.requestBody("salesforce:composite-tree", tree, SObjectTree.class);
final Map<Boolean, List<SObjectNode>> result = response.allNodes()
.collect(Collectors.groupingBy(SObjectNode::hasErrors));
final List<SObjectNode> withErrors = result.get(true);
final List<SObjectNode> succeeded = result.get(false);
final String firstId = succeeded.get(0).getId();
composite-batch
Submit a composition of requests in batch. Executes up to 25 sub-requests in a single request.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Contains sub-requests to be executed. |
x |
Output
Type: SObjectBatchResponse
The Composite API batch operation allows you to accumulate multiple requests in a batch and then submit them in one go, saving the round trip cost of multiple individual requests. Each response is then received in a list of responses with the order preserved, so that the n-th requests response is in the n-th place of the response.
Note
|
The results can vary from API to API so the result of each sub-request ( |
Let’s look at an example:
final String acountId = ...
final SObjectBatch batch = new SObjectBatch("53.0");
final Account updates = new Account();
updates.setName("NewName");
batch.addUpdate("Account", accountId, updates);
final Account newAccount = new Account();
newAccount.setName("Account created from Composite batch API");
batch.addCreate(newAccount);
batch.addGet("Account", accountId, "Name", "BillingPostalCode");
batch.addDelete("Account", accountId);
final SObjectBatchResponse response = template.requestBody("salesforce:composite-batch", batch, SObjectBatchResponse.class);
boolean hasErrors = response.hasErrors(); // if any of the requests has resulted in either 4xx or 5xx HTTP status
final List<SObjectBatchResult> results = response.getResults(); // results of three operations sent in batch
final SObjectBatchResult updateResult = results.get(0); // update result
final int updateStatus = updateResult.getStatusCode(); // probably 204
final Object updateResultData = updateResult.getResult(); // probably null
final SObjectBatchResult createResult = results.get(1); // create result
@SuppressWarnings("unchecked")
final Map<String, Object> createData = (Map<String, Object>) createResult.getResult();
final String newAccountId = createData.get("id"); // id of the new account, this is for JSON, for XML it would be createData.get("Result").get("id")
final SObjectBatchResult retrieveResult = results.get(2); // retrieve result
@SuppressWarnings("unchecked")
final Map<String, Object> retrieveData = (Map<String, Object>) retrieveResult.getResult();
final String accountName = retrieveData.get("Name"); // Name of the retrieved account, this is for JSON, for XML it would be createData.get("Account").get("Name")
final String accountBillingPostalCode = retrieveData.get("BillingPostalCode"); // Name of the retrieved account, this is for JSON, for XML it would be createData.get("Account").get("BillingPostalCode")
final SObjectBatchResult deleteResult = results.get(3); // delete result
final int updateStatus = deleteResult.getStatusCode(); // probably 204
final Object updateResultData = deleteResult.getResult(); // probably null
compositeRetrieveSObjectCollections
Retrieve one or more records of the same object type.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
sObjectIds |
List of String or comma-separated string |
A list of one or more IDs of the objects to return. All IDs must belong to the same object type. |
x |
|
sObjectFields |
List of String or comma-separated string |
A list of fields to include in the response. The field names you specify must be valid, and you must have read-level permissions to each field. |
x |
|
sObjectName |
String |
Type of SObject, e.g. |
x |
|
sObjectClass |
String |
Fully qualified class name of DTO class to use for deserializing the response. |
Required if |
Output
Type: List
of class determined by sObjectName
or sObjectClass
header
compositeCreateSObjectCollections
Add up to 200 records. Mixed SObject types is supported.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
List of |
A list of SObjects to create |
x |
|
|
boolean |
Indicates whether to roll back the entire request when the creation of any object fails (true) or to continue with the independent creation of other objects in the request. |
false |
Output
Type: List<SaveSObjectResult>
compositeUpdateSObjectCollections
Update up to 200 records. Mixed SObject types is supported.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
List of |
A list of SObjects to update |
x |
|
|
|
Indicates whether to roll back the entire request when the update of any object fails (true) or to continue with the independent update of other objects in the request. |
false |
Output
Type: List<SaveSObjectResult>
compositeUpsertSObjectCollections
Create or update (upsert) up to 200 records based on an external ID field. Mixed SObject types is not supported.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
List of |
A list of SObjects to upsert |
x |
|
|
|
Indicates whether to roll back the entire request when the upsert of any object fails (true) or to continue with the independent upsert of other objects in the request. |
false |
|
|
|
Type of SObject, e.g. |
x |
|
|
|
Name of External ID field |
x |
Output
Type: List<UpsertSObjectResult>
compositeDeleteSObjectCollections
Delete up to 200 records. Mixed SObject types is supported.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
List of String or comma-separated string |
A list of up to 200 IDs of objects to be deleted. |
x |
|
|
boolean |
Indicates whether to roll back the entire request when the deletion of any object fails (true) or to continue with the independent deletion of other objects in the request. |
false |
Output
Type: List<DeleteSObjectResult>
getEventSchema
Gets the definition of a Platform Event in JSON format. Other types of events such as Change Data Capture events or custom events are also supported. This operation is available in REST API version 40.0 and later.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
String |
Name of event |
|
|
|
String |
ID of a schema |
|
|
|
EventSchemaFormatEnum |
|
|
Output
Type: InputStream
apexCall
You can expose your Apex class and methods so that external applications can access your code and your application through the REST architecture.
The URI format for invoking Apex REST is:
salesforce:apexCall[/yourApexRestUrl][?options]
You can supply the apexUrl either in the endpoint (see above), or as the apexUrl
option as listed in the table below.
In either case the Apex URL can contain placeholders in the format of {headerName}
. E.g., for the Apex URL MyApexClass/{id}
,
the value of the header named id
will be used to replace the placeholder. If rawPayload
is false and neither
sObjectClass
nor sObjectName
are set, Camel will attempt to determine the correct AbstractQueryRecordsBase
sublcass based on the response.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
In the case of a |
||
|
|
The portion of the endpoint URL after |
Yes, unless supplied in endpoint |
|
|
|
The HTTP method (e.g. |
|
|
|
|
If true, Camel will not serialize the request or response bodies. |
false |
|
Header: |
Object |
Headers that override apex parameters passed in the endpoint. |
||
|
|
Name of sObject (e.g. |
||
|
|
Fully qualified class name used to deserialize the response |
Output
Type: Instance of class supplied in sObjectClass
input header.
The Bulk 2.0 API has a simplified model over the original Bulk API. Use it to quickly load a large
amount of data into salesforce, or query a large amount of data out of salesforce. Data must be
provided in CSV format, usually via an InputStream
instance. PK chunking is performed automatically. The minimum API version for Bulk 2.0
is v41.0. The minimum API version for Bulk Queries is v47.0. DTO classes mentioned below are from the
org.apache.camel.component.salesforce.api.dto.bulkv2
package. The following operations are supported:
-
bulk2CreateJob - Creates a bulk ingest job.
-
bulk2CreateBatch - Adds a batch of data to an ingest job.
-
bulk2CloseJob - Closes an ingest job.
-
bulk2AbortJob - Aborts an ingest job.
-
bulk2DeleteJob - Deletes an ingest job.
-
bulk2GetSuccessfulResults - Gets successful results for an ingest job.
-
bulk2GetFailedResults - Gets failed results for an ingest job.
-
bulk2GetUnprocessedRecords - Gets unprocessed records for an ingest job.
-
bulk2GetJob - Gets an ingest Job.
-
bulk2GetAllJobs - Gets all ingest jobs.
-
bulk2CreateQueryJob - Creates a query job.
-
bulk2GetQueryJobResults - Gets query job results.
-
bulk2AbortQueryJob - Aborts a query job.
-
bulk2DeleteQueryJob - Deletes a query job.
-
bulk2GetQueryJob - Gets a query job.
-
bulk2GetAllQueryJobs - Gets all query jobs.
bulk2CreateJob
Creates a bulk ingest job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Job to create |
x |
Output
Type: Job
bulk2CreateBatch
Adds a batch of data to an ingest job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
CSV data. The first row must contain headers. |
Required if |
|
|
|
Id of Job to create batch under |
x |
bulk2CloseJob
Closes an ingest job. You must close the job in order for it to be processed or aborted/deleted.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job to close |
x |
Output
Type: Job
bulk2AbortJob
Aborts an ingest job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job to abort |
x |
Output
Type: Job
bulk2DeleteJob
Deletes an ingest job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job to delete |
x |
bulk2GetSuccessfulResults
Gets successful results for an ingest job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job to get results for |
x |
Output
Type: InputStream
Contents: CSV data
bulk2GetFailedResults
Gets failed results for an ingest job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job to get results for |
x |
Output
Type: InputStream
Contents: CSV data
bulk2GetUnprocessedRecords
Gets unprocessed records for an ingest job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job to get records for |
x |
Output
Type: InputStream
Contents: CSV data
bulk2GetJob
Gets an ingest Job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Will use Id of supplied Job to retrieve Job |
Required if |
|
|
|
Id of Job to retrieve |
Required if |
Output
Type: Job
bulk2GetAllJobs
Gets all ingest jobs.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Used in subsequent calls if results span multiple pages |
Output
Type: Jobs
If the done
property of the Jobs
instance
is false, there are additional pages to fetch, and the nextRecordsUrl
property contains the value
to be set in the queryLocator
parameter on subsequent calls.
bulk2CreateQueryJob
Gets a query job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
QueryJob to create |
x |
Output
Type: QueryJob
bulk2GetQueryJobResults
Get bulk query job results. jobId
parameter is required. Accepts
maxRecords
and locator
parameters.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job to get results for |
x |
|
|
|
The maximum number of records to retrieve per set of results for the query. The request is still subject to the size limits. If you are working with a very large number of query results, you may experience a timeout before receiving all the data from Salesforce. To prevent a timeout, specify the maximum number of records your client is expecting to receive in the maxRecords parameter. This splits the results into smaller sets with this value as the maximum size. |
||
|
|
A string that identifies a specific set of query results. Providing a value for this parameter returns only that set of results. Omitting this parameter returns the first set of results. |
Output
Type: InputStream
Contents: CSV data
Response message headers include Sforce-NumberOfRecords
and
Sforce-Locator
headers. The value of Sforce-Locator
can be passed into subsequent calls via the
locator
parameter.
bulk2AbortQueryJob
Aborts a query job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job to abort |
x |
Output
Type: QueryJob
bulk2DeleteQueryJob
Deletes a query job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job to delete |
x |
bulk2GetQueryJob
Gets a query job.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job to retrieve |
x |
Output
Type: QueryJob
bulk2GetAllQueryJobs
Gets all query jobs.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Used in subsequent calls if results span multiple pages |
Output
Type: QueryJobs
If the done
property of the QueryJobs
instance
is false, there are additional pages to fetch, and the nextRecordsUrl
property contains the value
to be set in the queryLocator
parameter on subsequent calls.
Producer endpoints can use the following APIs. All Job data formats,
i.e. xml, csv, zip/xml, and zip/csv are supported.
The request and response have to be marshalled/unmarshalled by the
route. Usually the request will be some stream source like a CSV file,
and the response may also be saved to a file to be correlated with the
request.
The following operations are supported:
-
createJob - Creates a Salesforce Bulk Job.
-
getJob - Gets a Job using its Salesforce Id
-
closeJob - Closes a Job
-
abortJob - Aborts a Job
-
createBatch - Submits a Batch within a Bulk Job
-
getBatch - Gets a Batch using Id
-
getAllBatches - Gets all Batches for a Bulk Job Id
-
getRequest - Gets Request data (XML/CSV) for a Batch
-
getResults - Gets the results of the Batch when its complete
-
createBatchQuery - Creates a Batch from an SOQL query
-
getQueryResultIds - Gets a list of Result Ids for a Batch Query
-
getQueryResult - Gets results for a Result Id
createJob
Creates a Salesforce Bulk Job. PK Chunking is supported via the pkChunking* options. See an explanation here.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Job to create |
x |
|
|
|
Whether to use PK Chunking |
false |
|
|
|
|||
|
|
|||
|
|
Output
Type: JobInfo
getJob
Gets a Job
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job to get |
Required if body not supplied |
|
Body |
|
|
Required if |
Output
Type: JobInfo
closeJob
Closes a Job
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job |
Required if body not supplied |
|
Body |
|
|
Required if |
Output
Type: JobInfo
abortJob
Aborts a Job
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job |
Required if body not supplied |
|
Body |
|
|
Required if |
Output
Type: JobInfo
createBatch
Submits a Batch within a Bulk Job
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job |
x |
|
|
|
Content type of body. Can be XML, CSV, ZIP_XML or ZIP_CSV |
x |
|
|
|
Batch data |
x |
Output
Type: BatchInfo
getBatch
Get a Batch
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job |
Required if body not supplied |
|
|
|
Id of Batch |
Required if body not supplied |
|
Body |
|
|
Required if |
Output
Type: BatchInfo
getAllBatches
Gets all Batches for a Bulk Job Id
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job |
Required if body not supplied |
|
Body |
|
|
Required if |
Output
Type: List<JobInfo>
getRequest
Gets Request data (XML/CSV) for a Batch
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job |
Required if body not supplied |
|
|
|
Id of Batch |
Required if body not supplied |
|
Body |
|
|
Required if |
Output
Type: InputStream
getResults
Gets the results of the Batch when it’s complete
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job |
Required if body not supplied |
|
|
|
Id of Batch |
Required if body not supplied |
|
Body |
|
|
Required if |
Output
Type: InputStream
createBatchQuery
Creates a Batch from an SOQL query
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job |
Required if body not supplied |
|
|
|
Content type of body. Can be XML, CSV, ZIP_XML or ZIP_CSV |
Required if |
|
|
|
SOQL query to be used for this batch |
Required if not supplied in body |
|
Body |
|
Either |
Required |
Output
Type: BatchInfo
getQueryResultIds
Gets a list of Result Ids for a Batch Query
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job |
Required if body not supplied |
|
|
|
Id of Batch |
Required if body not supplied |
|
Body |
|
|
Required if |
Output
Type: List<String>
getQueryResult
Gets results for a Result Id
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Job |
Required if body not supplied |
|
|
|
Id of Batch |
Required if body not supplied |
|
|
|
Id of Result |
If not passed in body |
|
Body |
|
|
|
Output
Type: InputStream
For example, the following producer endpoint uses the createBatch API to
create a Job Batch. The in message must contain a body that can be converted into an
InputStream
(usually UTF-8 CSV or XML content from a file, etc.) and
header fields 'jobId' for the Job and 'contentType' for the Job content
type, which can be XML, CSV, ZIP_XML or ZIP_CSV. The put message body
will contain BatchInfo
on success, or throw a SalesforceException
on
error.
...to("salesforce:createBatch")..
The Pub/Sub API allows you to publish and subscribe to platform events, including real-time event monitoring events, and change data capture events. This API is based on gRPC and HTTP/2, and event payloads are delivered in Apache Avro format.
The URI format for publishing events is:
salesforce:pubSubPublish:<topic_name>
For example:
.to("salesforce:pubsubPublish:/event/MyCustomPlatformEvent__e")
pubSubPublish
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Event payloads to be published |
Because The Pub/Sub API requires that event payloads be serialized in Apache Avro format, Camel will attempt to serialize event payloads from the following input types:
-
Avro
GenericRecord
. Camel fetches the Avro schema in order to serializeGenericRecord
instances. This option doesn’t require ahead-of-time generation of Event classes. -
Avro
SpecificRecord
. Subclasses ofSpecificRecord
contain properties that are specific to an event type. The maven plugin can generate the subclasses automatically. -
POJO. Camel fetches the Avro schema in order to serialize POJO instances. The POJO’s field names must match event field names exactly, including case.
-
String
. Camel will treat theString
value as JSON and serialize to Avro. Note that the JSON value does not have to be Avro-encoded JSON. It can be arbitrary JSON, but it must be serializable to Avro based on the Schema associated with the topic you’re publishing to. The JSON object’s field names must match event field names exactly, including case. -
byte[]
. Camel will not perform any serialization. Value must be the Avro-encoded event payload. -
com.salesforce.eventbus.protobuf.ProducerEvent
. Providing aProducerEvent
allows full control, e.g., setting theid
property, which can be tied back to thePublishResult.CorrelationKey
.
Output
Type: List<org.apache.camel.component.salesforce.api.dto.pubsub.PublishResult>
The order of the items in the returned List
correlates to the order of the items in the input List
.
The URI format for subscribing to a Pub/Sub topic is:
salesforce:pubSubSubscribe:<topic_name>
For example:
from("salesforce:pubSubSubscribe:/event/BatchApexErrorEvent")
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Values: |
|
|
|
|
When |
||
|
int |
Max number of events to receive at a time. Values >100 will be normalized to 100 by salesforce. |
100 |
X |
|
|
Values: |
|
X |
|
Fully qualified class name to deserialize Pub/Sub API event to. |
If |
Output
Type: Determined by the pubSubDeserializeType
option.
Headers: CamelSalesforcePubSubReplayId
The Streaming API enables streaming of events using push technology and provides a subscription mechanism for receiving events in near real time. The Streaming API subscription mechanism supports multiple types of events, including PushTopic events, generic events, platform events, and Change Data Capture events.
The URI format for consuming Push Topics is:
salesforce:subscribe:<topic_name>[?options]
To create and subscribe to a topic
from("salesforce:subscribe:CamelTestTopic?notifyForFields=ALL¬ifyForOperations=ALL&sObjectName=Merchandise__c&updateTopic=true&sObjectQuery=SELECT Id, Name FROM Merchandise__c")...
To subscribe to an existing topic
from("salesforce:subscribe:CamelTestTopic&sObjectName=Merchandise__c")...
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
SObject to monitor |
x |
|
|
|
SOQL query used to create Push Topic |
Required for creating new topics |
|
|
|
Whether to update an existing Push Topic if exists |
false |
|
|
|
Specifies how the record is evaluated against the PushTopic query. |
Referenced |
|
|
|
Whether a create operation should generate a notification. |
false |
|
|
|
Whether a delete operation should generate a notification. |
false |
|
|
|
Whether an undelete operation should generate a notification. |
false |
|
|
|
Whether an update operation should generate a notification. |
false |
|
|
|
Whether an update operation should generate a notification. Only for use in API version < 29.0 |
All |
|
|
|
The replayId value to use when subscribing. |
||
|
|
Default replayId setting if no value is found in initialReplayIdMap. |
-1 |
|
|
|
ReplayId to fall back to after an Invalid Replay Id response. |
-1 |
Output
Type: Class passed via sObjectName
parameter
To emit a platform event use the createSObject operation, passing an instance of a platform event, e.g. Order_Event__e
.
The URI format for consuming platform events is:
salesforce:subscribe:event/<event_name>
For example, to receive platform events use for the event type Order_Event__e
:
from("salesforce:subscribe:event/Order_Event__e")
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
If false, operation returns a |
false |
|
|
|
The replayId value to use when subscribing. |
||
|
|
Default replayId setting if no value is found in initialReplayIdMap. |
-1 |
|
|
|
ReplayId to fall back to after an Invalid Replay Id response. |
-1 |
Output
Type: PlatformEvent
or org.cometd.bayeux.Message
Change Data Capture (CDC) allows you to receive near-real-time changes of Salesforce records, and synchronize corresponding records in an external data store. Change Data Capture publishes change events, which represent changes to Salesforce records. Changes include the creation of a new record, updates to an existing record, deletion of a record, and undeletion of a record.
The URI format to consume CDC events is as follows:
All Selected Entities
salesforce:subscribe:data/ChangeEvents
Standard Objects
salesforce:subscribe:data/<Standard_Object_Name>ChangeEvent
Custom Objects
salesforce:subscribe:data/<Custom_Object_Name>__ChangeEvent
Here are a few examples
from("salesforce:subscribe:data/ChangeEvents?replayId=-1").log("being notified of all change events")
from("salesforce:subscribe:data/AccountChangeEvent?replayId=-1").log("being notified of change events for Account records")
from("salesforce:subscribe:data/Employee__ChangeEvent?replayId=-1").log("being notified of change events for Employee__c custom object")
More details about how to use the Camel Salesforce component change data capture capabilities could be found in the ChangeEventsConsumerIntegrationTest.
The Salesforce developer guide is a good fit to better know the subtleties of implementing a change data capture integration application. The dynamic nature of change event body fields, high level replication steps as well as security considerations could be of interest.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
If false, operation returns a |
false |
|
|
|
The replayId value to use when subscribing. |
||
|
|
Default replayId setting if no value is found in initialReplayIdMap. |
-1 |
|
|
|
ReplayId to fall back to after an Invalid Replay Id response. |
-1 |
Output
Type: Map<String, Object>
or org.cometd.bayeux.Message
Headers
Name | Description |
---|---|
|
|
-
getRecentReports - Gets up to 200 of the reports you most recently viewed.
-
getReportDescription - Retrieves report description.
-
executeSyncReport - Runs a report synchronously.
-
executeAsyncReport - Runs a report asynchronously.
-
getReportInstances - Returns a list of instances for a report that you requested to be run asynchronously.
-
getReportResults - Retrieves results for an instance of a report run asynchronously.
getRecentReports
Gets up to 200 of the reports you most recently viewed.
Output
Type: List<RecentReport>
getReportDescription
Retrieves the report, report type, and related metadata for a report, either in a tabular or summary or matrix format.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Report |
Required if not supplied in body |
|
Body |
|
Id of Report |
Required if not supplied in |
Output
Type: ReportDescription
executeSyncReport
Runs a report synchronously with or without changing filters and returns the latest summary data.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Report |
Required if not supplied in body |
|
|
|
Whether to include details |
false |
|
|
|
Optionally, pass ReportMetadata here instead of body |
||
Body |
|
If supplied, will use instead of |
Required if not supplied in |
Output
Type: AbstractReportResultsBase
executeAsyncReport
Runs an instance of a report asynchronously with or without filters and returns the summary data with or without details.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Report |
Required if not supplied in body |
|
|
|
Whether to include details |
false |
|
|
|
Optionally, pass ReportMetadata here instead of body |
||
Body |
|
If supplied, will use instead of |
Required if not supplied in |
Output
Type: ReportInstance
getReportInstances
Returns a list of instances for a report that you requested to be run asynchronously. Each item in the list is treated as a separate instance of the report.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Report |
Required if not supplied in body |
|
Body |
|
If supplied, will use instead of |
Required if not supplied in |
Output
Type: List<ReportInstance>
getReportResults
Contains the results of running a report.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
|
|
Id of Report |
Required if not supplied in body |
|
|
|
Id of Report instance |
x |
|
Body |
|
If supplied, will use instead of |
Required if not supplied in |
Output
Type: AbstractReportResultsBase
-
raw - Send requests to salesforce and have full, raw control over endpoint, parameters, body, etc.
raw
Sends HTTP requests to salesforce with full, raw control of all aspects of the call. Any serialization or deserialization of request and response bodies must be performed in the route. The Content-Type
HTTP
header will be automatically set based on the format
option, but this can be overridden with the rawHttpHeaders
option.
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
Body |
|
Body of the HTTP request |
||
|
|
The portion of the endpoint URL after the domain name, e.g., '/services/data/v51.0/sobjects/Account/' |
x |
|
|
|
The HTTP method |
x |
|
|
|
Comma separated list of message headers to include as query parameters. Do not url-encode values as this will be done automatically. |
||
|
|
Comma separated list of message headers to include as HTTP headers |
Output
Type: InputStream
In this example we’ll send a query to the REST API. The query must be passed in a URL parameter called "q", so we’ll create a message header called q and tell the raw operation to include that message header as a URL parameter:
from("direct:queryExample") .setHeader("q", "SELECT Id, LastName FROM Contact") .to("salesforce:raw?format=JSON&rawMethod=GET&rawQueryParameters=q&rawPath=/services/data/v51.0/query") // deserialize JSON results or handle in some other way
In this example, we’ll pass a Contact the REST API in a create
operation. Since the raw
operation does not perform any serialization,
we make sure to pass XML in the message body
from("direct:createAContact") .setBody(constant("<Contact><LastName>TestLast</LastName></Contact>")) .to("salesforce:raw?format=XML&rawMethod=POST&rawPath=/services/data/v51.0/sobjects/Contact")
The response is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Result> <id>0034x00000RnV6zAAF</id> <success>true</success> </Result>
Create the ContentVersion in Java, using a Processor instance:
public class ContentProcessor implements Processor {
public void process(Exchange exchange) throws Exception {
Message message = exchange.getIn();
ContentVersion cv = new ContentVersion();
ContentWorkspace cw = getWorkspace(exchange);
cv.setFirstPublishLocationId(cw.getId());
cv.setTitle("test document");
cv.setPathOnClient("test_doc.html");
byte[] document = message.getBody(byte[].class);
ObjectMapper mapper = new ObjectMapper();
String enc = mapper.convertValue(document, String.class);
cv.setVersionDataUrl(enc);
message.setBody(cv);
}
protected ContentWorkspace getWorkSpace(Exchange exchange) {
// Look up the content workspace somehow, maybe use enrich() to add it to a
// header that can be extracted here
....
}
}
Give the output from the processor to the Salesforce component:
from("file:///home/camel/library")
.to(new ContentProcessor()) // convert bytes from the file into a ContentVersion SObject
// for the salesforce component
.to("salesforce:createSObject");
org.apache.camel.component.salesforce.api.utils.QueryHelper
contains helper
methods to generate SOQL queries. For instance, to fetch all custom fields from
Account SObject, you can generate the SOQL SELECT by invoking:
String allCustomFieldsQuery = QueryHelper.queryToFetchFilteredFieldsOf(new Account(), SObjectField::isCustom);
The Maven plugin generates Java DTOs to represent salesforce objects.
Please refer to README.md for details on how to use the plugin.
spring-boot:partial$starter.adoc