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 event in Salesforce, you must configure the Salesforce Subscriber activity in TIBCO Business Studio .

General

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 and receives all the messages originating from the Push Topic or Platform Event.

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 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 plug-in version 6.6 or earlier 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. In this case 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: When you add custom fields to a Platform Event after you subscribe to it, to see these new fields in the output of the activity, you must refresh the metadata and 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/ and 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

When checked, the messages are replayed from the replay ID that is stored in the database.

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

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

To configure TIBCO BusinessWorks engine persistence, see "Configuring Database for the Engine" topic in the Application Development guide in the ActiveMatrix BusinessWorks™ documentation.

Note: When the replay ID in the database 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.
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 the listener starts.
  • An actual replay ID means all events after that ID can be retrieved.

    For example, if the actual ID is 7, then 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 an 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 an 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.