Blog Viewer

Execute an Entity Based Scenario

  

Introduction

The flexibility inherent in S3 rules features and functionality allows you to create logic independent of data. This means there has to be a way to test logic independent of data. The entity based scenario, or XML scenario, is that way. 

QUICK STEPS
1 Open the rule
2 Click the Scenarios icon and select Add Scenario
3 Enter the scenario values
4 Run the test
5 Compare the Expected Value to the Actual Value
6 View the diagram
7 Add test steps and repeat steps 3-6 to test other desired values
8 Save the scenario


Detailed Steps


Step 1. Open the rule. 

Navigate to the rule you want to test.




Step 2. Click the Scenarios icon and select Add Scenario.

Once a scenario exists, this icon changes to Navigate to Scenario.




Step 3. Enter the scenario values. 

There are two kinds of values: Input Value(s) and Expected Value(s). For the Input Value, enter a value for the defined parameter. In this example, the input is the NoOfMonths variable.

For the Expected Value, enter the value you expect when the rule executes with the value you gave as input. In this example, the input is 52. Based on the decision table, the Expected Value is 1.25. In a production scenario, you’d enter the value you know is correct from an independent source. 




Step 4. Run the test.

Click the Run Test icon to execute the rule with the input value you entered.



Step 5. Compare the Expected Value to the Actual Value. 

    If your logic is correct, these two values should match.




    Step 6. View the diagram. 

    Click the View Diagram icon to see the path S3 followed to produce the Actual Result. If your logic is correct, you should see it select the condition that matches the Input Value you entered and pair it with the result that matches the Expected Value you entered.


    Step 7. Add test steps and repeat steps 3-6 to test other desired values. 

    In the left Tests panel, click the plus icon to add more steps. Enter Input Value and Expected Value for each desired step, then click the Run Test icon to run them individually. You can also use the Run All icon to run all the steps.



    Step 8. Save the Scenario

    When you are finished testing steps, save the scenario.


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

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

    0 comments
    44 views

    Permalink