MuleSoft Accelerator for Consumer Goods
phi-ime/Use case 1 - Trade promotion effectiveness
Visualize your promotions in one integrated platform with pre-built assets that integrate Business Intelligence Tools (BI Tools), such as CRM Analytics, into a TPM platform like Salesforce Consumer Goods Cloud.
Overview
- Description
- Solution definition
- Assumptions and constraints
- High-level architecture
- Sequence diagram
- Processing logic
- Successful outcome
See also
Description
Trade promotion management is often multi-faceted, vague, and non-lucrative. It requires effective collaboration among many key stakeholders including sales, finance, revenue growth management, demand planning, and marketing. However, the data needed to drive effective promotions is often siloed and inaccessible where it is needed most.
This use case unlocks critical data for analysis and allows key account managers and finance teams to run more efficient and data-driven trade promotions. This solution enables organizations to unify reporting and build visualizations to support their analysis of promotions, including optimizing pricing and reconciling baselines with actuals. With real-time access to this information, account teams are better equipped to optimize trade spend ROI and drive sustainable growth.
Ultimately, consumer goods companies and their stakeholders will be able to have a holistic view of their trade spend.
Glossary
Term | Definition |
---|---|
CG | Consumer Goods |
CRMA | CRM Analytics |
OS | Object Store |
RTR | Real Time Reporting |
Goals
- Support the extraction, transformation and loading of Promotion Tactics and Promotion Measures from Hyperforce into Salesforce CRM Analytics (Full Data Load).
- Orchestrate the Hyperforce APIs to:
- Trigger the export job for extracting the CSV files, including Promotion Tactics and Promotion Measures
- Check the status of the export job for completion and retrieve the files from Hyperforce.
- Commit the Hyperforce APIs, indicating the sucessful processing of the Hyperforce generated files.
- Transform the flat files generated by Hyperforce and upload them to Salesforce CRM Analytics.
- Upload the Promotion Tactics and Promotion Measures files to CRM Analytics to be ingested into dashboards.
Use case considerations
- Hyperforce System APIs enhance the backend Real Time Reporting Gateway APIs to provide a security layer as well as orchestrate the multiple backend RTR Gateway APIs to provide the response in a single API call.
- Hyperforce System APIs triggers the export of full load of files.
- The Data Normalisation Process API reads the files from the location returned by the Hyperforce System API.
- The Data Normalisation Process API stores the files in S3 bucket.
- AWS Lambda function extracts the .csv.gz file and split the files per million records.
- The Data Normalisation Process API processes each file in batch mode - reads it from S3, maps the contents of the file according to the normalisation rules and upserts the contents to the Salesforce Einstein Analytics Connector - Mule 4. On successful processing of the file, the Data Normalisation Process API moves it to archive folder in S3.
- The Data Normalisation Process API invokes the External Data Recipe API to acknowledge the successful upload of the files to CRM Analytics.
Technical considerations
- Real Time Reporting API Gateway should be setup and enabled in TPM prior to implementing the below use case.
- AWS Lambda services are used to split the full load files.
End-to-end scenarios
- Promotion Tactics created or updated in Hyperforce are reflected in Salesforce CRM Analytics.
- Promotion Measures created or updated in Hyperforce are reflected in Salesforce CRM Analytics.
Solution definition
The primary set of use cases covered in the current solution involve the synchronisation of Promotion Tactics and Promotion Measures data between Hyperforce and Salesforce CRM Analytics.
Goal
Integrate Promotion Tactics and Promotion Measures data from Hyperforce to Salesforce CRM Analytics.
Main success scenario
- Invoke the Hyperforce System APIs to initiate the export jobs in Hyperforce to retrieve Promotion Tactics and Promotion Measures based on a particular year. This is a scheduled job triggered by the Data Normalisation Process API.
- Hyperforce System API invokes the corresponding backend RTR Gateway API to trigger the export job.
- Hyperforce System API checks the status of the job for Ready status at a configured frequency.
- Hyperforce System API notifies the Data Normalisation Process API with the status of the completion of the export job along with the file.
- The Data Normalisation Process API stores the .cs.gz in an S3 bucket.
- An AWS Lambda function gets triggered in S3 which extracts the .csv.gz and splits the file per million records(configurable property:LINE_COUNT).
- The Data Normalisation Process API reads each file from S3, and then processes it using the batch module and transforms the contents as per the CRM Analytics mapping requirements. Then, the Data Normalisation Process API upserts them in respective datasets (configurable property:datasetName) in a shared application (configurable property:edgemartcontainer) in CRM Analytics.
- Once all the files are uploaded sucessfully to CRM Analytics, the Data Normalisation Process API:
- Invokes the External Data Recipe API to acknowledge the successful upload of data for the backend recipes to start ingesting the data to build the dashboards.
- Invokes the commit API to Hyperforce System API.
- The Hyperforce System API sends a request to the backend RTR Gateway API to commit the job in Hyperforce to avoid reading it again.
Assumptions and constraints
The following is used to guide or constrain the solution design at a high level:
High-level architecture
Sequence diagram
The diagram below illustrates the sequence of processing the Promotion Measures and Promotion Tactics to Salesforce CRM Analytics from Hyperforce.
Processing logic
The primary handling and orchestration of Promotion Tactics and Promotion Measures will be implemented in the Data Normalization Process API. This process can be described as follows:
- The Data Normalisation Process API runs on a schedule and sends an export job request to Hyperforce System API. The schedules can be set up in parallel per object or per metaName in Hyperforce.
- The Hyperforce System API will invoke the backend Hyperforce APIs to trigger the export of the requested metaName - IntegrationPromotionExport and PromoTacticExport (This can be replaced with metaNames configured on your organization's Hyperforce environment).
- The Hyperforce System API returns a 200 success response along with the generated jobId in Hyperforce.
- The Data Normalisation Process API checks for the status of the exported job from Step 1 using the the /status endpoint.
- When the status of the job is Ready, the Data Normalisation Process API invokes the /files endpoint in the Hyperforce System API to retreive the .csv.gz files.
- The Data Normalisation Process API stores the .cs.gz in an S3 bucket.
- An AWS Lambda function is triggered in S3, which extracts the .csv.gz and splits the file per million records.
- The Data Normalisation Process API reads each file from S3 and processes it using the batch module and transforms the contents as per the CRM Analytics mapping requirements. Then, the Data Normalisation Process API upserts them in respective datasets(configurable property:datasetName) in a shared application (configurable property:edgemartcontainer) in CRM Analytics.
- Once all the files are uploaded sucessfully to CRM Analytics, the Data Normalisation Process API:
- Invokes the External Data Recipe API to acknowledge the successful upload of data for the backend recipes to start ingesting the data to build the dashboards.
- Invokes the commit endpoint in the Hyperforce System API.
- The Hyperforce System API sends a request to the backend RTR Gateway API to commit the job in Hyperforce to avoid reading it again.
Successful outcome
After completing the update processing for all target systems successfully, the following conditions will be met:
- Promotion Measures from a particular year in the Salesforce Consumer Goods Cloud are synchronised with Salesforce CRM Analytics.
- Promotion Tactics from a particular year in the Salesforce Consumer Goods Cloud are synchronised with Salesforce CRM Analytics.
Workflow
The use case is triggered when:
- The schedule for the export job for IntegrationPromotionExport in Hyperforce is triggered
- The schedule for the export job for PromoTacticExport in Hyperforce is triggered
The RCG Data Normalisation Process API invokes the RCG Hyperforce System API on a schedule to trigger the Hyperforce jobs for IntegrationPromotionExport and PromoTacticExport for a given sales organization and year.
Systems involved
- Hyperforce
- CRM Analytics
Setup instructions
Before you begin
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. |
Downloadable assets
Accelerator System APIs
RCG Hyperforce System API | API Specification | Implementation Template
RCG CRM Analytics System API | API Specification | Implementation Template
Accelerator Process APIs
- RCG Data Normalisation Process API | API Specification | Implementation Template