Salesforce Subscriber

The Salesforce Subscriber (earlier known as Salesforce Topic Subscriber) activity subscribes to a single Salesforce streaming topic or event and generates a process event from each message received. To subscribe to a topic or an event in Salesforce, you must configure the Salesforce Subscriber activity in .

Note: A process instance that contains the Salesforce Subscriber activity can be deployed on multiple hosts in an environment. Each of these process instances that is deployed on multiple hosts acts as a separate subscriber. These processes receive all the messages originating from the Push Topic, the Platform Event, or the Change Data Capture.

General

On the General tab, you can establish a connection to the Salesforce.com server. The following table lists the configurations on the General tab of the Salesforce Subscriber activity.

Field Module Property? Description
Name No The name is displayed as the label of the activity in the process.
Salesforce Connection Yes The path to the Salesforce shared resource.

Click the Choose/Create Default Resource icon and select a usable connection for the activity.

Subscriber Type No The type of subscriber. You can select either Push Topic, Platform Event, or Change Data Capture.

If you do not select any value for this field, the activity defaults to the Push Topic value.

Note: To migrate projects from earlier plug-in versions to the current version without any error, use WSDL 46.0 or later.

For more information about the Change Data Capture type, see the Salesforce Data Capture Developer Guide.

Salesforce Object No Ensures that the metadata for your development environment is up to date. It contains all the objects configured on the Salesforce system to which you are connected, including custom objects.

If you leave it blank, the output is a JSON string and the output schema is a text string containing the JSON representation of the object. However, if you select the object being streamed, its fields are displayed in the output.

To subscribe to Change Data Capture for a particular sObject: Select the corresponding ChangeEvent object from the list. For example, to subscribe to Change Data Capture for Account object, select the AccountChangeEvent object. The channel and output sections are updated accordingly.

Note: You can add custom fields to a Platform Event after you subscribe to it. To see these new fields in the output of the activity, refresh the metadata, reselect the event from the Salesforce object list, and save the project.
Channel Yes The topic name or event name of the stream to which the listener subscribes.

The topic name starts with /topic/, the change data capture starts with /data/, and the event name starts with /event/ in the value and continues with the topic name or event name configured on the Salesforce server.

Note: You can configure this activity only for a topic or event that exists on the Salesforce server.

Filter String Yes The filter string that can be used to fetch specific details about the Salesforce Object through the channel.

Example:?Firstname=TestFilter

Condition: This feature is available only when the subscriber type is Push Topic.

Persist ReplayID Yes

Persist ReplayID is supported on TIBCO® Cloud Integration using the Custom Database Configuration option in the Salesforce Connection shared resource. However, it is not supported for database configured by using ActiveMatrix BusinessWorks™ engine persistence datastore mode.

If there is no replay ID in the database, then it is replayed from the value provided in the Replay From field.

Note: When using Salesforce Subscriber activity with the persist ID feature, you must add the Confirm activity.

To use this feature, run the create.sql script to create the tables required to store the replay ID. The scripts for all databases are available at <TIBCO_HOME>/bw/palettes/salesforce/<version>/dbscripts/.

Note: When the replay ID goes beyond the 24-hour window of Salesforce, it is no longer valid. In such a scenario, the Salesforce Subscriber activity tries to subscribe to the channel only once more by using the value provided in the Replay From field. However, the value in the Replay From field must be either -1 or -2.

The Salesforce Subscriber activity retires only once more in case of non-persistent subscribers if the replay ID has been in the memory for more than 24 hours (when the last event has been received 24 hours ago). The value in the Replay From field must be -1 or -2.

Replay From Yes

Salesforce stores events for 24 hours. By configuring this field, you can retrieve events that are in the retention window.

  • -2 starts the replay from 24 hours ago.
  • -1 starts the replay from the moment that the listener starts.
  • An actual replay ID means all events after that ID can be retrieved.

    For example, if the actual ID is 7, the replay starts from 8 onwards.

Description

On the Description tab, enter a short description for the Salesforce Subscriber activity.

Advanced

The following table lists the configurations on the Advanced tab of the Salesforce Subscriber activity.

Field Description
Sequence Key

This field contains a XPath Expression that specifies the order in which processes run. Process instances with sequencing keys evaluated as the same value are run in the order they are created.

Custom Job Id

This field contains a XPath expression that specifies a custom ID for the process instance.

Output

On the Output tab, you can find the output value.

The following table lists the output elements on the Output tab of the Salesforce Subscriber activity.

Output Item Data Type Description
data
event createdDate String The date when the event was created.
replayId Integer Indicates the replay ID of the event.
type String Indicates the type of the event.
sObject Complex An array of sObjects representing the objects from Salesforce and containing data fetched from Salesforce. These sObjects can be substituted by using the derived objects of sObject defined in Salesforce_metadata.xsd in case of partner WSDL type or the enterprise WSDL in case of enterprise WSDL type.
Note: For parsing according to the output schema defined as per releases prior to this release, set the property com.tibco.bw.palette.salesorce.streaming.parseold to true.

Salesforce Streaming API Properties

Salesforce Subscriber activity exposes the following system properties which you can use when sending requests, receiving responses, and parsing a response from the Salesforce channel:

Property Description
com.tibco.plugin.salesforce.streaming.bufferSets the maximum size of the incoming message in megabytes.

To avoid the buffering capacity exceed error, set this property to an appropriate value. However, if the Subscriber encounters a buffering capacity exceeded error, an exception is generated. It can be caught in the CatchAll block and you can filter on the error code and take the appropriate steps to recover.

When the Subscriber encounters a buffering capacity exceeded error, an exception is generated and the Subscriber disconnects and unsubscribes from the channel.

com.tibco.plugin.salesforce.streaming.network.delaySets the maximum time in milliseconds to wait before considering a request to the Bayeux server.

To avoid connection timeout error, set this property to an appropriate value.