Loading
The Trailblazer Community is now read-only Read More
Set Up Context Definitions

Set Up Context Definitions

Update the extended SalesTransactionContext context definition and set up a custom asset context definition.

Required Editions

Available in: Lightning Experience
Available in: Enterprise, Unlimited, and Developer Editions of Revenue Management (formerly Revenue Cloud) with the Revenue Cloud Growth license or the Revenue Cloud Advanced license

Update the Extended SalesTransactionContext Context Definition

To use the custom ConstraintEngineNodeStatus field, update the extended SalesTransactionContext context definition ​that's configured for the default pricing procedure on the Revenue Settings page.

Constraint Rules Engine uses the extended SalesTransactionContext context definition to read and write each line item's configuration state as it runs CML. The ConstraintEngineNodeStatus and AssetConstraintEngineNodeStatus attributes and their mappings, along with the TransactionType mappings, are required setup rather than optional refinements. Complete them before you use Constraint Rules Engine.

When you extend a base context definition instead of cloning it, the base definition's standard attributes and mappings carry over, but the CML-required items don't. The ConstraintEngineNodeStatus and AssetConstraintEngineNodeStatus attributes and their mappings point to the ConstraintEngineNodeStatus__c custom field that you create, so they aren't part of the base SalesTransactionContext. Add these attributes and mappings yourself after you extend the definition.

Add Attributes

Edit the extended SalesTransactionContext context definition and add these attributes.

Add Attribute To Attribute Name Type Data Type
SalesTransactionItem node ConstraintEngineNodeStatus INPUTOUTPUT STRING
AssetActionSource AssetConstraintEngineNodeStatus INPUTOUTPUT STRING

See Edit Context Definitions and Add Attributes.

Map Attributes

If you're using Business Rules Engine and want to set up Constraint Rules Engine, or want to use both engines, the TransactionType attribute mapping switches between the rules engines at the transaction level.

Open the extended SalesTransactionContext context definition, go to the Map Data tab, and map the necessary attributes.

Before you map these attributes, turn on Transaction processing for quotes and orders on the Revenue Settings page.

Mapping Name Attribute Map To
QuoteEntitiesMapping ConstraintEngineNodeStatus ConstraintEngineNodeStatus__c field on the QuoteLineItem object
QuoteEntitiesMapping TransactionType on the SalesTransaction node TransactionType field on the Quote object
OrderEntitiesMapping ConstraintEngineNodeStatus ConstraintEngineNodeStatus__c field on the OrderItem object
OrderEntitiesMapping TransactionType on the SalesTransaction node TransactionType field on the Order object
AssetEntitiesMapping AssetConstraintEngineNodeStatus ConstraintEngineNodeStatus__c field on the AssetActionSource object

Then, edit AssetToSalesTransactionMapping. Select the data source as Context Definition, select your extended Sales Transaction context definition, and find the SalesTransactionItem node listed. Then, map the AssetConstraintEngineNodeStatus attribute to the ConstraintEngineNodeStatus__c field on the SalesTransactionItem node.

See Add Context Mapping.

Activate Context Definition

Activate the updated SalesTransactionContext context definition.

An extended context definition starts without a default mapping, because inherited mappings come across as non-default. Designate one mapping as the default before you activate the extended definition. Otherwise, activation fails.

See Activate a Context Definition.

Set Up Custom Asset Context Definition

Set up an asset context definition to get asset data based on the selected context. Use this asset data when you configure asset-based rules and constraints in the CML Editor, and apply other filters on the data as needed.

An asset context is required to create asset-based configuration rules and constraints. If you don't define one, Constraint Rules Engine doesn't fetch any asset data.

When you extend a base context definition instead of cloning it, the base definition's own standard attributes and mappings are preserved, and you can use Sync to pick up later updates to the base. Extending doesn't add the CML-required items for you. The ConstraintEngineNodeStatus and AssetConstraintEngineNodeStatus attributes, their mappings to the ConstraintEngineNodeStatus__c custom field, and the TransactionType mappings aren't part of the base SalesTransactionContext, because they reference a custom field that you create. Add these attributes and mappings yourself after you extend the context definition.

Designate one mapping as the default before you activate the extended definition. Extended context definitions start without a default mapping.

Note
Note You can set up a custom asset context definition only from Summer ’25 and onwards.

Create Custom Asset Context Definitions

To fetch assets for a specific account, product, or a custom or standard field of the asset, define a custom asset context definition.

  1. Extend the standard AssetContext__stdctx context definition.
  2. Customize the mappings according to your requirements.

Select an Asset Context for Constraint Rules Engine

Select the asset context for Constraint Rules Engine to apply asset-based configuration rules and constraints.

Note
Note Select an asset context for Product Configurator only if your constraint model uses assets.
  1. From Setup, in the Quick find box, enter Revenue Settings, and then select Revenue Settings.
  2. In the Set Up Asset Context for Product Configurator section, select the asset context definition that you want to use.

After you select the asset context definition, filter the asset data directly in the CML Editor based on your requirements when you define configuration rules and constraints.

To learn about creating rules and constraints by using Constraint Rules Engine, see Use Constraint Builder With Constraint Rules Engine.

 
Loading
Salesforce Help | Article