Links may not function; however, this content may be relevant to outdated versions of the product.
Headless decisioning in Pega 7.1.8 to Pega 7.2.1
The decision management capabilities of the Pega 7 Platform automate and enhance the decision-making process for your customers. By using these capabilities, your organization can make next-best-action decisions to balance customer needs with your business requirements. One scenario in which next-best-action strategies are used is "headless decisioning," in which channel applications request decisions for specific customers and capture customer behavior. To implement the logic of the decision and the response, this scenario uses instances of the Strategy rule and Data Flow rule.
- Use case for the headless decisioning scenario
- Decisioning process in the headless decisioning scenario
- Rules used by this headless decisioning scenario
Use case for the headless decisioning scenario
In this scenario, customers log in to a website where they see a number of clickable banners. The banners and their position on the page are decided by Pega Decision Management. When a customer clicks a banner, the channel application sends this information to Pega Decision Management, which stores it in the customer's interaction history, and refines the adaptive model. With this approach, the adaptive model always uses the updated data, so that when customers go to the website in the future, they see banners that they are likely to click. We are going to use this setup through the rest of the tutorial.
Decisioning process in the headless decisioning scenario
When a customer logs in to a website, the customer enters a user name (ID) and password. Pega REST service calls the ServiceActivity activity in the DMOrg-DMSample-Int-Decision class and passes the customer's ID. Then, the ServiceActivity activity invokes the DecisionFlow data flow for this customer. The NextBestAction strategy that is referenced from the DecisionFlow data flow selects the banners to display on the website. When the customer clicks one of the banners, the website invokes the response service that calls the ServiceActivity activity created in the DMOrg-DMSample-Int-Response class. The ServiceActivity activity invokes the ResponseFlow data flow for the customer. The ResponseStrategy strategy that is referenced from the Response data flow gets the list of the customer's decision results from decision time, as well as the customer properties that rank the banners by using adaptive models. This data is used to update the previous results (the pxInteractionHistory data set) and refine the adaptive models (in the pxAdaptiveAnalytics data set).
Headless decisioning process
Rules used by this headless decisioning scenario
The headless decisioning scenario uses several business rules. Before you learn how to use the Data Flow rules to set up a headless scenario, you need to prepare two instances of the Service REST rule, the Activity rule, and the Strategy rule. For details about how to create any rule instances, see Creating a rule or data instance.
To build a headless decisioning scenario for our use case, we use the following rule instances:
The DecisionService service in the DMOrg-DMSample-Int-Decision class
To invoke this service on any system, use the following URL address: http://<IPaddress>/prweb/PRRestService/DMSampleServices/DMSample/DecisionService/decision?CustomerID=<CustomerID>.
For example, http://192.168.12.56/prweb/PRRestService/DMSampleServices/DMSample/DecisionService/decision?CustomerID=CE-1.
The service call returns offers in XML format, like this:
<Decision>
<CustomerID>CE-1</CustomerID>
<InteractionID>641889359827003657</InteractionID>
<Results>
<Result>
<Issue>Banners</Issue>
<Group>Sales</Group>
<Name>Banner1</Name>
<Rank>1</Rank>
</Result>
</Decision>The ResponseService service in the DMOrg-DMSample-Int-Response class
To invoke this service on any system, use the following URL address: http://<IPaddress>/prweb/PRRestService/DMSampleServices/DMSample/ResponseService/response?CustomerID=<CustomerID>&InteractionID=<InteractionID>.
For example, http://192.168.12.56/prweb/PRRestService/DMSampleServices/DMSample/ResponseService/response?CustomerID=CE-1>&InteractionID=641889359827003657. The customer ID and interaction ID match the values that you get when making a decision.
The response call returns offers in XML format, like this:
<Response>
<Propositions>
<Proposition>
<Issue>Banners</Issue>
<Group>Sales</Group>
<Name>Banner1</Name>
</Proposition>
</Propositions>
</Response>For details about how to create REST services, see About Service REST rules.
The ServiceActivity activity in the DMOrg-DMSample-Int-Decision class
The ServiceActivity activity in the DMOrg-DMSample-Int-Response class
For details about how to create activities, see About Activities.
The NextBestAction strategy in the DMOrg-DMSample-Data-Customer class
The ResponseStrategy strategy in the DMOrg-DMSample-Int-Response class
For details about how to create strategies, see Tutorial: Creating decision strategies for a headless decisioning scenario.
- The DecisionFlow data flow in the DMOrg-DMSample-Int-Decision class
The ResponseFlow data flow in the DMOrg-DMSample-Int-Response class
For details about how to create data flows, see Tutorial: Building a headless decisioning scenario with data flows.
After you create the required rule instances and configure them according to the information provided in the tutorials, the headless decisioning scenario is ready to use.