Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Configuring Salesforce Platform to connect with Pega Process Fabric Hub

Updated on February 24, 2022

Seamlessly manage your work from multiple sources by configuring your Salesforce Platform to communicate with Pega Process Fabric Hub in real time, through the wrapper application. As a result, you gain a unified interface that aggregates data from remote applications and helps workers resolve work faster without switching context."

To prepare a connection between your instance of Salesforce Platform and Pega Process Fabric Hub, you need to obtain Salesforce credentials and a security token, and then call a series of Salesforce Tooling APIs to prepare a communication channel and fields to map data from your Salesforce Platform to Pega Process Fabric Hub.

Important: The Pega Process Fabric Hub Connector component for Salesforce is a product offered fully by Pegasystems. Salesforce does not offer, sponsor, or endorse Pega Process Fabric Hub Connector for Salesforce, and Pegasystems does not offer, sponsor, or endorse any Salesforce products.

Obtaining Salesforce credentials

Connect your Salesforce Platform to Pega Process Fabric Hub through a wrapper application by obtaining a Salesforce security token.

The security token and your Salesforce user name are required to register the wrapper application with Pega Process Fabric Hub.
Before you begin: Ensure that you use a version of Salesforce Platform other than the trial version.
  1. In Salesforce Platform, create a connected app by enabling OAuth authorization settings for Salesforce API integration.
    For more information, refer to Salesforce documentation on creating a connected app.
  2. Configure OAuth access policies for OAuth-enabled connected app.
    The access policies include defining which users can access a connected app, what IP restrictions apply to the connected app, and how long a refresh token is valid. For more information, refer to Salesforce documentation on managing OAuth access policies for a connected app.
  3. In the connected app, copy the consumer key and consumer secret, and then save the values on your local machine.
    For more information about navigating to consumer credentials, refer to Salesforce documentation.
  4. Obtain a security token by resetting the security token in your connected app.
    For more information about the security token, refer to Salesforce documentation.
    Result: You receive an email with the new security token. Ensure that you keep the email, because the security token is required for registering a wrapper application with Pega Process Fabric Hub.

Configuring a Salesforce custom event channel and change event enrichment

For real-time updates between your Salesforce Platform and Pega Process Fabric Hub, subscribe to a custom channel by creating an event channel and adding event enrich fields. As a result, you ensure that Pega Process Fabric Hub displays the most accurate and latest data from your remote system.

You can create custom event channels for any Salesforce entities required by your business scenario. Standard Salesforce entities include Opportunity and Work Order. Salesforce publishes entity information to the custom event channel. Pega Process Fabric Hub Connector in a wrapper application monitors the channel and then publishes information to Pega Process Fabric Hub. Fields that you include in the custom event channel are mapped to fields in the assignment data in Pega Process Fabric Hub.
  1. Obtain a Salesforce access token that is required for calling Salesforce Tooling APIs by using the following data:
    ElementValue
    MethodPOST
    Request URLhttps://login.salesforce.com/services/oauth2/token
    Client IDConsumer key obtained in the connected app.

    For more information, see Obtaining Salesforce credentials.

    Client secretConsumer secret obtained in the connected app.

    For more information, see Obtaining Salesforce credentials.

    Grant typepassword
    User nameYour user name in Salesforce Platform.
    PasswordYour password in Salesforce Platform and the security token obtained from the connected app.

    For more information, see Obtaining Salesforce credentials.

    Result: The response body includes the access token that you can use for Salesforce APIs, as shown in the following example:
    {"access_token": "00D5g00000A55tR!ARoAQBuTF6PzXL4N2Agz71krq57fD_KBmSPIkiilu8tsxGyN5jraYsyxUp_E4_qaG5H04bRL7yW3chqr1PGV3b._zJEpnZ87",
    "instance_url": "https://sample.my.salesforce.com", 
    "id": "https://login.salesforce.com/id/00D5g00000A55tREAR/0055g00000Bt4CyAAX", 
    "token_type": "Bearer", 
    "issued_at": "1636537700457", 
    "signature": "X6+8U1ynOY9drL9e1ZgQmTWCDqxy2VCdxLiiRJvFpLU="}
  2. By using an API tool of your choice, create a new channel by using a Tooling API with the following values:
    ElementValue
    MethodPOST
    Request URLInstance URL received in the access token response with a /services/data/v51.0/tooling/sobjects/PlatformEventChannel part added, for example https://sample.my.salesforce.com/services/data/v51.0/tooling/sobjects/PlatformEventChannel
    Sample request body of JSON type for creating a channel for an Opportunity entity
    {"FullName": "OpportunityEvents__chn", 
      "Metadata": {"channelType": "data", "label": "My Opportunity Events Channel"}}
    Sample request body of JSON type for creating a channel for a Work Order entity
    {"FullName": "WorkOrderEvents__chn", 
      "Metadata": {"channelType": "data", "label": "My Work Order Events Channel"}}
  3. Use an API tool of your choice to add fields to the new event channel by using a Tooling API with the following values:
    ElementValue
    MethodPOST
    Request URLInstance URL received in the access token response with a /services/data/v51.0/tooling/sobjects/PlatformEventChannelMember part added, for example https://sample.my.salesforce.com/services/data/v51.0/tooling/sobjects/PlatformEventChannelMember
    Sample request body of JSON type with enrichment fields added in an OpportunityEvents__chn channel member for an Opportunity entity
    {"FullName": "OpportunityEvents_chn_OpportunityChangeEvent", 
      "Metadata": {"enrichedFields": [{"name": "OwnerId"},{"name": "Name"},{"name": "CloseDate"},{"name": "Probability"},{"name": "LastModifiedDate"}, {"name": "LastModifiedById"}, {"name": "IsClosed"}, {"name": "AccountId"}, {"name": "CreatedById"}, {"name": "CreatedDate"}], 
        "eventChannel": "OpportunityEvents__chn", 
        "selectedEntity": "OpportunityChangeEvent"}}
    Sample request body of JSON type with enrichment fields added in a WorkOrderEvents__chn channel member for a Work Order entity
    {"FullName": "WorkOrderEvents_chn_ WorkOrderChangeEvent", 
      "Metadata": {"enrichedFields": [{"name": "OwnerId"}, {"name": "Subject"}, {"name": "WorkOrderNumber"}, {"name": "Priority"}, {"name": "LastModifiedDate"}, {"name": "LastModifiedById"}, {"name": "IsClosed"}, {"name": "AccountId"}, {"name": "CreatedById"}, {"name": "CreatedDate"}], 
        "eventChannel": "WorkOrderEvents__chn", 
        "selectedEntity": "WorkOrderChangeEvent"}}
    Note: Fields that you select for enrichment are included in change events for update and delete operations. Enrichment fields are not included in change events for create and undelete operations because these events contain all the populated fields.

    For more information about enriching custom event channels, refer to Salesforce documentation.

  4. Optional: To update the fields, for example, if an initial request lacks some fields, use a Tooling API and the following values:
    ElementValue
    MethodPATCH
    Request URLInstance URL received in the access token response with a /services/data/v51.0/tooling/sobjects/PlatformEventChannelMember/{memberID} part added, for example https://sample.my.salesforce.com/services/data/v51.0/tooling/sobjects/PlatformEventChannelMember/{memberID}.

    The {memberID} is the id element from the response body that you receive after calling a Tooling API to obtain a Salesforce access token.

    Sample request body of JSON type with enrichment fields updated in an OpportunityEvents__chn channel member for an Opportunity entity
    {"FullName": "OpportunityEvents_chn_OpportunityChangeEvent", 
      "Metadata": {"enrichedFields": [{"name": "OwnerId"}, {"name": "WorkOrderNumber"}, {"name": "Priority"}, {"name": "LastModifiedDate"}, {"name": "LastModifiedBy"}, {"name": "CloseDate"}, {"name": "Probability"}, {"name": "LastModifiedDate"}, {"name": "LastModifiedById"}], 
        "eventChannel": "OpportunityEvents__chn", 
        "selectedEntity": "OpportunityChangeEvent"}}
    Sample request body of JSON type with enrichment fields updated in a WorkOrderEvents__chn channel member for a Work Order entity
    {"FullName": "WorkOrderEvents_chn_ WorkOrderChangeEvent",  
      "Metadata": {"enrichedFields": [{"name": "OwnerId"}, {"name": "Subject"}, {"name": "WorkOrderNumber"}, {"name": "LastModifiedDate"}, {"name": "LastModifiedById"}, {"name": "IsClosed"}, {"name": "AccountId"}, {"name": "CreatedById"}, {"name": "CreatedDate"}],  
        "eventChannel": "WorkOrderEvents__chn",  
        "selectedEntity": "WorkOrderChangeEvent"}}

    For more information, refer to Salesforce documentation on enrichment fields and Tooling API.

  • Previous topic Pega Process Fabric Hub Connector for Salesforce Platform
  • Next topic Configuring a Pega Platform wrapper application

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us