MuleSoft Accelerator for Salesforce Service Cloud
Use case 1 - Order history
Overview
The following use case is covered:
- Order History (Service Cloud <- OMS)
This use case shows you how to view the order history data from an external Order Management System (OMS) for the past 90 days within Service Cloud. The API should also allow searching for order history for a user-entered date-range.
High-level architecture
Workflow
- Service Cloud requests order history for a given customer/account number
- Determine OMS to call, based on configuration.
- Call OMS and transform order data into a standard format.
- Return order information to API Client.
- In case of error, return proper error code to Service Cloud.
Sequence diagram
Systems involved
- Service Cloud
- OMS: Currently represented by an open-source OMS (Apache OFBiz)
Setup instructions
Order Management System (OMS) Configuration
To set up the demonstration OMS DB application:
- Create the orders tables using the SQL scripts provided in the Mule project
- Insert orders data into the orders table.
Reference the Mule project "OMS System API" for SQL DDL scripts, which are located under src/test/resources/db_scripts.
Mule projects
Follow the README instructions in the following Mule template projects to set up, deploy, and run these projects.
- Salesforce Experience API | API Specification | Implementation Template
- Customers Process API | API Specification | Implementation Template
- OMS System API | API Specification | Implementation Template
Service Cloud Lightning Web Component (LWC) Setup
See the LWC page for more information, as well as detailed instructions on how to install the Light Web Component order history.
Service Cloud components & configurations:
- Lightning Web Components (LWC) will be configured to show order history information. Below is how it appears in Service Cloud
(Screenshot of the Lightning Web Component)
Data elements & mapping
- The table below illustrates the mapping from OFBiz order fields to the fields display by the LWC on Service Cloud
OFBiz field name | LWC field name | Description |
---|---|---|
customerId | partyId | Unique customer identification number |
saleorderId | orderId | Unique Sale order number |
orderNo | orderId | Unique number assigned to this order and displayed to end users. |
saleorderType | orderTypeId | The type of order. Change, Renewal or Amendment |
originalOrder | orderId | Reference to the parent order. Needed for reship, exchange and even swap orders |
saleorderStatus | statusId | Current order status e.g Draft, Read for Review, Placed, Read for Activation, Activated |
orderstartDate | orderDate | Date at which the order becomes effective. For subscription-type orders, this would be the date when the subscription begins. |
orderendDate | null | Date at which the order ends. For subscription-type orders, this would be the date when the subscription ends. |
promiseDate | null | Date the promise of the order would be fulfilled |
filedDate | orderDate | Date the order was filed |