Editing or creating a rule

Using the Rules console, you can edit an existing rule or create a new rule.

Tasks

You can perform following tasks in the Rules details page.
Go to data sanity dashboard Click to directly access the Data sanity dashboard.
New Click New to create a new rule in the Rules details page.
Save Click Save to save the rule.
Refresh Click Refresh to refresh the Rules details page.
Clone Select a rule, and click Clone to clone a rule.
Delete Select a rule, and click Delete. The Delete confirmation pop-up window opens. To delete the rule, click Yes.
Append to rule Click to open the Create composite rule pop-up window. Select New to specify a new composite rule or Existing to append an existing composite rule.

About this task

To edit an existing rule or create a new rule, proceed as follows.
  • To edit an existing rule, click <rule name> link.
  • To create a new rule, click Create rule.
The Rules details page opens.

Procedure

  1. In the Rule name field, type the name of the rule.
  2. In the Rule properties section, select an appropriate value from the Apply rule to list. Depending upon your selection, the fields of the Rule properties section further populate.
    Catalog
    1. Select the catalog that you want to apply the rule to from the Catalog list.
    2. Select the extension that you want to apply the rule to from the Extension point list. The available option is Entry build, Preprocessing, or Post processing.
    Spec
    1. Select the spec that you want to apply the rule to from the Spec list.
    2. Select and specify the attribute for the selected spec. To distinguish the attributes in a localized spec, you can set the value of the property attributeDisplayFormat=path in the config.json file.
    3. Select the rule type from the Rule type list. The available option is Value rule, Validation rule, or Default value rule. If the attribute type is string enumeration, the Rule type list also displays an option of String enumeration rule.
    Workflow
    1. Select the workflow that you want to apply the rule to from the Workflow list.
    2. Select and specify the workflow step to which you want to apply the rule to from the Step list.
    3. Select the catalog that you want to apply the rule to from the Catalog list. If the workflow is a hierarchy, the Rule type list also displays an option of Hierarchy.
    Note: If you specify nested workflow as the workflow you want to create rule in, and the step as child workflow, you can specify Item mapping only.
  3. In the Rule structure section, you can create and configure the rule structure. The Rule structure section displays the Design view and Code view tabs. You define a rule in the Design view tab. The section, displays the operators depending on your selections in the Rule properties section.
    Note: The Rule structure of a basic rule is a read-only mode only until the rule is associated with a composite rule. To edit the rule, remove the basic rule from the composite rule.

     Basic rule 

    Design view tab

    You define a rule in the Design view tab. The Design view tab has following available building blocks for a rule.

    If statement operator
    • And logical operator
    • Or logical operator
    Then conditional operator

    Design view tab: "If" statement operator
    Logical operator
    And/Or
    List of attributes
    Select an appropriate attribute.
    Option
    Any/Or
    Operator
    You can choose from various operator types. For more information, see Supported operators and rules.
    Predicate
    Available option is Value, Attribute, or Function. Depending upon your specifications the next field can be an integer, or text.
    Relationship and Linked editors
    Click icon to open Relationship pop-up window. You can use the editor to search entries based on any attribute of the selected catalog. For more information, see Relationship editor.
    Click icon to open Linked pop-up window. You can use the editor to search entries based on any attribute of the selected catalog. For more information, see Linked editor.

    Design view tab: "Then" statement operator
    List of attributes
    Select an appropriate attribute.
    Operator
    Relational operator
    Predicate
    Available option is Value, Attribute, or Function. Depending upon your specifications the next field can be an integer, or text.

    Design view tab: "If" statement operator for an "Item" attribute
    Logical operator
    And/Or
    List of attributes
    Item
    Operator
    You can choose from following Category operator types:
    • Is mapped to category
    • Is not mapped to category
    Edit category mapping
    Click Edit category mapping to open Select category pop-up window. Select category and , and OK.

    Design view tab: "Then" statement operator for an "Item" attribute
    Operator
    Map to category

    If you are creating a rule for Workflow, use the Design view tab to define statement and logical operators for each of the In, Out, and Timeout tabs.
    Click Add criterion to specify the rule parameters. If required, to specify additional nested rule parameter and logical operator, click Add set of criteria. To remove a rule, click Remove criterion.
    Associations tab
    This tab provides list of all the composite rules with which the basic rule is associated. Click a composite rule link to navigate to the rule. A basic rule becomes view-only when associated with any composite rule. You can clone basic rule, append the rule to more composite rules, and add any new rule. You cannot though delete this basic rule.

     Composite rule 

    Applicable rules section - Displays a list of all Basic rules with matching rule properties. Select a rule and click Add. You can select multiple rules.

    Selected rules section - Displays list of your selected Basic rules. You can reorder the rules by using the Move up or Move down icons. Click beside a basic rule to navigate to the rule.

  4. Click Save.

What to do next

After you have configured rule, click Code view tab to check the JSON output for the rule structure, and click Save. If you want, you can click Copy to copy the JSON file. For more information on the syntax and semantics of expressions used in the JSON file, see Rules expressions.