Accelerator Salesforce OMS Event Listener - Implementation Template

(0 reviews)

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

bulb.png 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:

  1. oms-update-exchange-name
  2. oms-exception-queue
  3. retail-update-exchange
  4. 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 NameDescription
anypoint-mq.client-idAnypoint MQ Client Id
anypoint-mq.client-secretAnypoint MQ Client Secret
sfdc.usernameSalesforce Instance client user Name
sfdc.tokenSalesforce Instance client token
sfdc.passwordSalesforce Instance client password
sfdc.client-idThe Consumer Id of the Connected App in Salesforce
sfdc.client-secretThe Consumer secret of the Connected App in Salesforce

Implementation notes

  1. OrderSummaryCreatedEvent is converted to CIM OrderCreatedEvent.
  2. 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 are started and stopped. By default, OrderSummary Created event processing is enabled.
  3. OrderSumStatusChangedEvent is converted to 2 different CIM events based on the OrderSummary status. If OrderSummary status is Allocated, all the FulfillmentOrders for the received OrderSummary are retrieved and converted to CIM OrderAllocatedEvent. If OrderSummary status is Closed, all the Invoices for the received OrderSummary are retrieved and converted to CIM OrderInvoicedEvent.
  4. 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 are started and stopped. By default, OrderSummary Status changed event processing is enabled.
  5. FOStatusChangedEvent is converted to CIM OrderAllocatedEvent for each FulfillmentOrder if the Status is Allocated.
  6. 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 are started and stopped. By default, FulfillmentOrder Status changed event processing is disabled. If enabled, set oms-order-summary-status-changed-event-listener-state to disabled.
  7. InvoiceCreated__e is converted to CIM OrderInvoicedEvent for each Invoice created.
  8. 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 are started and stopped. By default, Invoice Created event processing is disabled. If enabled, set oms-order-summary-status-changed-event-listener-state to disabled.
  9. 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, query SELECT Id, SalesChannelName FROM SalesChannel in Developer Console.
  10. The OMS Event Listener receives events for various types: OrderSummaryCreated, OrderSummaryStatusChanged - Allocated, OrderSummaryStatusChanged - Closed, InvoiceCreated, and FulfillmentOrderCreated. Events such as OrderSummaryCreated, OrderSummaryStatusChanged - Allocated, and OrderSummaryStatusChanged - Closed are processed in the OMS<->B2B use case. Meanwhile, InvoiceCreated and FulfillmentOrderCreated events are processed in the OMS->B2B->ERP use case. The events generated in the OMS Event Listener are filtered by the salesChannelIds for B2B and ERP and then sent to the respective exchanges.

Additional resources


Reviews

TypeTemplate
OrganizationMuleSoft
Published by
MuleSoft Solutions
Published onMay 21, 2024
Asset overview

Asset versions for 1.0.x

Asset versions
VersionActions
1.0.1
1.0.0