Mapping Specification Rules
Create a rule that defines the business logic for target columns in a mapping specification. When you create a rule, you can add expression functions to the rule. Apply a rule to a mapping specification to add existing rule logic to target columns.
You can create a rule for a mapping specification or apply a rule to a mapping specification. After you create a rule for a mapping specification, you can make it reusable. You can preview the results of the rule.
You can apply a rule specification as a reusable rule in a mapping specification. A rule specification is the logic that you define to generate a rule. When you compile the rule specification, the Analyst tool converts it to a reusable rule. You can apply this reusable rule to the mapping specification.
When you apply a rule to a mapping specification, the Analyst tool maps a relationship between the columns in the rule to the columns in the target. You can remove the relationship from the rule columns to the target columns. However, the rule columns remain in the mapping specification. You can delete a rule from the mapping specification. The Analyst tool removes the relationship from the rule columns to the target columns and deletes the rule column from the mapping specification.
Applying a Rule
Apply a reusable rule to a target column in the mapping specification to apply the rule logic to the column. The rule must exist in the Model repository.
1. From the Actions menu, click Edit > Rules.
The Edit Mapping Specification wizard appears.
2. Select the New icon.
The New Rule wizard appears.
3. Select Apply a Rule.
4. Click Next.
5. In the Rules panel, select a reusable rule from a project or folder.
The Inputs and Outputs panels display the properties for the input and output columns for the rule.
6. Click Next.
7. Enter a rule column name.
8. Optionally, enter a description.
9. On the Inputs panel, select the input column for the rule.
10. On the Outputs panel, select a target column in the mapping specification.
11. Click Finish.
12. Click Yes in the message that appears to replace transformation objects and then click Save.
Creating a Mapping Specification Rule
Create a rule for a target column in a mapping specification to develop business logic for the column. When you create a rule, you configure the edit options for the rule. You can also choose to make the rule reusable.
1. From the Actions menu, click Edit > Rules.
The Edit Mapping Specification wizard appears.
2. Select the New icon.
The New Rule wizard appears.
3. Select Create a Rule.
4. Click Next.
5. Enter a name and an optional description.
6. Select a target column name to apply the rule to.
7. To make the rule reusable, select Save the rule and select a project to save the rule.
8. On the Functions tab, select a function, click the arrow icon, and select a column to add the function to the Expression editor.
9. Optionally, on the Columns tab. select a target column and click the arrow icon to add it to the Expression editor.
10. Optionally, on the Rules tab, select a column and datatype and click the arrow icon to add the rule column to the Expression editor.
11. Optionally, on the Lookup tab, select a column and datatype and click the arrow icon to add the Lookup column to the Expression editor.
12. Click Finish.
13. Click Yes to replace the transformation object and click Save.
Rule Properties
Open a reusable rule from the Library workspace and view properties for a reusable rule in the Design workspace. You can edit the properties in each panel for a reusable rule.
The following reusable rule properties appear on the Properties panel:
- Name
- Name of the rule.
- Type
- Type of asset.
- Description
- Description of the rule.
- Location
- Location of the rule in the project or folder.
The following reusable rule properties appear on the Input panel and Output panel:
- Name
- Input or output column name.
- Datatype
- Input or output column datatype.
- Description
- Input or output column description.
- Precision
- Input or output column precision.
- Scale
- Input of output column scale.
The following reusable rule property appears on the Expression panel:
- Syntax
- Expression syntax of the rule.
Editing a Reusable Rule
Edit a reusable rule to change the rule properties, input column, output column, or rule expression.
1. From the Library workspace, open a reusable rule.
The reusable rule opens in the Design workspace.
2. Click Edit from the Properties, Inputs, Outputs, and Expression panels.
The Edit Rule wizard appears.
3. Optionally, click the General tab, to modify the general properties for the rule.
4. Optionally, click the Ports tab to modify the input and output column properties.
5. Optionally, click the Expression tab to modify the rule expression.
6. Click Save.