Blog Viewer

Add a Variable to an Existing Decision Table and Test the Rule

  

Introduction

This process begins with an existing decision table with one in variable. The original decision table calculates a rate based only on the duration of the customer's account. This decision table calculates a rate based both on the duration of the account and the type of customer.

When you have completed the decision table, you should test it to ensure it behaves as you expect.

QUICK STEPS
1 In the Parameters panel, click the + icon to add a parameter
2 Enter the parameter details
3 Right-click the expression column header and click Add Condition in Left
4 Enter the new column header description and expression
5 Create a new row condition
6 Define the description and expression for each row condition
7 Define the description and expression for the other conditions and results
8 Save the rule
9 Build the rule
10 Navigate to the scenario
11 Enter scenario values
12 Run the test
13 View the diagram
14 Create more test steps
15 Run all steps and check results
16 Save the scenario


Detailed Steps

Step 1. In the Parameters panel, click the + icon to add a parameter.

Open the decision table you want to update. You’re going to edit it so it uses multiple in variables. This means you have to add another variable (or parameter).




    Step 2. Enter the parameter details.

    This variable is going to be called “CustomerType”. The Direction is In and the Data Type is string.




    Step 3. Right-click the expression column header and click Add Condition in Left.

    Currently, this rule only uses the number of months to determine the interest rate. This example adds another factor to affect the rate: whether the account holder is regular or premium.




    Step 4. Enter the new column header description and expression.

    This column will use the CustomerType variable.




    Step 5.
    Create a new row condition.

    There will be two types. You need a row for each one.





    Step 6. Define the description and expression for each row condition.

    For this rule, Regular accounts will have the interest rates already defined. 



      Step 7. Define the description and expression for the other conditions and results.

      For this rule, Premium accounts will have different rates.

      This rule uses the same number of conditions for each customer type, but you can also have fewer conditions: you only have to cover all possible durations, not have the same number of possible rates.




      Step 8. Save the rule.




        Step 9. Build the rule.





        Step 10. Navigate to the scenario.

        The scenario already exists because it was created in a previous activity.





        Step 11. Enter scenario values.

        You should now see two fields for Input Values. If necessary, refresh the scenario to display the CustomerType input.

        Enter the NoOfMonths and CustomerType values, plus the Expected Value given those two values.
















        Step 12. Run the test.  

        Click the Run Test icon to run the test step.




        Step 13. View the diagram.

        It displays the flow of execution from condition to action.



        Step 14. Create more test steps.

        Create multiple tests for both Regular and Premium customers.




        Step 15. Run all steps and check results.

        Click the Run All icon to run all the test steps together.





        Step 16. Save the scenario.

         

        This post is part of the Rules topic. Click here to open the Rules Overview.

        #Develop
        #Rules
        #Everyone
        #Text Help
        #Task Steps

        0 comments
        39 views

        Permalink