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.

Create Advanced Price Model

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.

Scripting Price Model Template

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:

Example Set Up

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

  1. Navigate to Admin > Process Definition > Documents > Transaction Line > Attributes

  2. 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

  1. Navigate to Admin > Pricing Portal > Pricing Lookups.

  2. 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

  1. Navigate to Admin > Pricing Portal > Pricing Attributes.

  2. 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

  1. Navigate to Admin > Process Definition > Documents > Transaction Line > Attributes.

  2. Click Synchronize Charge Definition.

  3. 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.

  1. Navigate to Admin > Pricing Portal > Pricing Matrix Templates.

  2. Select Add from the Actions drop-down.

  3. Enter the Name.

  4. Enter the Variable Name.

  5. Select Scripting Price Model from the Template Type drop-down.

  6. (optional) Enter a Description.

  7. Click Create.

  8. Select Add from the Actions drop-down.

  9. Enter the following data to create a template column.

    1. Enter the Name.

    2. Enter the Variable Name.

    3. Select the Data Type.

    4. If applicable select a Lookup. (Lookups are only available for String Data Types)

    5. If applicable, enter of select a Default Value.

    6. Check Default Value Overridable if the default value can be modified.

    7. Check Required to make this field mandatory.

    8. Check Key to identify this field as a unique identifier.

    9. Repeat this step to enter additional columns.

Example Scripting Price Model - Pricing Matrix Template

Example Scripting Price Model - Pricing Matrix Template

  1. Enter BML Script for the Scripting Price Model - Pricing Matrix Template.

    1. Click Edit (In the Basic Details section).

    2. Expand More Details, and click the Advanced Script Edit link.

    3. 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
    4. Select _currentMatrix from the Special Parameters tab.

    5. Click Next.

    6. Enter the BML Script. See BML Script Example

    7. Click Save and Close.

  2. Click Update.

BML Script Example

BML Script Example

Create an Advanced Price Model

Complete the following steps to create an Advanced Price Model in the CPQ Pricing Portal.

  1. Navigate to Admin > Pricing Portal > Price Models.

  2. Select Add from the Actions drop-down.

  3. Enter the Name.

  4. Enter the Variable Name.

  5. Select Advanced from the List Type drop-down.

  6. Select the applicable Scripting Price Model - Pricing Matrix Template from the Template drop-down.

  7. (optional) Select a Start date. This effective start date value will apply to all child Price Model Items.

  8. (optional) Select an End date. This effective end date value will apply to all child Price Model Items.

  9. (optional) Enter a Description.

  10. Click Create.

  11. Select Edit from the Actions drop-down.

  12. Click Add, and then define the values for the row. See Advanced Price Model Example

  1. Select values from available drop-downs and define the appropriate data values for the row.

  2. Repeat this step to enter additional rows.

  1. Click Update.

Example Advanced Price Model

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.

  1. Navigate to Admin > Pricing Portal > Pricing Rules.

  2. Click on the applicable Pricing Rule. (e.g. Base Pricing Rule)

  3. Select Add from the Linked Price Models Actions drop-down.

  4. Select the applicable Price Model (e.g. Supremo North America Discount Corridors.

  5. Click Add.