Rule specification assets > Rule specification configuration in advanced mode > Rule logic configuration examples
  

Rule logic configuration examples

The elements that you include in your rule logic depend on the facts that you need to determine about the input data.
You might can write the rule logic to include the following elements:

Specifying a rule specification in an IF element

You can configure an IF element in your rule specification to read a rule specification that you identify:
    1Open a rule specification in advanced mode.
    2Verify that the rule specification contains the inputs and outputs that you require.
    3In the rule editor, type the IF element of the IF-THEN-ELSE statement.
    4Type the name of a rule specification that you want to add.
    The editor can suggest rule specification names from the set of assets in your organization folders or projects based on the text that you type.
    5Map each input in the current rule specification to an input in the rule specification that you select above. Append the input names from the rule specification that you selected as parameters to the rule specification name.
    Note: The data types of the inputs that you map must be compatible.
    6Enter an operator value. For example, enter the = value to verify whether the input value matches the value that you specify.
    7Enter the value to compare to the input value. For example, enter VALID.
    8Type the THEN element.
    9To specify the output, type the output name.
    10Enter an operator value. For example, enter the = value to write a value for the data that satisfies the rule logic.
    11Enter the value that the output returns. For example, enter Input not null.
    12Type the ENDIF element.
The following example shows rule logic that contains a rule specification:
IF rule:Auto_Project1.TC593_InnerRule_AdvancedRulespec(Input) = 'VALID'
THEN
Output = 'Input not null'
ENDIF
The italicized text represents the rule specification name.

Specifying a rule specification in a THEN element

You can configure a THEN element in your rule specification to read a rule specification that you identify:
    1Open a rule specification in advanced mode.
    2Verify that the rule specification contains the inputs and outputs that you require.
    3In the rule editor, type the IF element of the IF-THEN-ELSE statement.
    4To specify the input, type the input name.
    5Enter an operator value. For example, enter the != value to write a value for the data that does not satisfy the rule logic.
    6Specify a condition for the operator. For example, enter NULL.
    7Type the THEN element.
    8To specify the output, type the output name.
    9Enter an operator value. For example, enter the = value to write a value for the data that satisfies the rule logic.
    10Type the name of a rule specification that you want to add.
    The editor can suggest rule specification names from the set of assets in your organization folders or projects based on the text that you type.
    11Map each output in the current rule specification to an output in the rule specification that you select above. Append the output names from the rule specification that you selected as parameters to the rule specification name.
    Note: The data types of the outputs that you map must be compatible.
    12Type the ENDIF element.
The following example shows rule logic that contains a rule specification:
IF Input != NULL
THEN
Output = rule:Default.rule 1 for TC53(Input1)
ENDIF
The italicized text represents the rule specification name.

Specifying a mapplet in an IF element

You can configure an IF element in your rule specification to read a mapplet that you identify:
    1Open a rule specification in advanced mode.
    2Verify that the rule specification contains the inputs and outputs that you require.
    3In the rule editor, type the IF element of the IF-THEN-ELSE statement.
    4Type the name of a mapplet that you want to add.
    The editor can suggest rule specification names from the set of assets in your organization folders or projects based on the text that you type.
    5Map each input in the current rule specification to an input in the mapplet that you select above. Append the input names from the rule specification that you selected as parameters to the mapplet name.
    Note: The data types of the inputs that you map must be compatible.
    6Enter an operator value. For example, enter the = value to verify whether the input value matches the value that you specify.
    7Enter the value to compare to the input value. For example, enter DIGIT.
    8Type the THEN element.
    9To specify the output, type the output name.
    10Enter an operator value. For example, enter the = value to write a value to the data that satisfies the rule logic.
    11Enter the value that the output returns. For example, enter Input given is DIGIT.
    12Type the ENDIF element.
The following example shows rule logic that contains a mapplet:
IF mapplet:Validation_RuleSpec_1.Mapplet_RuleSpecVal(Input)='DIGIT'
THEN
Output= 'Input given is DIGIT'
ENDIF
The italicized text represents the mapplet that you use in the rule specification.

Specifying a mapplet in a THEN element

You can configure a THEN element in your rule specification to read a mapplet that you identify:
    1Open a rule specification in advanced mode.
    2Verify that the rule specification contains the inputs and outputs that you require.
    3In the rule editor, type the IF element of the IF-THEN-ELSE statement.
    4To specify the input, type the input name.
    5Enter an operator value. For example, enter the != value to write a value for the data that does not satisfy the rule logic.
    6Specify a condition for the operator. For example, enter NULL.
    7Type the THEN element.
    8To specify the output, type the output name.
    9Enter an operator value. For example, enter the = value to write a value to the data that satisfies the rule logic.
    10Type the name of a mapplet that you want to add.
    The editor can suggest rule specification names from the set of assets in your organization folders or projects based on the text that you type.
    11Map each output in the current rule specification to an output in the mapplet that you select above. Append the output names from the rule specification that you selected as parameters to the rule mapplet name.
    Note: The data types of the outputs that you map must be compatible.
    12Type the ENDIF element.
The following example shows rule logic that contains a mapplet:
IF Input != NULL
THEN
Output = mapplet:ER_11227.MappletRS(Input1)
ENDIF
The italicized text represents the mapplet that you use in the rule specification.

Specifying a dictionary in the expression logic

You can configure an IF or THEN element in your rule specification to read a dictionary that you identify.
The following task describes the steps to add a dictionary to an IF element.
    1Open a rule specification in advanced mode.
    2Verify that the rule specification contains the inputs and outputs that you require.
    3In the rule editor, type the IF element of the IF-THEN-ELSE statement. To specify the input, type the input name.
    4Enter an operator value. For example, enter the in value to identify input values that match the dictionary values.
    5 To apply a dictionary to the input data, type the name of the dictionary that you created.
    The editor can suggest dictionary names from the set of assets in your organization projects or folders based on the text that you type.
    6Type the THEN element.
    7To specify the output, type the output name.
    8Enter an operator value. For example, enter the = value to write a value for the data that satisfies the rule logic.
    9Enter the value that the output returns. For example, enter Input present.
    10Type the ELSE element.
    11To specify the output, type the output name.
    12Enter an operator value. For example, enter the = value to write a value for the data that does not satisfy the rule logic.
    13Enter the value that the output returns. For example, enter Input not present.
    14Type the ENDIF element.
The following example shows rule logic that contains a dictionary:
IF Input in dictionary:Validation_RuleSpec_1.Dictionary_RuleSpec
THEN
Output = 'Input present'
ELSE
Output = 'Input not present'
ENDIF
The italicized text represents the dictionary that you use in the rule specification.

Specifying exception data options in the expression logic

You can configure exception properties in the expression logic to identify exception records.
    1Open a rule specification in advanced mode.
    2Verify that the rule specification contains the inputs and outputs that you require.
    3Select the Add Exception Details option on the Outputs tab in the Input and Output Management dialog box.
    The option activates the exception priority, exception description, and status indicators that you will use in the rule logic.
    4In the rule editor, type the IF element of the IF-THEN-ELSE statement.
    5To specify the input, type the input name.
    6Enter the operator value.
    7Specify a condition for the operator.
    8Type the THEN element.
    9Define a status indicator:
    10Add the ExceptionPriority indicator.
    Enter the = operator value to write a priority value.
    11Enter the priority value for the data quality issue that defines the record as an exception.
    You can enter one of the following priority values: Minor, Major, Critical.
    12Add the ExceptionDescription indicator.
    Enter the = operator value to write a descriptive text.
    13Enter a description of the data quality issue that defines the record as an exception.
    14To identify records that contain another data quality issue, add an ELSEIF element. Write the element logic in the same manner as the IF-THEN sequence in the earlier steps.
    15Type the ENDIF element.
The following example shows exception rule logic that identifies individuals who may be old enough to obtain a driver's license:
IF Input < 17
THEN
Output = 'Child'
ELSEIF Input = 17
THEN
Output = 'Verify age'
ExceptionPriority = 'Major'
ExceptionDescription = 'Driver may qualify this year'
ELSEIF Input > 17
THEN
Output = 'Adult'
ELSE
Output = 'Not known'
ENDIF
The italicized text represents the exception data options.