Testing a Rule Flow

You can test a rule flow before you publish it. If necessary, you can specify initialization or setup code that you want to run before the rule flow is run. SAS Business Rules Manager reports rule flow results and test data such as rule-fired data. SAS Business Rules Manager saves the test results from the last time a test was run.

Input Data for Rule Flow Tests

SAS Business Rules Manager expects the input data for the rule flow test to already exist and to be defined as a data table. See Managing Data Tables for information about defining data tables. Your user ID must have permission to access the data.

Create and Run a New Rule Flow Test

To test a rule flow:
  1. Open the rule flow that you want to test.
  2. Select the Tests page.
  3. Click Add to add a new test. The Add a New Test window appears.
  4. Enter a name for the new test. Test names are limited to 30 characters.
  5. (Optional) Enter a description for the test.
  6. Select the data source that contains the input data for the test, and click Next.
  7. Map the terms in the rule flow to columns in the input data set. If you click Map terms, the application automatically maps as many terms as possible. You can also map terms by manually selecting an input column for each rule flow input term.
  8. Click Next.
  9. (Optional) Enter any SAS code, such as initialization code or setup code, that you want to run before the rule flow is run. See Specify Preprocessing Code for more information.
  10. Click Run to run the test, or click Save to save it without running it.
If the test completes successfully, the status on the Tests tab changes to Completely Successfully. SAS Business Rules Manager displays the Results tab on which you can view the output of the rule flow, analyze the rule-fired data, and view the SAS code that was generated and run by SAS Business Rules Manager. See View Rule Flow Test Results for more information.
Rule flow tests are associated with the rule flow version. After a test completes, the test version is displayed on the Tests page.

Run a Rule Flow Test

To run a rule flow test:
  1. Open the rule flow that you want to test.
  2. Select the Tests page.
  3. Select the test that you want to run and click submit.

Copy a Rule Flow Test

To copy a test:
  1. Open the rule flow.
  2. Select the Tests page.
  3. Select the test that you want to copy and click submit.

Edit a Rule Flow Test

To edit a rule flow test:
  1. Open the rule flow.
  2. Select the Tests page.
  3. Select the test that you want to edit and click Edit test.

Delete a Rule Flow Test

To delete a rule flow test:
  1. Open the rule flow.
  2. Select the Tests page.
  3. Select the test that you want to delete and click Delete.

Specify Preprocessing Code

To specify code that you want to run before the rule flow is executed, enter the code on the Preprocessing step in the Add a New Test window.
You can also use the &DCM_USE_LATEST_VERSION macro variable to ensure that when a rule flow is run, the latest compatible version of a rule flow is always used. See Dynamically Choose the Latest Rule Flow Version for more information.

View Rule Flow Test Results

When you test a rule flow, SAS Business Rules Manager displays the output of the rule flow together with other information on the Results tab. You can filter the rows that are displayed on the Output Table tab by clicking filter above the output table. On the Rules Fired Analysis tab, if you select a record in the Output Records table, SAS Business Rules Manager displays the rules that fired for that record in the table at the bottom of the page. See also When Are Output Records Generated?.
Note: The _recordCorrelationKey column in the output table is a unique key that is added to each output record. This key enables the output records to be correlated with the records in the rule-fired details table. See Columns in the Rule-Fired Details Table.
Last updated: February 22, 2017