Accelerator Salesforce Party Event Listener - Implementation Template
home
This implementation template is a shared component of MuleSoft Accelerators, which accelerate the implementation of essential integration use cases.
The solution includes pre-built APIs, connectors, and integration templates that help unlock business-critical data from external systems and guide you in adopting best practices synthesized from thousands of customer implementations. Use these assets as is or extend them to meet your company’s unique needs.
Summary
The following functionality is supported by the Accelerator Salesforce Party Event Listener application.
CIM to Salesforce Objects Mapping
Salesforce Object - Record Type | CIM Type |
---|---|
Account - Person Accounts | Customer with PartyType as Individual |
Account - Account | Customer with PartyType as Organization |
Account - Household | Household |
Lead - Lead | Lead |
Contact | Individual |
Customer event listener
This event listener is subscribed to the Platform Event channel configured in Salesforce with API Name as Account__e
. A Trigger generates an Event based on changes in Account Object. This event listener can be started/stopped using the customer-event-listener-state
property in the configuration file.
The fields including customer and contact information are part of this Platform Event. These fields are received as JSON Object from Salesforce and transformed to CIM data type and published to Anypoint MQ. In case of any failures, the incoming original payload is published to dead letter queue by the exception handler.
Customer Address event listener
This event listener is subscribed to the Platform Event channel configured in Salesforce with API Name as AccountAddresses__e
. A Trigger generates an Event based on changes to a Postal Address on Account (Record Type as Person Account) Object. This event listener can be started/stopped using the customer-addresses-event-listener-state
property in the configuration file.
The fields including the address information are part of this Platform Event. These fields are received as JSON Object from Salesforce and transformed to CIM data type and published to Anypoint MQ. In case of any failures, the incoming original payload is published to the dead letter queue by the exception handler.
Contact event listener
This event listener is subscribed to the Platform Event channel configured in Salesforce with API Name as Contact__e
. A Trigger generates an Event based on changes in Account Object. This event listener can be started/stopped using the contact-event-listener-state
property in the configuration file.
The fields in the Platform Event include contact information. These fields are received as JSON Object from Salesforce and transformed to CIM data type (Party as Individual) and published to Anypoint MQ. In case of any failures, the incoming original payload is published to the dead letter queue by the exception handler.
Household event listener
This event listener is subscribed to the Platform Event channel configured in Salesforce with API Name as Household__e
. A Trigger generates an Event based on changes in Account Object. This event listener can be started/stopped using the household-event-listener-state
property in the configuration file.
The fields in the Platform Event include household account information. These fields are received as JSON Object from Salesforce and transformed to CIM data type (Party as Household) and published to Anypoint MQ. In case of any failures, the incoming original payload is published to the dead letter queue by the exception handler.
Lead event listener
This event listener is subscribed to the Platform Event channel configured in Salesforce with API Name as Lead__e
. A Trigger generates an Event based on changes in Account Object. This event listener can be started/stopped using the lead-event-listener-state
property in the configuration file.
The fields in the Platform Event include lead information. These fields are received as JSON Object from Salesforce and transformed to CIM data type (Party as Individual) and published to Anypoint MQ. In case of any failures, the incoming original payload is published to the dead letter queue by the exception handler.
Opportunities event listener
This event listener is subscribed to the Platform Event channel configured in Salesforce with API Name as Opportunity__e
. A Trigger generates an Event based on changes in Account Object.This event listener can be started/stopped using the opportunity-event-listener-state
property in the configuration file.
The fields in the Platform Event include Opportunity information. These fields are received as JSON Object from Salesforce and transformed to CIM data type (Party as Opportunity) and published to Anypoint MQ. As Opportunity is always related to Account in Salesforce, a call is made to accel-salesforce-customers-sys-api
opportunities endpoint to get the Account details. In case of any failure the incoming original payload is published to the dead letter queue by the exception handler.
Note:
- All the triggers filter records based on
LastModifiedBy <> Service Account User ID
to avoid cyclical updates. - The Mule idempotent message validator is used to ensure that only unique messages are published to Anypoint MQ. The Salesforce ID with an expiration interval and time-to-live (ttl) of 30 seconds (configurable) is used as the unique ID to filter out duplicate Mule messages.
- The current implementation does not support replay of Platform Events that were missed when the Mule application is down.
Getting started
The Getting Started with MuleSoft Accelerators guide provides general information on getting started with the accelerator components. This includes instructions on setting up your local workstation for configuring and deploying the applications. |
Once your workstation has been set up, proceed with the Getting started instructions for this asset.
Additional resources
- The Prerequisites tab provides detailed information about configuring dependencies this application has on external systems or services.
- The Deployment tab provides instructions on running the application locally from Studio or deploying to CloudHub.
- The Data mappings tab describes how the request and response data structures are mapped to CIM.