Enhanced Scripting Support for Price Models
Oracle CPQ 24D enables scripting support for charges and other extensible output values using the new Advanced type Price Models and Scripting Price Model type Pricing Matrix Templates. Previously Advanced type Price Model scripts could only write product price values as output. Now customers can also generate charge pricing and other extensible dynamically calculated interim charge values such as cost, base price, or distributor price as outputs to Commerce and the Calculate Price REST API.
Compare Advanced Price Models vs Advanced (Legacy) Price Models
Both use BML to implement, but they are quite different:
Difference |
Advanced (Legacy) Price Models |
(NEW) Advanced Price Models |
---|---|---|
Naming |
The previous legacy Advanced Price Models are renamed to Advanced (Legacy) Price Models. |
Oracle CPQ 24D introduces the new Advanced Price Models. |
What Output can be Produced |
The BML can only be used to produce the product price and output an optional CalculationInfo for the product price. It does not support multi-charges. It can't be used to modify pricing attribute values. |
The BML can be used to add, modify or delete product prices, charges, and extensible product price and charge pricing attribute values. |
Where the BML is Viewed and Edited in the UI |
BML is viewed / edited inside the price model. |
A new Advanced Price Model is created and associated to a Scripting Price Model Template. The BML is authored in the Scripting Price Model Template which defines the extensible schema used by the BML. The same template can be used to create multiple advanced price models. For example, the same discount template can be used to create a North America Discount Price Model and Latin America Discount Price Model |
Where Pricing Data Resides |
The Legacy Advanced Price Model itself does not display Pricing Data in the Pricing Engine UI because the values are determined by the BML. Typically the BML references a data table as input to the calculations. |
Each Advanced Price Model can have its own Pricing Data which is viewed and edited in the associated Price Model. This native Pricing Data corresponds to the data table previously required by most Legacy Advanced Price Models. |
Scope of the BML calculation |
The BML is executed once for each line priced in a pricing invocation. So if there are 100 lines being priced, the BML is invoked 100 times. |
The BML is executed once for the whole pricing document when multiple lines are included in the pricing invocation. |
The new type of scripting Price Model is named 'Advanced' whereas legacy scripting Price Models are now renamed Advanced (Legacy) Price Models. Advanced (Legacy) Price Models operation remains the same, and new Advanced (Legacy) Price Models can still be created.
Oracle CPQ 24D introduces a new Scripting Price Model type Pricing Matrix Template for use in combination with the new Advanced Price Models. Advanced Price Models require an associated new Scripting Price Model type of Pricing Matrix Template to define the standard and custom attributes that will be accessed in the BML scripts.
At runtime, the Pricing Engine generates the applicable records in the Commerce Charge Array Set and populates the associated output price values in the quote and configuration charge schemas.
This enhances the current scripting capability in Pricing Engine by enabling the output of a wider variety of price values and attributes by a Price Model.
Steps to Enable
Example Set Up: Your company wants to set discount corridors (or discount guideline) for Supremo product lines by setting the minimum and maximum discount amounts:
Note the guideline is multi-currency. It has different values for different currencies.
Prerequisites:
-
You have enabled Charge Definitions. Refer to Oracle CPQ Administration Online Help > Pricing > Pricing Portal > Charge Pricing > Charge Definitions.
-
You have adopted multi-charges. (Note: multiple charges and charge definitions are required for this example but are not required to use a new Advanced Price Model)
Set Up Attributes, Pricing Lookups, and Pricing Attributes for Scripting Support
-
Navigate to Admin > Process Definition > Documents > Transaction Line > Attributes
-
Define Commerce process attributes.
Example Commerce Attributes
- Document: Transaction Line Attribute: Maximum Discount Attribute Type: Currency
-
Document: Transaction Line Attribute: Minimum Discount Attribute Type: Currency
-
Navigate to Admin > Pricing Portal > Pricing Lookups.
-
Define Pricing Lookups. Refer to Oracle CPQ Administration Online Help > Pricing > Pricing Portal > Pricing Lookups.
Example Pricing Lookups
-
Document: Transaction Attribute: Sales Channel Attribute Type: Menu Menu Options: direct, distributor
-
Document: Transaction Line Attribute: Part Attributes > Part Sales Product Type Attribute Type: String
Comment: In the "Part Attributes" Attribute Set, click "Manage Attributes" to expose it
-
Navigate to Admin > Pricing Portal > Pricing Attributes.
-
Define Pricing Attributes. Refer to Oracle CPQ Administration Online Help > Pricing > Pricing Portal > Pricing Attributes.
Example Pricing Attributes
-
Pricing Entity: Line Name: Line Maximum Discount In/Out: Input
-
Mapped To Data Source: <Commerce Process Name>
-
Mapped To Source Attribute: Maximum Discount
-
Mapped To Source Entity: Transaction Line
-
-
Pricing Entity: Line Name: Line Minimum Discount In/Out: Input
-
Mapped To Data Source: <Commerce Process Name>
-
Mapped To Source Attribute: Minimum Discount
-
Mapped To Source Entity: Transaction Line
-
-
Pricing Entity: Charge Name: Maximum Discount In/Out: Output Visibility: Administration, Runtime
-
Pricing Entity: Charge Name: Minimum Discount In/Out: Output Visibility: Administration, Runtime
-
Navigate to Admin > Process Definition > Documents > Transaction Line > Attributes.
-
Click Synchronize Charge Definition.
-
Deploy the Commerce process.
Create a Scripting Price Model - Pricing Matrix Template
Complete the following steps to create a Scripting Price Model type Pricing Matrix Template in the CPQ Pricing Portal.
-
Navigate to Admin > Pricing Portal > Pricing Matrix Templates.
-
Select Add from the Actions drop-down.
-
Enter the Name.
-
Enter the Variable Name.
-
Select Scripting Price Model from the Template Type drop-down.
-
(optional) Enter a Description.
-
Click Create.
-
Select Add from the Actions drop-down.
-
Enter the following data to create a template column.
-
Enter the Name.
-
Enter the Variable Name.
-
Select the Data Type.
-
If applicable select a Lookup. (Lookups are only available for String Data Types)
-
If applicable, enter of select a Default Value.
-
Check Default Value Overridable if the default value can be modified.
-
Check Required to make this field mandatory.
-
Check Key to identify this field as a unique identifier.
-
Repeat this step to enter additional columns.
-
Example Scripting Price Model - Pricing Matrix Template
-
Enter BML Script for the Scripting Price Model - Pricing Matrix Template.
-
Click Edit (In the Basic Details section).
-
Expand More Details, and click the Advanced Script Edit link.
-
Select the applicable attributes for the Pricing Document Attributes tab, For example,
_currencyCode
salesChannel_c
lineMaximumDiscount_c
lineMinimumDiscount_c
salesProductType_c
calculationInfo
chargeDefinitionCode
chargeType
dynamicPricingType
maximumDiscount_c
minimumDiscount_c
pricePeriod
priceType
priceType
-
Select
_currentMatrix
from the Special Parameters tab. -
Click Next.
-
Enter the BML Script. See BML Script Example
-
Click Save and Close.
-
-
Click Update.
BML Script Example
Create an Advanced Price Model
Complete the following steps to create an Advanced Price Model in the CPQ Pricing Portal.
-
Navigate to Admin > Pricing Portal > Price Models.
-
Select Add from the Actions drop-down.
-
Enter the Name.
-
Enter the Variable Name.
-
Select Advanced from the List Type drop-down.
-
Select the applicable Scripting Price Model - Pricing Matrix Template from the Template drop-down.
-
(optional) Select a Start date. This effective start date value will apply to all child Price Model Items.
-
(optional) Select an End date. This effective end date value will apply to all child Price Model Items.
-
(optional) Enter a Description.
-
Click Create.
-
Select Edit from the Actions drop-down.
-
Click Add, and then define the values for the row. See Advanced Price Model Example
-
Select values from available drop-downs and define the appropriate data values for the row.
-
Repeat this step to enter additional rows.
-
Click Update.
Example Advanced Price Model
Link Advanced Price Model to Pricing Rule
Complete the following steps to create an Advanced Price Model in the CPQ Pricing Portal.
-
Navigate to Admin > Pricing Portal > Pricing Rules.
-
Click on the applicable Pricing Rule. (e.g. Base Pricing Rule)
-
Select Add from the Linked Price Models Actions drop-down.
-
Select the applicable Price Model (e.g. Supremo North America Discount Corridors.
-
Click Add.