Extending real-time container request
Extending real-time container request
Purpose[edit]
Extend the real-time container payload so an external application can pass additional input, which could be used by the decision strategy.
Use case examples[edit]
An application needs to send aggregated data for each entity (for example department).
Before you begin[edit]
For a basic understanding of real-time containers, see the Pega Customer Decision Hub User Guide on Pega Documentation.
Extending the real-time container request[edit]
- Create a custom class that represents the request. Class:
RequestData
PageList:-PatronID -PEPAggregates
- Create a property in the container payload class. Class:
PegaMKT-Data-Container
Page:-RequestData
- Add the property to the
Int-PegaCDH-Container-Request
class. - Access the property in the decision strategy from a Set property component. Category =
Primary.ContainerPayload.RequestData.PatronID
Results[edit]
Testing / verification:
Simple Request
Request:
{
"ContainerName": "AllOffers",
"CustomerID": "Customer1",
"RequestData":{
"PatronID": "Customer1",
"PEPAggregates":""
}
}
Returns - Status OK and relevant offers with "Customer1" in category
Aggregate Pagelist
{
"ContainerName": "AllOffers",
"CustomerID": "Customer1",
"RequestData":{
"PatronID": "Customer1",
"PEPAggregates": [{
"Days": "7",
"Department": "Department101",
"PointBalance": "100.11"
},
{
"Days": "7",
"Department": "Department101",
"PointBalance": "1.0"
},
{
"Days": "7",
"Department": "Department102",
"PointBalance": "100.11"
}]
}
}