Salesforce connector

The Salesforce connector is used to integrate with an installation of Salesforce. This allows processes to operate on Salesforce objects in a number of ways. The Salesforce connector is graphically represented by the Salesforce logo under the OOTB Connectors menu whilst modeling a process.

The following actions can be executed using the Salesforce connector:

Configuration parameters

The Salesforce connector requires a developer account to interact with Activiti Enterprise. The following credentials need to be obtained and set as configuration parameters in the modeling application or during application deployment:

ParameterDescriptionDefault
SALESFORCE_CLIENT_IDThe ID of your Salesforce account
SALESFORCE_CLIENT_SECRETThe secret associated to your Salesforce account
SALESFORCE_USERNAMEThe user that the connector will use to interact with Salesforce
SALESFORCE_PASSWORDThe password for the user will use to interact with Salesforce
SALESFORCE_SECURITY_TOKENThe security token for the user that will interact with Salesforce
SALESFORCE_URL_LOGINThe URL to login to Salesforcehttps://login.salesforce.com/services/oauth2/token
SALESFORCE_SOAP_URL_LOGINThe URL for SOAP requestshttps://login.salesforce.com/services/Soap/c/45.0
SALESFORCE_VERSIONThe version of Salesforce45.0

Output parameters

The following are the output parameters that all actions in the Salesforce connector use:

ParameterDescriptionType
salesforceResultThe result from the REST or SOAP call from SalesforceString
salesforceStatusThe HTTP status code of the responseInteger
salesforceErrorA list of errors if any are caught by the connectorString

Note: The execution of the Salesforce connector is always successful. Any errors will be returned in the salesforceError parameter. The parameter will be null if there were no errors.

Create an object instance

The CREATE action is used to create an object instance in Salesforce.

The implementation value of the create action in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_5lhj3ty" implementation="salesforceConnector.CREATE" />

The following are the parameters that can be passed to the Salesforce connector as input parameters using the CREATE action:

ParameterDescriptionTypeRequired?
SObjectNameThe name of a valid Salesforce object to operate on, for example AccountStringYes
salesforcePayloadThe payload to send to Salesforce as a JSON map. See Salesforce API documentation for valid fieldsJSON objectYes

Get an object instance

The GET action is used to retrieve an existing object instance from Salesforce.

The implementation value of the get action in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_5lhj3ty" implementation="salesforceConnector.GET" />

The following are the parameters that can be passed to the Salesforce connector as input parameters using the GET action:

ParameterDescriptionTypeRequired?
SObjectNameThe name of a valid Salesforce object to operate on, for example AccountStringYes
SObjectIdThe ID of the object to retrieveStringYes

Update an object instance

The UPDATE action is used to update an existing object instance in Salesforce.

The implementation value of the update action in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_5lhj3ty" implementation="salesforceConnector.UPDATE" />

The following are the parameters that can be passed to the Salesforce connector as input parameters using the UPDATE action:

ParameterDescriptionTypeRequired?
SObjectNameThe name of a valid Salesforce object to operate on, for example AccountStringYes
SObjectIdThe ID of the object to updateStringYes
salesforcePayloadThe payload to send to Salesforce as a JSON map. See Salesforce API documentation for valid fieldsJSON objectYes

Delete an object instance

The DELETE action is used to delete an existing object instance in Salesforce.

The implementation value of the delete action in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_5lhj3ty" implementation="salesforceConnector.DELETE" />

The following are the parameters that can be passed to the Salesforce connector as input parameters using the DELETE action:

ParameterDescriptionTypeRequired?
SObjectNameThe name of a valid Salesforce object to operate on, for example AccountStringYes
SObjectIdThe ID of the object to deleteStringYes

Query an object instance

The QUERY action is used to query existing object instances in Salesforce.

The implementation value of the query action in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_5lhj3ty" implementation="salesforceConnector.QUERY" />

The following is the parameter that can be passed to the Salesforce connector as an input parameter using the QUERY action:

ParameterDescriptionTypeRequired?
salesforceQueryA valid query against SalesforceStringYes

Submit an object instance for approval

The approval_submit action is used to submit an existing object instance for approval in Salesforce.

The implementation value of the submission action in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_5lhj3ty" implementation="salesforceConnector.approval_submit" />

The following is the parameter that can be passed to the Salesforce connector as an input parameter using the approval_submit action:

ParameterDescriptionTypeRequired?
salesforcePayloadThe submission payload to send to Salesforce as a JSON map. See Salesforce API documentation for valid fieldsJSON objectYes

Query approval processes

The approval_list action is used to query the current approval processes in Salesforce.

The implementation value of the query action in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_5lhj3ty" implementation="salesforceConnector.approval_list" />

No input parameters need to be passed with the approval_list action.

Approve an object instance submitted for approval

The approval_approve action is used to approve an existing object instance that has been submitted for approval in Salesforce.

The implementation value of the approval action in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_5lhj3ty" implementation="salesforceConnector.approval_approve" />

The following is the parameter that can be passed to the Salesforce connector as an input parameter using the approval_approve action:

ParameterDescriptionTypeRequired?
salesforcePayloadThe approval payload to send to Salesforce as a JSON map. See Salesforce API documentation for valid fieldsJSON objectYes

Reject an object instance submitted for approval

The approval_reject action is used to reject an existing object instance that has been submitted for approval in Salesforce.

The implementation value of the rejection action in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_5lhj3ty" implementation="salesforceConnector.approval_reject" />

The following is the parameter that can be passed to the Salesforce connector as an input parameter using the approval_reject action:

ParameterDescriptionTypeRequired?
salesforcePayloadThe rejection payload to send to Salesforce as a JSON map. See Salesforce API documentation for valid fieldsJSON objectYes

Create a custom object definition

The custom_object_create action is used to create a custom object definition using the Salesforce SOAP metadata API.

The implementation value of the custom object action in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_5lhj3ty" implementation="salesforceConnector.custom_object_create" />

The following is the parameter that can be passed to the Salesforce connector as an input parameter using the custom_object_create action:

ParameterDescriptionTypeRequired?
salesforcePayloadThe custom metadata creation payload to send to Salesforce as a JSON map. See Salesforce API documentation for valid fieldsJSON objectYes

© 2023 Alfresco Software, Inc. All Rights Reserved.