---
schema_version: "1"
id: e63445ccfa1c0807121d82859657f893b4bde057067f9a3ebb4c5f9730bb8a7c
title: Create a Penalty Rule
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_create_a_penalty_rule.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_create_a_penalty_rule.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7229c7c43848e9637dd1a0ab55576e0112ee3ac7d74241aaabdc2a1e39476892
description: Create penalty rule sets in Vlocity Product Console using reusable context rule components.
products:
  - Communications
  - Media
  - Energy and Utilities
release: "264"
---
# Create a Penalty Rule

Create penalty rule sets in Vlocity Product Console using reusable context rule components.

For more information on context rule sets, see [Creating Rule Sets](https://help.salesforce.com/s/articleView?id=ind.comms_create_rule_sets.htm&release=264.0.0&type=5 "A rule set is a logical grouping of one or more context rules. A rule set enables you to designate how the grouped context rules are expressed in a logical expression and how they are used in Industries Cart. To create a rule set, you define general properties and then specify one or more context rules as child rules.").

To create new penalty context rule sets, perform the following steps:

1. Choose a context scope to use for your rule. If the context scope does not exist, create it. For more information on creating context scopes, see [Create Context Scopes.](https://help.salesforce.com/s/articleView?id=ind.comms_creating_context_scopes.htm&release=264.0.0&type=5 "If context scopes have not been created in your environment, you must create them before defining context rules. This process is performed once as part of the initial context rule setup.")
2. Choose a context dimension to use for your rule. If the context dimension does not exist, create it. For more information on creating context dimensions, see [Create Context Dimensions](https://help.salesforce.com/s/articleView?id=ind.comms_create_context_dimensions.htm&release=264.0.0&type=5 "Context dimensions are variables that describe the values that can be used in a context rule condition.").
3. Choose a context rule to use in your rule set. If the context rule does not exist, create it. For more information on creating context rules, see [Context Rules](https://help.salesforce.com/s/articleView?id=ind.comms_context_rules.htm&release=264.0.0&type=5 "Context rules determine when a rule set applies in Industries Cart. Context rules are analogous to entity filters in the advanced rules framework.").
4. Create a penalty rule set.
    1. In Vlocity Product Console under **Rules**, click the create icon next to Rule Set.
    2. In the **New Rule Set** dialog, enter the following information.
        
        <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
                  <colgroup>
                    <col>
                    <col>
                    <col>
                  </colgroup>
                  <thead class="slds-text-title_caps ">
                    <tr class="">
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d256696e120">
                        <p style="margin-bottom:0;">Property</p>
                      </th>
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d256696e126">
                        <p style="margin-bottom:0;">Value</p>
                      </th>
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d256696e132">
                        <p style="margin-bottom:0;">Description</p>
                      </th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e120 ">
                        <p style="margin-bottom:0;">Name</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e126 ">
                        <p style="margin-bottom:0;">String value</p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e132 ">
                        <p style="margin-bottom:0;">The name of the rule set. This name is displayed in rule selection dialogs and in related lists when assigned to promotions.</p>
                      </td>

                    </tr>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e120 ">
                        <p style="margin-bottom:0;">Rule Type</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e126 ">
                        <p style="margin-bottom:0;">
                          <kbd>Penalty</kbd>
                        </p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e132 ">
                        <p style="margin-bottom:0;">The rule type property controls how the rules are used in Industries Cart.</p>
                      </td>

                    </tr>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e120 ">
                        <p style="margin-bottom:0;">Rule Purpose</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e126 ">
                        <p style="margin-bottom:0;">n/a</p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e132 ">
                        <p style="margin-bottom:0;">This field is not currently used by the rules engine.</p>
                      </td>

                    </tr>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e120 ">
                        <p style="margin-bottom:0;">Expression Mode</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e126 ">
                        <p style="margin-bottom:0;">If Else If | If</p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e132 ">
                        <p style="margin-bottom:0;">Expression Mode is used when there are multiple context rules contained in the rule set. It describes how the rules engine compiles the child context rules into a logical expression. For more information, see <a href="https://help.salesforce.com/s/articleView?id=ind.comms_expression_modes_and_custom_expressions.htm&amp;release=264.0.0&amp;type=5" title="When a rule set contains more than one child context rule, you must use the expression mode to specify how the rules engine combines the child rules into a logical expression.">Child Rules and Expression Modes</a>. The <code>AND</code>, <code>OR</code>, and <code>Custom</code> Expression Modes are not used with penalty rule sets.</p>
                      </td>

                    </tr>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e120 ">
                        <p style="margin-bottom:0;">Expression</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e126 ">
                        <ul>
                          <li>
                            <p>Use AND and OR operators to create custom expression</p>
                          </li>

                          <li>
                            <p>Refer to child context rules using rule codes</p>
                          </li>

                          <li>
                            <p>Use spaces to delimit each rule code</p>
                          </li>

                          <li>
                            <p>Use parentheses to sequence order of operations for the expression</p>
                          </li>

                          <li>
                            <p>Expressions are case-sensitive</p>
                          </li>

                        </ul>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e132 ">
                        <p>Expression is not used with penalty rule sets.</p>
                        <p style="margin-bottom:0;">Expression is used when Expression Mode is <code>Custom</code>, to enable you to specify a custom logical expression. For more information, see <a href="https://help.salesforce.com/s/articleView?id=ind.comms_expression_modes_and_custom_expressions.htm&amp;release=264.0.0&amp;type=5" title="When a rule set contains more than one child context rule, you must use the expression mode to specify how the rules engine combines the child rules into a logical expression.">Child Rules and Expression Modes</a>.</p>
                      </td>

                    </tr>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e120 ">
                        <p style="margin-bottom:0;">Failure Message</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e126 ">
                        <p style="margin-bottom:0;">n/a</p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e132 ">
                        <p style="margin-bottom:0;">Failure messages are not used with penalty rules.</p>
                      </td>

                    </tr>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e120 ">
                        <p style="margin-bottom:0;">Header Rule</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e126 ">
                        <p style="margin-bottom:0;">Select a context rule using the <strong class="uicontrol">Header Rule Lookup</strong> dialog.</p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e132 ">
                        <p style="margin-bottom:0;">Enables you to specify a Header Rule for the rule set. For more information, see <a href="https://help.salesforce.com/s/articleView?id=ind.comms_header_rule.htm&amp;release=264.0.0&amp;type=5" title="To configure which rule is executed first when you have multiple children rules in a rule set, you can specify one of the rules as the header rule. If the header rule does not pass, processing stops on the entire rule set. Using header rules enables you to optimize rule set evaluation.">Header Rule</a>.</p>
                      </td>

                    </tr>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e120 ">
                        <p style="margin-bottom:0;">Effective Start Date</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e126 ">
                        <p style="margin-bottom:0;">Select a date</p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e132 ">
                        <p style="margin-bottom:0;">The start date of the period during which the object level rule is effective.</p>
                      </td>

                    </tr>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e120 ">
                        <p style="margin-bottom:0;">Effective End Date</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e126 ">
                        <p style="margin-bottom:0;">Select a date</p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e132 ">
                        <p style="margin-bottom:0;">The end date of the period during which the object level rule is effective.</p>
                      </td>

                    </tr>
                  </tbody>
                </table>
    3. Save your work.
    4. In the sidebar, click **Children Rules**.
    5. n the **Children Rules** facet, click **New Child Rule**.
    6. Enter values for each property.
        
        <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
                  <colgroup>
                    <col>
                    <col>
                    <col>
                  </colgroup>
                  <thead class="slds-text-title_caps ">
                    <tr class="">
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d256696e455">
                        <p style="margin-bottom:0;">Property</p>
                      </th>
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d256696e461">
                        <p style="margin-bottom:0;">Value</p>
                      </th>
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d256696e467">
                        <p style="margin-bottom:0;">Description</p>
                      </th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e455 ">
                        <p style="margin-bottom:0;">Rule</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e461 ">
                        <p style="margin-bottom:0;">Select a context rule using the <strong class="uicontrol">Entity Filter Lookup</strong> dialog.</p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e467 ">
                        <p style="margin-bottom:0;">Specifies the child context rule to include in the rule set.</p>
                      </td>

                    </tr>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e455 ">
                        <p style="margin-bottom:0;">Sequence</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e461 ">
                        <p style="margin-bottom:0;"><kbd>10</kbd> | <kbd>20</kbd> |<kbd> 30</kbd> ...</p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e467 ">
                        <p style="margin-bottom:0;">Specifies the child rule sequence. Salesforce recommends using a sequence of 10, 20, 30, etc. to allow for easier sequence changes in future.</p>
                      </td>

                    </tr>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e455 ">
                        <p style="margin-bottom:0;">Action Taken</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e461 ">
                        <p style="margin-bottom:0;">
                          <kbd>Policy Action</kbd>
                        </p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e467 ">
                        <p style="margin-bottom:0;">Since this is a Penalty context rule, the Action Taken should be <kbd>Policy Action</kbd> or <kbd>No Action</kbd>.</p>
                      </td>

                    </tr>
                    <tr class="">
                      <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e455 ">
                        <p style="margin-bottom:0;">Context Action</p>
                      </td>

                      <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e461 ">
                        <p style="margin-bottom:0;">Select a context action using the <strong class="uicontrol">Context Action Lookup</strong> dialog.</p>
                      </td>

                      <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d256696e467 ">
                        <p style="margin-bottom:0;">Specifies the context action to use when the Action Taken is set to <kbd>Policy Action</kbd>.</p>
                      </td>

                    </tr>
                  </tbody>
                </table>
5. Click **Save**.

This procedure creates a new penalty rule set. The next step is to assign it to a promotion or to use it to create an object level rule for contracts.

## Penalty Rules - Assigning to or Deleting from a Promotion

You can assign penalty rules to and delete penalty rules from promotions.

### Penalty Rules - Deleting from a Promotion

To delete a penalty context rule for a promotion:

1. In Vlocity Product Console, under Product Management, find the promotion to which you want to assign a rule set.
2. Click the **PROMOTION NAME** or the edit icon to open the promotion for editing.
3. In the left sidebar, click **Context Rules**.
4. In the Context Rules facet, click the PENALTY tab to view the penalty rule list.
5. In the penalty rule list, find the context rule you want to delete, and click the **Delete** button in the right side of the table row for that context rule.
6. In the Delete Rule Set dialog, click **Delete**.

## Penalty Rules - Assigning to a Promotion

To assign a penalty context rule to a promotion:

1. In Vlocity Product Console, under Product Management, find the promotion to which you want to assign a rule set.
2. Click the **PROMOTION NAME** or the edit icon to open the promotion for editing.
3. In the left sidebar, click **Context Rules**.
4. In the **Context Rules** facet, click **Add Rule Set**. The Add Rule Set dialog opens.
5. In the Add Rule Set dialog, search for and select the context rule you want to assign.
6. In the Add Rule Set dialog, click **Save**.
    
    The context rule you assigned to the promotion appears in the Context Rules facet PENALTY list.
7. In the **Context Rules** facet, click the PENALTY tab to display the list of assigned penalty rules.
    
    ![The Penalty tab is on the Context Rules page of a promotion configuration.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/context_rule_penalty_list.jpg)