User Guide : Managing Schemas : Exploring Schema Editor : Managing Rules for a Record
 
Share this page                  
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 /download/attachments/25954037/Map_Source_Add_Icon.png?version=1&modificationDate=1493578526312&api=v2 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.
Column Name
Description
Rule Name
Unique name for the recognition rule. This name appears in the tree view in the left pane when the rule is completed.
Operator
Select the required operator. This is an operator for an implied expression that begins with the discriminator field.
Value
Type the value that must be compared to the discriminator field. If the value is a range, then enter the lowest value in the range in this cell.
High Value
Type the highest value in the range in this cell if the value to be compared to the discriminator field is a range. If it is a simple value, not a range, then leave this cell blank.
Case
If set to true, the value or range of values is case sensitive.
Description
Type a description for this 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 /download/attachments/25954037/Map_Mapping_DeleteField_Icon.png?version=1&modificationDate=1493578526202&api=v2 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 /download/attachments/25954037/Map_Mapping_DeleteField_Icon.png?version=1&modificationDate=1493578526202&api=v2.
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 /download/attachments/25954037/Map_Source_UpArrow_Icon.png?version=1&modificationDate=1493578526343&api=v2 to move the rule up or click /download/attachments/25954037/Map_Source_DownArrow_Icon.png?version=1&modificationDate=1493578526327&api=v2 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 /download/attachments/25954037/Map_Source_UpArrow_Icon.png?version=1&modificationDate=1493578526343&api=v2 or /download/attachments/25954037/Map_Source_DownArrow_Icon.png?version=1&modificationDate=1493578526327&api=v2.
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 /download/attachments/25954037/Map_Source_Add_Icon.png?version=1&modificationDate=1493578526312&api=v2 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.
Column Name
Description
Rule Name
Unique name for the recognition rule. This name appears in the tree view in the left pane when the rule is completed.
Record Type
Indicates the type of record.
Operator
Select the required operator. This is an operator for an implied expression that begins with the discriminator field.
Value
Type the value that must be compared to the discriminator field. If the value is a range, then enter the lowest value in the range in this cell.
High Value
Type the highest value in the range in this cell if the value to be compared to the discriminator field is a range. If it is a simple value, not a range, then leave this cell blank.
Case
If set to true, the value or range of values is case sensitive.
Description
Type a description for this 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 /download/attachments/25954037/Map_Mapping_DeleteField_Icon.png?version=1&modificationDate=1493578526202&api=v2 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 /download/attachments/25954037/Map_Mapping_DeleteField_Icon.png?version=1&modificationDate=1493578526202&api=v2.
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 /download/attachments/25954037/Map_Source_UpArrow_Icon.png?version=1&modificationDate=1493578526343&api=v2 to move the rule up or click /download/attachments/25954037/Map_Source_DownArrow_Icon.png?version=1&modificationDate=1493578526327&api=v2 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 /download/attachments/25954037/Map_Source_UpArrow_Icon.png?version=1&modificationDate=1493578526343&api=v2 or /download/attachments/25954037/Map_Source_DownArrow_Icon.png?version=1&modificationDate=1493578526327&api=v2.
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 /download/attachments/25954037/SelectIcon_WithinField.png?version=1&modificationDate=1493578526343&api=v2.
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.