Portfolio Optimization Integration using a Web Service
Customers can create an Optimized Portfolio of their departments within their division or subclass within their departments. The Optimized Portfolio can also be interfaced to the MFP GA with the Portfolio Optimization System in AIF by integration using web service requests. MFP GA uses portfolios created at the Merch Target and Merch Plan levels. It is interfaced, using the Get Portfolio Opt planning action, directly into relevant workspaces that are pre-configured to get the data from an integrated Portfolio Optimization system through internal web service calls using the standard RPAS web service framework.
The RPAS web service framework uses the configured serviceConfig.json file, which can be used to map the RPAS dimensions/measures that are used in workbook templates against the keys present in web service requests and responses for web services created within RAP; the same web service can be triggered using the custom menu from those templates. For more details about the mapping of serviceConfig.json, see the Service Config Definitions section in the Deployment Tool chapter in the Oracle Retail Predictive Application Server Cloud Edition Configuration Tools User Guide.
Following are the details of the configured web service with Portfolio Optimization for the MFP GA configuration:
MPO Service Name: rase/resources/portfolio/v1/MPOptExp
MFP Service Name: MT_MPOptExp
Service Version: rsp
Web Service Request Input Key Mappings
The following table shows the key fields present in the web service and the corresponding mapping measures in MFP GA.
Key Name | Level | Description | Planning Mapped Measure/Dimension |
---|---|---|---|
requestID | User | Unique Request ID. | mtwsinitidt |
prodLevel | User | Product Level can be DEPT, CLS, or SBC. MFP GA uses DEPT for Merch Target and SBC for Merch Plan. | mtwsprodlt |
locLevel | User | Location Level can be COMPANY, PLANNING_CHANNEL, AREA, or LOCATION. MFP GA uses PLANNING_CHANNEL for Merch Target / Merch Plan. | mtwslocnlt |
clndLevel | User | Calendar Level can be YEAR or QRTR. Only two are supported in MPO for now. MFP GA defaults to YEAR. | mtwsclndlt |
prodScope | User | Optimization Product Scope Level can be CMP, DIV, GRP, or DEPT. It should be the level above prodLevel. For GA, it uses DIV in MT and DEPT in MP. | mtwsprodst |
locScope | User | Optimization Location Scope Level. In this release, Location Scope is defaulted to the same Location level. | mtwslocnst |
keyList | dept/chnl/year | Collection for List of Product/Location/Calendar key positions for which data is needed. | mtwsintidb |
prodKey | dept/chnl/year | Product Position ID (Department ID if Product Level is DEPT). | mtwsprodpt |
locKey | dept/chnl/year | Location Position ID (Channel ID if Location Level is PLANNING_CHANNEL). | mtwslocnpt |
clndKey | dept/chnl/year | Calendar Position ID (YEAR ID if Calendar Level is YEAR). | mtwsclndpt |
startDate | dept/chnl/year | Calendar Position Start Date. | mtwsfdopt |
Web Service Response Output Key Mappings
Key Name | Level | Description | Planning Mapped Measure/Dimension |
---|---|---|---|
MPOptExpHeader | User | Collection for the Main Request Response Header. | |
responseCode | User | Header Level Response Code. | mtwsrspht |
responseCodeMessage | User | Header Level Response Message. | mtwsrsphl |
MPOptExpDetail | User | Collection for the Main Request Response Details. | |
requestID | User | Same requestID provided in the input request. | mtwsintidt |
keyList | User | Collection for the List of Products/Store Cluster. | |
prodKey | dept/chnl/year | Same Product ID provided in the input request. | dept |
locKey | dept/chnl/year | Same Location ID provided in the input request. | chnc |
cldnKey | dept/chnl/year | Same Calendar key provided in the input request. | year |
optNSlsAmt | dept/chnl/year | Optimized Net Sales Amount. | mtwsnslsr |
optGSlsAmt | dept/chnl/year | Optimized Gross Sales Amount. | mtwsslsr |
keyRespCode | dept/chnl/year | Optional Response Code at Key Level. | mtwsrspdt |
keyRespMsg | dept/chnl/year | Optional Response Message at Key Level. | mtwsrspdl |
Note:
The mapping in the above table only shows the mapping of web service calls from the Merch Target template at the dept/chnl/year level with the name MT_MPOPExp and uses measures with the prefix mtws. Another similar mapping is also configured with the name MP_MPOPExp at the scls/chnl/year level and uses measures with the prefix mpws.On successful connection using a web service call, an Admin task with the name <service_name> from workbook <workbook_name> will be available in OAT. It shows the calls triggered from the template with the details of contents in the web service request and response in JSON format. Following is a sample request and response triggered from the Merch Target workbook for a successful call. The same OAT log can be used to debug any issues during the transfer of data using web service calls if the response has any errors due to any issues.
Sample Web Service Request Call
{ "requestID":"user_20250129104035", "prodLevel":"DEPT", "locLevel":"PLANNING_CHANNEL", "clndLevel":"YEAR", "prodScope":"DIV", "locScope":"PLANNING_CHANNEL" "keyList":[ { "prodKey":"100", "locKey" : "1", "clndKey" : "2025", "startDate" : "20250101" }, { "prodKey":"100", "locKey" : "2", "clndKey" : "2025", "startDate" : "20250101" } ] }
Sample Web Service Response Call
{ "MPOptExpHeader": { "responseCode": "100", "responseCodeMessage": "Optimization Data returned Successfully" }, "MPOptExpDetail": [ { "requestID": "user_20250129104035", "keyList":[ { "prodKey":"100", "locKey" : "1", "clndKey" : "2025", "optNSlsAmt" : "10000.00", "optGSlsAmt" : "12000.00", "keyRespCode" : "", "keyRespMsg" : "" }, { "prodKey":"100", "locKey" : "2", "clndKey" : "2025", "optNSlsAmt" : "12000.00", "optGSlsAmt" : "14000.00", "keyRespCode" : "", "keyRespMsg" : "" } ] } ] }