You are here:
Context Dimensions
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 dimensions must have a Domain Type, a property that specifies how the rule condition values appear when a user creates the rule condition. Valid domain types are:
-
Object Lookup: Select a specific record from an sObject.
-
Picklist: Select rule condition values from a Vlocity picklist.
-
Type In: Type in free form string values.
Context dimensions can also have condition weights, which allow the pricing engine to find the tightest match when used in context rules for price list entries or child price lists. For more information about condition weights, see Using Condition Weights.
Using Context Dimensions
Use context dimensions when creating rule conditions in two similar but slightly different ways:
-
In a simple rule condition, when the context dimension determines the values that will be available to the user when creating a rule condition
-
In a function rule condition, when the context dimension can be used as the input to the function
- Context Dimension names cannot have spaces.
Consideration When Creating Context Dimensions
Review these consideration before creating context dimensions.
- Context dimension names cannot have spaces.
- The data type of the context dimension must be set up correctly. The String data type is deprecated. Use the Text data type instead.
- The context dimension name can't be the same as a function name.
- Context dimension values can't have any spaces.
Creating Context Dimensions
Create context dimensions in Vlocity Product Console. For more information about creating context dimensions, see Creating Context Dimensions.
- Create Context Dimensions
Context dimensions are variables that describe the values that can be used in a context rule condition. - Create the Originating Channel Context Dimension
These instructions use the Channel_PKL picklist which has been previously created. The picklist has the following values: Web and Retail. - Create the Order Status Context Dimension
These instructions use the XStatus_PKL which has been previously created. The picklist has the following values: Draft and Activated. - Create the Account Status Context Dimension
These instructions use the CustAcctStatus_PKL which has been previously created. - Create the Account SLA Context Dimension
These instructions use the AccountSLA_PKL which has been previously created. The picklist has the following values: Gold, Silver, Platinum and Bronze. - CurrentRuleObjectId Variable
In some cases, you might want to create a context rule that evaluates the entity to which it is applied. For example, you might want to create a rule that disqualifies a promotion for accounts that have already used that promotion. Or perhaps you want a rule to disqualify products when they are already in the cart line items of Industries Cart. To do this, you use a special variable called CurrentRuleObjectId, which enables your rule conditions or functions to access the current object's record Id as it iterates over them.

