---
schema_version: "1"
id: 4927283e18a87e0c5d921053f6699e6c4ee25a0e7ef754e9a39feeaf772e4bd2
title: Context Rule Components
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_context_rule_components.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_context_rule_components.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 30df9eea6d0a504dc6edd76d7eacb06c2ae5a8ee0c079abfce42a7dd134b78bc
description: You build context rules by combining context rule components. Over time, this will establish a library of components that can reduce overall development time and expedite new development.
products:
  - Communications
  - Media
  - Energy and Utilities
release: "264"
---
# Context Rule Components

You build context rules by combining context rule components. Over time, this will establish a library of components that can reduce overall development time and expedite new development.

**Context Rule Components**

![Figure elements are explained in the following text.](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_components.jpg)

The context rules framework consists of the following reusable components:

- Rule sets contain one or more context rules, and are applied to products, promotions, price lists, and price list entries. See [Rule Sets](https://help.salesforce.com/s/articleView?id=ind.comms_rule_sets.htm&release=264.0.0&type=5 "A rule set is a logical grouping of one or more context rules. Use a rule set to designate how the grouped context rules are expressed in a logical expression and how they are used in Industries Cart.").
- Context rules are analogous to entity filters in the advanced rules framework. Context rules determine when a rule set applies in Industries Cart. 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.").
- Context dimensions are variables that describe the possible values to use in a rule condition. You can reuse context dimensions across multiple rule conditions. The rules engine compares context dimensions to data that comes from an sObject, a function, or a static value defined in the context mapping. See [Context Dimensions](https://help.salesforce.com/s/articleView?id=ind.comms_context_dimensions.htm&release=264.0.0&type=5 "Context dimensions are variables that describe the possible values to use in a context rule condition. You can reuse context dimensions across multiple rule conditions. Context dimensions are linked to one or more context mappings. The rules engine compares them to the linked context mappings.").
- Context mappings enable the rules engine to compare context dimension variables to data stored in sObjects, calculated using a function, or entered during design-time in a specified context scope. ​Salesforce Industries Communications, Media, and Energy caches context mappings in the session cache. See [Context Mapping](https://help.salesforce.com/s/articleView?id=ind.comms_creating_context_mappings.htm&release=264.0.0&type=5 "Context mappings allow the rules engine to compare context dimensions to data stored in an sObject, calculated using a function, or entered during design time within a specified context scope. Create context mappings in Vlocity Product Console.").
- Context scopes describe the relational path from a root sObject, such as an Order, to related sObjects. Context mappings use context scopes to pinpoint the fields on the sObjects or compute data to match with context dimension variables so the Context Rule Service engine can evaluate them. See [Context Scopes](https://help.salesforce.com/s/articleView?id=ind.comms_context_scopes.htm&release=264.0.0&type=5 "Context scopes describe the relational path from a root sObject, such as an Order, to related sObjects. Context mappings use context scopes to identify the fields on the sObjects or computed data that is matched with context dimension variables. The Context Rule Service evaluates the information.").
- Functions are used in context mappings. You can invoke custom implementations to provide additional logic and processing. See [Functions for Rules](https://help.salesforce.com/s/articleView?id=ind.comms_functions_for_rules.htm&release=264.0.0&type=5 "In context rules, when you need rules to evaluate complex criteria, you can create a function.").
- Object level rules assign penalty rules for contracts. See [Creating Object Level Rules](https://help.salesforce.com/s/articleView?id=ind.comms_create_object_level_rules.htm&release=264.0.0&type=5 "Object level rules are used by the ContractTerminiationService interface to assign penalty rules for contracts.").
- Context actions can be used with penalty rules to apply a fee when a promotion or contract is canceled. Context actions enable you to specify either a flat fee using a pricing element on a price list or calculate a fee by invoking a custom implementation. See [Creating Context Actions](https://help.salesforce.com/s/articleView?id=ind.comms_create_context_actions.htm&release=264.0.0&type=5 "Use context actions with penalty rules to apply a fee when a promotion or contract is canceled. Context actions enable you to specify a flat fee using a pricing element on a price list.").

You combine context rule components to create logical expressions that the rules engine can evaluate. For example:

```
Context Rule Condition = true WHEN {{Context Dimension}} == {{Context Mapping[Context Scope.Source Expression]}}
```

- **[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.
- **[Creating Context Mappings](https://help.salesforce.com/s/articleView?id=ind.comms_creating_context_mappings.htm&release=264.0.0&type=5)**  
    Context mappings allow the rules engine to compare context dimensions to data stored in an sObject, calculated using a function, or entered during design time within a specified context scope. Create context mappings in Vlocity Product Console.
- **[Rule Sets](https://help.salesforce.com/s/articleView?id=ind.comms_rule_sets.htm&release=264.0.0&type=5)**  
    A rule set is a logical grouping of one or more context rules. Use a rule set to designate how the grouped context rules are expressed in a logical expression and how they are used in Industries Cart.
- **[Create Qualification Rule Sets](https://help.salesforce.com/s/articleView?id=ind.comms_create_qualification_rule_sets.htm&release=264.0.0&type=5)**  
    Create qualification context rules as rule sets in Vlocity Product Console using reusable context rule components.
- **[Context Dimensions](https://help.salesforce.com/s/articleView?id=ind.comms_context_dimensions.htm&release=264.0.0&type=5)**  
    Context dimensions are variables that describe the possible values to use in a context rule condition. You can reuse context dimensions across multiple rule conditions. Context dimensions are linked to one or more context mappings. The rules engine compares them to the linked context mappings.
- **[Context Scopes](https://help.salesforce.com/s/articleView?id=ind.comms_context_scopes.htm&release=264.0.0&type=5)**  
    Context scopes describe the relational path from a root sObject, such as an Order, to related sObjects. Context mappings use context scopes to identify the fields on the sObjects or computed data that is matched with context dimension variables. The Context Rule Service evaluates the information.
- **[Create Context Actions](https://help.salesforce.com/s/articleView?id=ind.comms_create_context_actions.htm&release=264.0.0&type=5)**  
    Use context actions with penalty rules to apply a fee when a promotion or contract is canceled. Context actions enable you to specify a flat fee using a pricing element on a price list.