Create a Rule Set for an Item Class Attribute

In this example, you're an administrator creating validation rules that can be triggered when creating an item.

Prerequisites:

  • Create an attribute group named Region.

  • Add an attribute named Country. In the list of countries add Germany, USA, and India.

  1. In the Setup and Maintenance work area, select the following:

    Offering: Product Management

    Functional Area: Product Rules

    Task: Manage Item Rule Sets

  2. Here's how you create a rule set named Assign ITU Region to assign values based on an attribute:

    1. On the Manage Rule Sets page, click Create.

    2. In the Create Rule Set dialog box, enter the following:

      Display Name: Assign ITU Region.

      Type: Assignments.

      Association Type: Attribute Group.

      Association Name: Search for and select an attribute group named Region.

    3. Click Save and Continue.

  3. In the Edit Ruleset page, click Create to create a rule based on a validation criteria.

  4. In the Create Rule dialog box, enter the details of the rule. Here we create a rule so that the value is assigned to an existing attribute.

    1. Name: Assign ITU Region.

      Return Type: Select Generic. This is required to select an attribute group you created in a previous step.

      Target Attribute Group: Select Region. This is the attribute group you created in a previous step.

      Target Business Entity: Item.

      Target Attribute: Select ITU Region. This is the attribute group you created in a previous step.

      Results of this rule will be entered into this attribute.

      Click OK.

    2. Assign ITU Region: Details

      • Primary IF Expression: Enter true, so that the secondary if expression is validated.

      • IF Expression: Right-click and select Insert Attribute. In the Insert Attribute dialog box, select the following to create an expression based on Region and Country.

        Business Entity: Item.

        Attribute Group: Select the group named Region.

        Attribute: Select an attribute named Country.

      • Click Insert. The following expression is inserted:

        [Item].[Region].[Country]

      • Here's how you create a rule based on Country equals Germany. Modify the expression to form the following:

        [Item].[Region].[Country]==Germany

      • Return Value: Enter 1. If the user selects Germany, then the application automatically enters the value 1 in the ITU Region field.

      • Create two other expressions. Copy the expression you created and click Add Rule.

      • Modify the expression to form the following:

        [Item].[Region].[Country]==USA

        [Item].[Region].[Country]==India

      • For country = USA, enter Return Value as 2.

      • For country = India, enter Return Value as 3.

      • Click Hide User Message because a user message isn't required in this scenario.

      • Click Save.

      • To validate the expression you created, click Validate..

      • Resolve any validation errors. Click Save and Close.

  5. Here's how you create a validation rule so that users enter a band range for a radio that they're developing after they select a country:

    1. In the Edit Ruleset page, click Create to create a rule based on a validation criteria. In the Create Rule dialog box, enter the details of the rule.

      Name: Band Range

      Sequence: 10

      Severity: Reject.

      Select Stop further processing when rejected.

      Click OK.

    2. Band Range: Details

      • IF Expression: Right-click and select Insert Attribute. In the Insert Attribute dialog box, select the following to create an expression based on Region and Country.

        Business Entity: Item.

        Attribute Group: Select the group named Region.

        Attribute: Select ITU Region.

      • Click Insert. The following expression is inserted:

        [Item].[Region].[ITU Region]

      • Modify the expression as:

        !isNull[Item].[Region].[ITU Region]

        The application checks for the opposite of isNull.

      • Validation Condition: Right-click and select Insert Attribute. In the Insert Attribute dialog box, select the following:

        Business Entity: Item.

        Attribute Group: Select the group named Region.

        Attribute: Band Range.

      • Click Insert. The following expression is inserted:

        [Item].[Region].[Band Range]

      • Modify the expression as:

        !isNull [Item].[Region].[Band Range]

      • User Message: For example, Enter a band range.

      • To validate the expression you created, click Validate.

      • Resolve any validation errors. Click Save and Close.

  6. To enable the new rule sets, you must add new rule sets to the master rule set. Here's how:

    1. In the Manage Item Rule sets page, search for and open the master rule set.

    2. In the Master rule set page, click Select and Add.

    3. Search for the rule sets you recently created and add them.

    4. Click Save and Close.