Set up Attribute-Based Pricing
Set up attribute-based pricing for standard cart APIs. In Spring '23 and later, only the DefaultPricingPlan is supported. For more information, see Attribute-Based Pricing
Before you Begin
To use attribute-based pricing that uses decision matrices with expression sets, assign Business Rule Engine permission sets, Rules Engine Runtime Community Runtime, Rules Engine Designer, and Rules Engine Runtime. For more information, see Decision Matrices and Permission Sets for Business Rules Engine.
Download the PricingPlanHelper and CustomPricingPlanStepImpl classes from this zip file.
-
From the App Launcher, find and select Vlocity Product Console.
-
Under the Pricing section, click the search icon next to Pricing Plan.
-
Search for
Standard Pricing Plan
. -
Edit the Standard Pricing Plan.
-
Click Pricing Plan Steps.
-
Edit the Get Matrix Price step.
-
Activate this pricing plan step by selecting Active.
-
Update the Implementation Name and Method Name based on the implementation of attribute-based pricing that you want to use.
Tier Implementation Name Method Name Java core service CpqPricingService getMatrixPrice Apex (VPL) CustomPricingPlanStepImpl GetMatrixPrice -
In parameters field, specify the parameters depending on your implementation and tier.
NOTE: Prices must not be interger value in the matrix for standard cart APIs. When the users create their AttributePricingMatrix, the prices must be in double. For example, if the price is 329, then use 329.00 in the matrix.Type of Attribute-Based Pricing Type of Matrix Parameters for Java Core Service Parameters for Apex (VPL) Standard DecisionMatrix + ExpressionSets {"DecisionMatrix":"true","MatrixVersionId":"0lNxx0000000001EAA","ProcedureName":"ABP-Standard"}
{"DecisionMatrix":"true","MatrixName":"AttributePricingMatrix","ProcedureName":"ABP-Standard"}
SourceTarget with Target as variable Path1 DecisionMatrix + ExpressionSets {"DecisionMatrix":"true","MatrixVersionId":"0lNxx000000001dEAA","ProcedureName":"SourceTargetAttributePricingMatrix", "Path1":"PRODUCT-ABP-ROOT<PRODUCT-ABP-CHILD1<PRODUCT-ABP-GCHILD"
{"DecisionMatrix":"true","MatrixName":"SourceTargetAttributePricingMatrix","ProcedureName":"SourceTargetAttributePricingProcedure", "Path1":"PRODUCT-ABP-ROOT<PRODUCT-ABP-CHILD1<PRODUCT-ABP-GCHILD"
SourceTarget DecisionMatrix + ExpressionSets {"DecisionMatrix":"true","MatrixVersionId":"0lNxx000000001dEAA","ProcedureName":"SourceTargetAttributePricingMatrix"}
{"DecisionMatrix":"true","MatrixName":"SourceTargetAttributePricingMatrix","ProcedureName":"SourceTargetAttributePricingProcedure"}
RangeBased DecisionMatrix + ExpressionSets {"RangeAttributes":"ATTRIBUTE-ABP-INT","ProcedureName":"RangeAttributePricingProcedure","MatrixVersionId":"0lNxx00000000BJEAY","DecisionMatrix":"true"}
{"RangeAttributes":"ATTRIBUTE-ABP-INT","ProcedureName":"RangeAttributePricingProcedure","MatrixName":"RangeAttributePricingMatrix","DecisionMatrix":"true"}
VolumeBased DecisionMatrix + ExpressionSets {"RangeFields":"Quantity","ProcedureName":"VolumeBasedPricingProcedure" ,"MatrixVersionId":"<*Active matrix version SF ID*>","DecisionMatrix":"true"}
{"RangeFields":"Quantity","ProcedureName":"VolumeBasedPricingProcedure","MatrixName":"VolumeBasedPricingMatrix","DecisionMatrix":"true"}
Standard CalculationMatrix + CalculationProcedure {"MatrixVersionId":"0lNxx0000000001EAA","ProcedureName":"ABP-Standard"}
{"MatrixName":"AttributePricingMatrix","ProcedureName":"ABP-Standard"}
SourceTarget with Target as variable Path1 CalculationMatrix + CalculationProcedure {"MatrixVersionId":"0lNxx000000001dEAA","ProcedureName":"SourceTargetAttributePricingMatrix", "Path1":"PRODUCT-ABP-ROOT<PRODUCT-ABP-CHILD1<PRODUCT-ABP-GCHILD"
{"MatrixName":"SourceTargetAttributePricingMatrix","ProcedureName":"SourceTargetAttributePricingProcedure", "Path1":"PRODUCT-ABP-ROOT<PRODUCT-ABP-CHILD1<PRODUCT-ABP-GCHILD"
SourceTarget CalculationMatrix + CalculationProcedure {"MatrixVersionId":"0lNxx000000001dEAA","ProcedureName":"SourceTargetAttributePricingMatrix"}
{"MatrixName":"SourceTargetAttributePricingMatrix","ProcedureName":"SourceTargetAttributePricingProcedure"}
RangeBased CalculationMatrix + CalculationProcedure {"RangeAttributes":"ATTRIBUTE-ABP-INT","ProcedureName":"RangeAttributePricingProcedure","MatrixVersionId":"0lNxx00000000BJEAY"}
{"RangeAttributes":"ATTRIBUTE-ABP-INT","ProcedureName":"RangeAttributePricingProcedure","MatrixName":"RangeAttributePricingMatrix"}
VolumeBased CalculationMatrix + CalculationProcedure {"RangeFields":"Quantity","ProcedureName":"VolumeBasedPricingProcedure","MatrixVersionId":"0lNxx00000000BJEAY"}
{"RangeFields":"Quantity","ProcedureName":"VolumeBasedPricingProcedure","MatrixName":"VolumeBasedPricingMatrix"}
-
Save the Get Matrix Price step.
After updating attribute-based pricing in the pricing plan, run the Cache Catalog Product Definition Jobs in Vlocity CMT Administration.
If you're using the Java implementation of attribute-based pricing:
Generate its compile data by running this code in an anonymous window of the developer console:
- In Vlocity CMT Administration, run the Generate Compile Matrix Data EPC job.
- Activate the configuration snapshot by executing following in an anonymous window of the developer console:
- If you want to use a new matrix version, update the pricing plan step for attribute-based pricing with the ID of the new matrix version.