Managing Rules for a Record
You can specify recognition rules and/or validation rules for a record based on the specified connector.
Note: Validation rules are applicable only for XML-based schema files.
Recognition rules are a set of conditions that specify which layout to use with each input line of the source file. It is necessary to define recognition rules only when you want to use the browser to view target data with multiple record types or you are dealing with source data without a schema. Defining recognition rules is not necessary to run transformation output to a multiple record type target.
For multiple record type files, it is necessary to indicate a set of conditions that specify which layout is to be used with each input line of the source file. These conditions are the recognition rules. The rules are always related to the data found in the discriminator field.
If your source file has only one record type, it is not necessary to define a discriminator field or recognition rules.
The discriminator field is the section of the file that contains data that indicates record type. This field only needs to be set once for the entire file in a multiple record type file. You do not have to define a discriminator field for each record type. The discriminator field is used to distinguish between one record type and the next through the recognition rules.
You can have only one discriminator field for all the recognition rules.
Adding Recognition Rule in JSON Schema
To add a recognition rule and specify the discriminator field
1. In the left tree view, expand All Record Types.
2. Expand the record node for which you want to add a discriminator and recognition rule.
3. Click Recognition Rules node.
4. In the right-pane, click
to add a recognition rule.
Note: You can specify only one discriminator for all the recognition rules.
5. From the Record Discriminator drop-down menu, select the discriminator.
6. Specify the following information for the recognition rule.
7. Save the changes.
Note: If two or more recognition rules are defined for the same schema, that layout is applied when either of the rule conditions is true. This implies OR logic. The current release does not support AND logic in recognition rules.
Deleting Recognition Rule in JSON Schema
To delete a recognition rule:
1. In the left tree view, expand All Record Types.
2. Expand the record for which you want to delete a recognition rule.
3. Click Recognition Rules node.
4. In the right-pane, select the rule that you want to delete and click
to delete a recognition rule.
To delete multiple rules, press the
Ctrl key and select the required rules or press the
Shift key and select a range of rules, and then click
.
A message asking for confirmation is displayed.
5. Click Yes.
The recognition rule is deleted.
Reordering Recognition Rule in JSON Schema
To reorder the recognition rules:
1. In the left tree view, expand All Record Rules and click Recognition Rules.
2. In the right-pane, select the rule that you want to move and click
to move the rule up or click
to move the rule down.
To move multiple rule, press the
Ctrl key and select the required rule or press the
Shift key and select a range of rule, and then click
or
.
3. Save the changes.
Adding Recognition Rule in XML Schema
To add a recognition rule and specify the discriminator field
1. In the left tree view, expand All Records.
2. Expand the record node for which you want to add a discriminator and recognition rule.
3. Click Recognition Rules node.
4. In the right-pane, click
to add a recognition rule.
Note: You can specify only one discriminator for all the recognition rules.
5. From the Record Discriminator drop-down menu, select the discriminator.
6. Specify the following information for the recognition rule.
7. Save the changes.
Note: If two or more recognition rules are defined for the same schema, that layout is applied when either of the rule conditions is true. This implies OR logic. The current release does not support AND logic in recognition rules.
Deleting Recognition Rule in XML Schema
To delete a recognition rule:
1. In the left tree view, expand All Records.
2. Expand the record node for which you want to delete a recognition rule.
3. Click Recognition Rules node.
4. In the right-pane, select the rule that you want to delete and click
to delete a recognition rule.
To delete multiple rules, press the
Ctrl key and select the required rules or press the
Shift key and select a range of rules, and then click
.
A message asking for confirmation is displayed.
5. Click Yes.
The recognition rule is deleted.
Reordering Recognition Rule in XML Schema
To reorder the recognition rules:
1. In the left tree view, expand All Records and click Recognition Rules.
2. In the right-pane, select the rule that you want to move and click
to move the rule up or click
to move the rule down.
To move multiple rule, press the
Ctrl key and select the required rule or press the
Shift key and select a range of rule, and then click
or
.
3. Save the changes.
Adding Validation Rule in XML Schema
You can add only one validation rule per record.
To add validation rule:
1. In the left tree view, expand All Records and then expand the record for which you want to add a validation rule.
2. Click the Validation Rules node.
3. In the right-pane, click
Build Expression for the record type for which you want to add a validation rule and then click
.
The EZscript Expressions Editor is displayed.
4. Add an expression and close the EZscript Expressions Editor.
The specified expression is displayed in the Validation Expression column for a record type.
5. Save the changes.