Create and Manage Expression Rules

When you have created an allocation rule set, you can create and configure the expression rule and test the new or changed expression rule to ensure the expected results are returned. You can create and configure one or more expression rules to more accurately control how sites are ranked or excluded.

Note: Before creating allocation rule sets, you can do the following:
  • Create a fulfillment site attribute, associate that attribute to the Fulfillment Site object type, and then associate the choice value you want to set for the fulfillment site attributes, such as string, number, choice value.
  • Enter the specific values that you want to set for the fulfillment site attribute in Administration: Settings > Fulfillment Sites > Extended Attributes section. For example, if you selected a drop-down list as the choice value, then the attributes values could be 1, 10, 100, 1000.

To create an expression rule in a rule set:

  1. From Order Management Administration, select Settings > Allocations.
    The Order Allocation Preferences page opens by default with the allocation rules in the Active rule set.
  2. To add an expression rule to the rule set list, click the new rule set, select Expression Rule from the drop-down list, and then click Add.
    The allocation rules appear in the Order Allocation Site Ranking Rules list. Repeat for each allocation rule, as needed.
  3. To configure (or modify) an expression rule, click the edit icon.
    The Custom Allocation Rule window opens.
  4. Type the name for the expression rule.
  5. Type a description of the expression rule.
  6. Enter the custom expression code to create the rule.
    For field examples and sample rules, see Expression Rule Examples.
  7. To validate that the expression rule is returning the desired rank or exclusion:
    1. Select the fulfillment site from the Fulfillment Site list.
    2. Enter a sales order number (optional) in the Order field.
    3. Click Test Expression to validate the custom expression.
      The expression results appear in a green-colored Evaluated Expression box if the expected results were returned. The box is colored red and an Expression Rule warning appears if the expected results were not returned.
  8. Click Save in the Custom Allocation Rule window to retain the new rule;click Cancel to discard the changes.
  9. Click Save below the list selection box in the left panel to save your changes.