Extending real-time container request

From PegaWiki
This is the approved revision of this page, as well as being the most recent.
Jump to navigation Jump to search

Extending real-time container request

Description Extend the real-time container payload so an external application can pass additional input.
Version as of 8.4
Application Pega Customer Decision Hub
Capability/Industry Area Digital Personalization



Purpose

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

An application needs to send aggregated data for each entity (for example department).

Before you begin

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

  1. Create a custom class that represents the request. Class: RequestData PageList: -PatronID -PEPAggregates
  2. Create a property in the container payload class. Class: PegaMKT-Data-Container Page: -RequestData
  3. Add the property to the Int-PegaCDH-Container-Request class.
  4. Access the property in the decision strategy from a Set property component. Category = Primary.ContainerPayload.RequestData.PatronID

Results

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"

}]

}

}