Accelerator Salesforce OMS Event Listener - Implementation Template
home
This asset is a component of MuleSoft Accelerator for Salesforce OMS, which enables customers to extend and integrate OMS with external business partners and application ecosystems leveraging Anypoint platforms application and B2B Integration capabilities. The solution provides customers with an accelerated jump start to implement EDI messaging and other application integrations around Salesforce OMS.
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.
Overview
Accelerator Salesforce OMS Event Listener application subscribes to the Salesforce platform event OrderSumStatusChangedEvent
, OrderSummaryCreatedEvent
, FOStatusChangedEvent
, and InvoiceCreated__e
. The event message is transformed to CIM format and published to an Anypoint MQ destination.
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 and the application template imported into Anypoint Studio, proceed with the Prerequisites section.
Prerequisites
This implementation template has the following dependencies:
- Anypoint MQ Destinations
- Salesforce OMS Platform Events
Please review the use cases described on the MuleSoft Accelerators solution pages for more information about dependencies on other APIs and services.
Anypoint MQ destinations
In addition to the Anypoint MQ client application credentials, the following destinations must be created and made accessible to this API:
- oms-update-exchange-name
- oms-exception-queue
- retail-update-exchange
- retail-exception-queue
The Accelerator B2B Resources asset contains a Postman collection, which can be used to create the destinations and client application required for use by accelerator applications.
Deployment
Each Accelerator implementation template in Exchange includes Bash and Windows scripts for building and deploying the APIs to CloudHub. These scripts depend on repositories, global settings, deployment profiles, and associated properties configured in the Maven settings.xml
file.
For additional details, please refer to the Application Deployment section of the Getting Started Guide.
Preparation
Ensure the Maven profile CloudHub-DEV
has been properly configured in your settings.xml
file. In particular, make sure the common properties for your environment have been provided (e.g., Anypoint Platform client ID and secret).
Required property overrides
At a minimum, the following properties must be customized to reflect the target deployment environment.
Property Name | Description |
---|---|
anypoint-mq.client-id | Anypoint MQ Client Id |
anypoint-mq.client-secret | Anypoint MQ Client Secret |
sfdc.username | Salesforce Instance client user Name |
sfdc.token | Salesforce Instance client token |
sfdc.password | Salesforce Instance client password |
sfdc.client-id | The Consumer Id of the Connected App in Salesforce |
sfdc.client-secret | The Consumer secret of the Connected App in Salesforce |
Implementation notes
OrderSummaryCreatedEvent
is converted to CIM OrderCreatedEvent.- OrderSummary Created event processing can be enabled/disabled by using the property
oms-order-summary-created-event-listener-state
in the properties file. The allowed values arestarted
andstopped
. By default, OrderSummary Created event processing is enabled. OrderSumStatusChangedEvent
is converted to 2 different CIM events based on the OrderSummary status. If OrderSummary status isAllocated
, all the FulfillmentOrders for the received OrderSummary are retrieved and converted to CIM OrderAllocatedEvent. If OrderSummary status isClosed
, all the Invoices for the received OrderSummary are retrieved and converted to CIM OrderInvoicedEvent.- OrderSummary Status changed event processing can be enabled/disabled by using the property
oms-order-summary-status-changed-event-listener-state
in the properties file. The allowed values arestarted
andstopped
. By default, OrderSummary Status changed event processing is enabled. FOStatusChangedEvent
is converted to CIM OrderAllocatedEvent for each FulfillmentOrder if the Status isAllocated
.- FulfillmentOrder Status changed event processing can be enabled/disabled by using the property
oms-order-fulfillment-status-changed-event-listener-state
in the properties file. The allowed values arestarted
andstopped
. By default, FulfillmentOrder Status changed event processing is disabled. If enabled, setoms-order-summary-status-changed-event-listener-state
to disabled. InvoiceCreated__e
is converted to CIM OrderInvoicedEvent for each Invoice created.- Invoice Created event processing can be enabled/disabled by using the property
oms-invoice-created-event-listener-state
in the properties file. The allowed values arestarted
andstopped
. By default, Invoice Created event processing is disabled. If enabled, setoms-order-summary-status-changed-event-listener-state
to disabled. - The property
sales-channels
holds the list of Sales Channels Ids, for which the events are processed and converted to corresponding CIM event. The Sales Channel Ids should match the Ids in Salesforce. The events coming from the Sales Channel that are not specified in the property will not be processed. To find the Salesforce Ids for the requrired sales channels in OMS, querySELECT Id, SalesChannelName FROM SalesChannel
in Developer Console. - The OMS Event Listener receives events for various types:
OrderSummaryCreated
,OrderSummaryStatusChanged
- Allocated,OrderSummaryStatusChanged
- Closed,InvoiceCreated
, andFulfillmentOrderCreated
. Events such asOrderSummaryCreated
,OrderSummaryStatusChanged
- Allocated, andOrderSummaryStatusChanged
- Closed are processed in the OMS<->B2B use case. Meanwhile,InvoiceCreated
andFulfillmentOrderCreated
events are processed in the OMS->B2B->ERP use case. The events generated in the OMS Event Listener are filtered by thesalesChannelIds
for B2B and ERP and then sent to the respective exchanges.
Additional resources
- The Data mappings tab describes how the request and response data structures are mapped between the API interfaces.
- Refer to the Accelerators documentation home for more information about the MuleSoft Accelerators.