Using a Business Rule Flow in a Job

Overview

The Business Rules transformation enables you use the business rule flow packages that are created in SAS® Business Rules Manager in the context of a SAS Data Integration Studio job. You can import business rule flows, specify flow versions, map source table columns to required input columns, and set business rule options.
The transformation enables you to map your source data and output data into and out of the rules package. Then, the SAS Data Integration Studio job applies the rules to your data as it is run. When a job that contains a rules package is run, statistics are collected about the following:
  • how many rules were triggered
  • the number of invalid and valid data record values
  • other details
You can use this information to further refine your data as it flows through your transformation logic.
You must satisfy the following prerequisites before you can use the Business Rules transformation in a SAS Data Integration Studio job:
  • One or more business rule flows must have been created in SAS® Business Rules Manager. The outputs created for one of these business rule flows determine the outputs for the Business Rule transformation that the flow is used in a job.
  • These flows must be available in the Folders tree in SAS Data Integration Studio. A typical path through the Folders tree is Foldersthen selectProductsthen selectSAS Business Rules Studiothen selectBusiness Rule Flows 1.

Problem

You want to use a business rule flow to structure the analysis of some of your data.

Solution

You can create a SAS Data Integration Studio job that contains the Business Rules transformation. Perform the following tasks:

Tasks

Verify Prerequisites

The SAS Business Rules Manager must be installed on the server where the job that contains the Business Rules transformation is executed. Verify that this prerequisite has been satisfied.

Create the Job

Perform the following steps to create a job that uses a business rule flow:
  1. Create an empty SAS Data Integration Studio job.
  2. Navigate to the SAS Business Rules Studio folder on the Folders tab, and open the folder that contains the business rule flow that you want to use.
  3. Select the business rule flow and drop it in the empty job on the Diagram tab in the Job Editor window. A Business Rules transformation populated with the selected business rule flow is displayed on the tab.
    Note: You can also drop a Business Rules transformation directly onto the Diagram tab. However, you must then open the Business Rule tab in the transformation and select the flow in the Business rule flow field.
  4. Locate the source table that contains the data that you want to process in the business rule flow. The source table for the sample job is named CARS.
  5. Drop the source table onto the Diagram tab and connect it to the Business Rules transformation.
  6. Right-click the Business Rules transformation and click Expand in the pop-up menu. This step expands the outputs so that you can easily review them.
    The following display shows the completed job flow:
    Business Rules Flow
    Business Rules Flow

Configure the Job

You need to ensure that the business rule flow was properly populated and mapped when you created the job.
First, you should check the Business Rule tab, as shown in the following display:
Business Rule Tab
Business Rule Tab
You can see that version 1.1 the DIStudioTest2 flow has been populated into the Business Rules transformation. If necessary, you can select a new business rule flow and version in the appropriate fields.
You should also review the Inputs and Outputs tab, as shown in the following display:
Inputs and Outputs Tab
Inputs and Outputs Tab
Make sure that the Inputs column in the source table is mapped to the corresponding term in the business rule flow input. You also should examine the business rule flow outputs at the bottom of the tab. If necessary, you can add tables and select additional columns.

Run the Job and Review the Results

Run the job and verify that the job completes without error. Then, open the output tables to verify that the expected data is populated.
Note: By default the Business Rules transformation will generate a rule fire action table. With large data volumes or frequent rule triggers, the rule fire action table can grow large enough to impact system performance. If that happens, you can turn off the generation of the rule fire action table. To do so, open the properties window for the Business Rule transformation. Then, click the Options tab and the Business Rule Flow Advanced Options section of the tab. Select No in the drop-down menu in the Generate rules fired table field.