Rule Sets
A rule set is a set of rule statements that you define for one or more columns in a data set. When you build a rule specification, you configure one or more rule sets.
To configure a rule set, select the options on the rule set views. Connect the rule sets to define the data flow in the rule specification.
By default, a rule specification contains a primary rule set. You can configure a simple rule specification in the primary rule set. If you plan to add multiple rule statements, consider whether to add rule sets to the rule specification.
The following table describes the views that you can configure on a rule set:
View | Description |
---|
General | Use to enter a name for the rule set. Optionally, enter a description for the rule set. Note: Enter a name that summarizes the type of data operations that the rule statements perform in the rule set. If the rule set creates an input for another rule set, the rule specification uses the rule set name as the input name. |
Inputs | Use to define the inputs that you add to the rule statements in the rule set. |
Rule Logic | Use to define the rule statement logic. |
Test | Use to enter sample data and validate the rule set output. |
Consider the following guidelines when you configure rule sets:
- •A rule set can read one or more input values for each record in a data set. A rule set writes a single output for each record.
- •You can organize rule sets in a hierarchical manner in the workspace, so that one rule set reads the output from another rule set. Create a hierarchy of rule sets when a rule statement in one rule set is a dependent object of a rule statement in another rule set.
- •The rule specification applies input values to the rule statements in the order in which they appear in the rule set. A rule set writes the output from the first rule statement that returns a valid value for the input value. You must organize the rule statements in the rule set so that the rule statements do not conflict.
For example, a rule set might contain the following rules:
1 IF PASSENGER AGE < 18 THEN "JUNIOR FARE"
2 IF PASSENGER AGE >= 18 THEN "STANDARD FARE"
3 IF PASSENGER AGE > 65 THEN "SENIOR FARE"
In the example, the passenger age data cannot reach the third rule statement. The first and second rule statements cover all the data options before the data can reach the third rule statement.
Inputs in Rule Sets
Each rule set specifies one or more data inputs. You define the inputs on the Inputs view in the rule set. You add an input to each rule statement that you define in the rule set.
The data input represents a data column in a business data set. When a user opens a mapplet rule in the Developer tool, the user reviews the data inputs in the rule. The user connects the mapplet rule to the columns in the data set that the business rule applies to.
You specify the properties of the inputs in the rule set. The properties include the type of data that the column must contain and the maximum number of characters in each field in the column. For example, you can specify that an input reads data strings with a maximum length of 30 characters.
When you create a rule set below a rule set, the outputs from the lower rule set appear as inputs in the upper rule set.