How to test next best action strategy for a single customer in multiline decisioning context
How to test next best action strategy for a single customer in multiline decisioning context
Use case examples[edit]
It is crucial that you can find out at which stage of the next-best-action strategy framework execution a single customer is filtered out. If you are getting “Why customer X doesn’t get action Y?” type questions in your user acceptance tests, or in production environment, or in both, this article will enable you to efficiently run diagnostics at strategy layer for a single customer.
Before you begin[edit]
- Configure your Context Dictionary definitions according to your project requirements.
- Make sure to fully understand how multilevel decisioning works.
For more information, see Understanding multilevel decisioning and the Context Dictionary on Pega Docs.
Verify Context Dictionary Definitions[edit]
In multilevel decisioning, customer/subscriber class must be defined as your primary context. At a database tier, there is a one-to-many relationship between Account data and Customer Data entity. Therefore, you should associate the same customer/subscriber class with the Account class.
Create a customer/subscriber data flow[edit]
- In Dev Studio, create a new data flow in your Primary customer class, ideally at Artifacts ruleset.
- Implement the following structure: a) Make the Primary context customer/subscriber class as your first entity in the data flow. You can see the same pattern in auto generated campaign data flows as well.
b) Use the inbuilt Exclusion List data set under PegaMKT-Data-ExclusionDefault class to mimic production environment behaviour.
c) Add a new Compose shape.
d) Use the out-of-the-box ExclusionList property and join by using CustomerID property.
e) In the following shape, filter out these customers by a Filter rule condition e.g. @LengthOfPageList(.ExclusionList)=0
f) Then in the Convert shape, select Top-Level option, convert to DDRC (Data-Decision-Request-Customer) class, check Field mapping and join from pySubjectID to CustomerID (or SubscriptionID).
g) Import the auto generated Subscription/Customer data class under Account class. This out-of-the-box data flow will create the mandatory Account and customer properties which will be used by next best action strategy in runtime.
Compose property is the Account property under Data-Decision-Request-Customer class, which is a single page. Join condition is from SubscriptionID/CustomerID to pySubjectID.
g) Request Payload properties is an optional data transform element in the data flow. If you are testing an Inbound request or an event use-case, you can populate the data transform as per your test input.
h) Finalize the data flow rule with an Abstract implementation and click Check in.
Result[edit]
Now, you are ready to test next-best-action framework strategy with your custom data flow.
- In Pega Customer Decision Hub™ portal, search and open Trigger_NBA_TopLevel strategy.
- In Test run pane, in Single case tab, call your data flow after enabling the Data flow option.
- Provide the required customer/subscriber identifiers e.g. Subscription id, MSISDN, and AccountID fields. These are the selectable keys of your primary class i.e. may vary depending on your implementation.
- Click the Run button and start your diagnostic processes.