Table of Contents

Testing the Next-Best-Action strategy

Improve the accuracy of your Next-Best-Action strategy by testing the framework. By creating a data flow which retrieves customer data from your relational database, and then running the data flow, you can verify that the Next-Best-Action strategy framework gives correct results.

Creating a data flow

  1. Log in to App Studio as an operator with access to data flows.
    Only users with an access group that includes the user role CustomerDecisionHub:DataAdmin can access data flows.
  2. In the navigation panel of App Studio, click Data > Data Flows.
  3. On the Data Flows landing page, click Create.
  4. On the Create Data Flow page, enter the data flow description, for example, NBA strategy test.
  5. In the Apply to field, verify that the class to which this data flow applies is the primary customer class for your application.
    You can use the Context Dictionary to check the primary customer class for your application. For more information, see Context Dictionary.
  6. Click Create and open.
  7. On the data flow canvas, right-click the Source shape, and then select Properties.
  8. In the Import data from list, select Data set.
  9. In the Data set field, select Segment.
  10. Click Submit.
  11. Add a Convert shape to the data flow canvas, and then right-click the shape to edit its properties.
  12. In the Into page(s) of class field, enter Data-Decision-Request-Customer.
    This option converts the source data from your customer class into a page of the Data-Decision-Request-Customer class.
  13. Select the Auto-copy properties with identical names check box, as in the following example:
    Convert shape configuration
    "Convert shape configuration"
    Convert shape configuration
  14. Click Submit.
  15. Add a Compose shape to the canvas.
    The Compose shape pulls in all customer data, including associated data that you configured in the Context Dictionary.
  16. Configure the Compose shape.
    1. Right-click the Source shape for the Compose shape, and then click Properties.
      Source properties for the Compose shape
      "Source properties for the Compose shape"
      Source properties for the Compose shape
    2. In the Import data from list, select Data flow.
    3. In the Input class field, select the primary customer class for your application.
      Use the Context Dictionary to check the primary customer class for your application. For more information, see Context Dictionary.
    4. In the Data flow field, select the CustomerData data flow for your primary customer class.
      The name of the data flow depends on the name of the primary customer context in your application. For example, if your primary customer context is Subscriber, the name for the CustomerData flow is SubscriberData. For more information, see Context Dictionary.
    5. Click Submit.
    6. Right-click the Compose shape, and then click Properties.
    7. In the Compose Data_Decision_Request_Customer with data from field, select the property that corresponds to your primary customer context.
      For example, if your primary customer context is Subscriber, select the .Subscriber property.
    8. In the Compose when conditions below are met section, enter the following Join condition: When <your customer class key> is equal to .pySubjectID as in the following example:
      Sample Join condition
      "Sample Join condition"
      Sample Join condition
    9. Click Submit.
  17. Verify that the final shape in the data flow is an Abstract shape which outputs the results, as in the following example:
    Data flow for testing the Next-Best-Action strategy framework
    "Data flow for testing the Next-Best-Action strategy framework"
    Data flow for testing the Next-Best-Action strategy framework
  18. Click Save.

Testing Next-Best-Action strategies with data flows

After you create a data flow, start a test run panel of your Next-Best-Action strategy. You can test the full strategy framework by running the test at the top level of the Next-Best-Action hierarchy, or test the configuration of a specific business group by running the test only for that group.

  1. In the navigation panel of Dev Studio, click Records > Decision > Strategy.
  2. Open the Next-Best-Action strategy that you want to test.
    For example, to test the full Next-Best-Action strategy framework, open the NBA_TopLevel strategy.
  3. Open the Test run panel by clicking the Toggle side panel icon on the right side of the strategy canvas.
  4. In the Single case tab of the Test run panel, select Run this strategy on a data flow.
  5. In the Data flow field, select your new data flow.
  6. In the Customer ID list, select the ID of a customer.
    Sample test data flow run for a customer
    "Sample test data flow run for a customer"
    Sample test data flow run for a customer
  7. Click Run.

The test data flow retrieves the customer data from the database. The Next-Best-Action strategy then uses the data to decide on the Next-Best-Action for the customer based on the customer's eligibilities, Interaction History, and other factors. You can see the decision results directly on the strategy canvas.

Suggest Edit

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.