0% found this document useful (0 votes)
9 views

Pricing Algorithm 1 - CCC

Uploaded by

Aniket Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Pricing Algorithm 1 - CCC

Uploaded by

Aniket Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Audio for this webcast will stream via your computer’s speakers.

Note: There is no separate dial-in number.


Questions will be taken via the QandA during the webcast. The replay and
the slide deck will be available within 24 hours from the event post.

Please select Yes to join the integrated voice conference when prompted:

You will be on music hold until the session starts.

If you have joined the Integrated Voice Conference, and still cannot hear
the presentation, try this: click "More Options" on the control panel and
click the speaker/microphone audio test. Then select your preferred
speakers.
If you already selected No, in the WebEx Menu, click on Audio> Integrated Voice Conference> Join Conference.

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2-1
Oracle Confidential 1
Safe Harbor Statement

The following is intended to outline our general product direction. It is intended for information
purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any
material, code, or functionality, and should not be relied upon in making purchasing decisions. The
development, release, and timing of any features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2-2
Price Execution Fundamentals – Algorithms Deep Dive

Priya Gopal, Rakesh Arora


Oracle Pricing Cloud
February 5, 2019

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.


Learning Objectives

• Explain Algorithm Components


• Variables
• Data Objects
• Functions
• Steps
• Data Sets
• Test Cases

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2-4
Price Execution Components: Interactions

Service Mappings

Matrixes Algorithms

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2-5
Topics
• Algorithms Overview
• Demo
• Algorithm Components
• Variables
• Functions
• Steps
• Data Sets
• Step Actions
• Test Cases
• Troubleshooting Tips
• Best Practices
• Q&A

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2-6
Topics
• Algorithm Overview
• Demo
• Algorithm Components
• Variables
• Functions
• Steps
• Data Sets
• Step Actions
• Test Cases
• Troubleshooting Tips
• Best Practices
• Q&A

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2-7
Algorithm Overview
What is an Algorithm?

• Executes procedural logic based on the input and output variables


• A sequence of steps
• Ability to invoke other algorithms or SOAP services
• Version control
• Extensibility to address dynamic pricing requirements
• Pricing implementers control publishing extension versions
• No Dependency on Cloud Operations and System Administrators

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2-8
Algorithm Overview
Algorithm Attributes

• Unique Name - Upper Camel Case with Spaces, Custom Suffix


• Version – Zero and 1 are seeded. Higher versions are customer extended versions
• Status – In Progress, Published, Inactive
• Public – No, Use Yes only if same algorithm is to be used across applications eg. Contracts or
OM
• Start/End Dates – Effectivity based on the Algorithm Execution Date.
• Description
• Owner Application – Indicates the owner of the algorithm eg. Pricing
• Module – Module for the algorithm eg. Price Execution
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2-9
Topics
• Algorithm Overview
• Demo
• Algorithm Components
• Variables
• Functions
• Steps
• Data Sets
• Step Actions
• Test Cases
• Best Practices
• Q&A

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 10


Algorithm Demo

• Hello World Primer


• Simple Pricing Process

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 11


Topics
• Algorithm Overview
• Demo
• Algorithm Components
• Variables
• Functions
• Steps
• Data Sets
• Step Actions
• Test Cases
• Troubleshooting Tips
• Best Practices
• Q&A

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 12


Algorithm Components
Variables

Variables have:
Name – Unique name within that algorithm
Data type – One of the types listed above. The Data Object type is based on Service Mappings Services.
Required – Indicates that a value is required for executing the algorithm
Input/Output – Indicates whether the variable is input only or output only or both input and output.
Internal Service Schema – Applicable to Data Objects. The schema is one of the services from the Service Mappings. Most
algorithms use at least one Data Object Variable.
Default Expression – Default values can be provided using groovy expressions for all data types except Data Object.

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 13


Algorithm Components
Functions
Function Types
1. Script – Perform procedural logic and return results
2. View Object Query – Lookup data and return
results

Function Arguments
• Unique Name
• Comments

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 14


Algorithm Components
Functions - Script Function Example
Function Detail
• Function takes 3 input arguments

• Returns output value

Function Invocation in the algorithm

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 15


Algorithm Components
Functions - View Object Query Function Example
Function Name
GetCurrencyConversionRate

Arguments

pricingStrategyId

priceAsOf

pricingDate

fromCurrency

toCurrency

businessUnit

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 16


Algorithm Components
Functions - View Object Query Function Example

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 17


Algorithm Components
Functions - View Object Query Functions
View Object Query Attribute Description
Application Module oracle.apps.scm.pricing.priceExecution.pricingProcesses.public
Model.applicationModule.PricingProcessAM
Application Configuration ${(PriceRequest.PricingServiceParameter[0]?.CacheEnabledFla
g==null ||
PriceRequest.PricingServiceParameter[0].CacheEnabledFlag) ?
'PricingProcessAMShared' : 'PricingProcessAMLocal'}
View Object Eg. CurrencyConvRate1
Or
oracle.apps.flex.scm.pricing.priceExecution.pricingProcesses.pri
ceListCharges.view.PriceListChargeDFFVO
View Criteria Name of the View Criteria.
In Memory Search Specification Eg. isInDateRange(StartDate, EndDate, pricingDate)
Order By View Object Attribute to Order By eg. Precedence
Single Yes/No

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 18


Algorithm Components
Functions - View Object Query Functions

Name of the • Fixed Value


View Object • Expression
Bind Variable • Function Argument Name

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 19


Algorithm Components
Steps
Step Types
• Conditional Action
• Nested Action
• Subalgorithm
• Group
• Tree
• Split
• Merge
• RunScript
• Composite Step
o If
o For
o While
o Block

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 20


Algorithm Components
Steps
Common Attributes
• Name
• Description
Primary • Condition
• Data Sets

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 21


Algorithm Components
Steps – Data Sets
OM Data PriceRequest

Header HeaderId = 101

HeaderId = 101

Order ItemId = 149, Quantity, Uom = 3 Ea

Line1 LineId = 1011


PriceSalesTransaction PriceAsOf = 01-Mar-2019 9AM
• Line1
• Line2
HeaderId = 101

ItemId = 149, Quantity, Uom = 2 Each


Line2
LineId =1012

PriceAsOf = 01-Mar-2019 9AM

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 22


Algorithm Components
Steps – Data Sets
Header HeaderId = 101

HeaderId = 101

Line LineId = 1011

ItemId = 149, Quantity, Uom = 3 Ea

ChargeId = 1
Charge
ParentEntityId = 1011

ChargeId = 1

PriceElementCode = QP_BASE_LIST_PRICE
ChargeComponent
ExtendedAmount = 300

UnitPrice = 100 Condition


ChargeId = 2 'SUCCESS' == Param.OutputStatus
Charge
ParentEntityId = 1011 && 'ERROR' != Header.MessageTypeCode
PriceSalesTransaction
&& 'ERROR' != Line.MessageTypeCode
ChargeId = 2
&& 'ERROR' != Charge.MessageTypeCode
PriceElementCode = QP_BASE_LIST_PRICE
ChargeComponent
ExtendedAmount = 60

UnitPrice = 20

HeaderId = 101
Data Set Rules
1. Identify the Primary Set. The first set is usually the Primary set
Line ItemId = 149, Quantity, Uom = 2 Each

LineId =1012, MessageTypeCode = ERROR


2. Identify other reference sets, the Data Set Join and their Cardinality
ChargeId = 3
3. Order the Reference Sets by Join Dependency
Charge
ParentEntityId = 1012 For eg. Data Set Join for the Line is dependent on Charge, so appears
ChargeId = 2 after Charge Set
PriceElementCode = QP_BASE_LIST_PRICE 4. Ensure that the data sets cover all the Data Object entities and attributes
ChargeComponent
ExtendedAmount = 20 needed to execute the step
UnitPrice = 10 Eg. Attributes used in Condition and Step Actions are part of the Data Sets.

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 23


Algorithm Components
Steps – Data Sets
Primary Set Reference Sets
Condition
• Charge1
'SUCCESS' == Param.OutputStatus
&& 'ERROR' != Header.MessageTypeCode • Line1
ChargeComponent1
&& 'ERROR' != Line.MessageTypeCode • Header1
&& 'ERROR' != Charge.MessageTypeCode

• Charge2
ChargeComponent2 • Line1
• Header1

Charge Component3
• Condition evaluates to false • Charge3
• Not Processed ChargeComponent3 • Line2 [MessageTypeCode = ERROR]
• Header1

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 24


Algorithm Components
Steps – Data Set Join Examples

SNo Use Case Pattern Data Set Join Example Cardinality


1 Join Line to Header Single Attribute Match [HeaderId: {Line.HeaderId}] Zero or One
One
2 Match the Multiple Attributes [ParentEntityId: {Charge.ParentEntityId}, ParentEntityCode: Many
Manual Price Match {Charge.ParentEntityCode}, RollupFlag: {Charge.RollupFlag},
Adjustment ChargeAppliesTo: 'PRICE']
3 Another way to match Groovy Expression ERROR'!=Mpa.MessageTypeCode && Many
the (Charge.ChargeDefinitionCode==Mpa.ChargeDefinitionCode
ManualPriceAdjustment || Charge.ChargeDefinitionId==Mpa.ChargeDefinitionId) &&
Charge.PricePeriodicityCode==Mpa.PricePeriodicityCode &&
Charge.MessageTypeCode!='ERROR' &&
Charge.ParentEntityId==Mpa.ChargeParentEntityId &&
Charge.RollupFlag==Mpa.ChargeRollupFlag
4 Create new Single Attribute Match [ChargeId: {Charge.ChargeId}] Many
ChargeComponents

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 25


Algorithm Components
Steps – Conditional Action
Switch Pattern: Nested If Pattern:
Switch If (Condition1) then {
}
(Condition1) then {
} Else If (Condition2) then {
(Condition2) then { }
} Else {
Default { }
}

Condition 1
Condition 2

Else

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 26


Algorithm Components
Steps – Nested Action

Pattern: Can be Function-based or any data set


For each Nested Set
Row {
If First Row
If First Row {……}
For Each Row {……}
For each Row
If Last Row {……}
If No Row {……}
}
If Last Row

If No Row

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 27


Algorithm Components
Steps – Subalgorithm
Algorithm A {
@Step Invoke Algorithm B(Input1 -> Var1, Input2 -> Var2, Output1 -> Var3,
Output2 -> Var4)
}
1. Subalgorithm Name

2. Input Variables

3. Output Variables

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 28


Algorithm Components
Test Cases
Test Input Test Output

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 29


Price Execution Components: Interactions

Service Mappings

Matrix dimensions
The Service Mappings
refer to Service
define the schema for the
Mapping entity
algorithm Data Object
attributes
Variables

Matrixes Algorithms
Evaluate matrixes – Matrix Data Set

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 30


Topics
• Algorithms
• Variables
• Functions
• Steps
• Data Sets
• Step Actions
• Tests
• Demo
• Managing Algorithm Versions
• Troubleshooting Tips
• Best Practices
• Q&A

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 31


Troubleshooting Tips
Review the error/exception closely.
I
JBO-29000: Unexpected exception caught: oracle.apps.scm.pricing.priceExecution.algorithms.publicQuery.exception.SetQueryException, msg=Failed to execute onEach Closure.
Alias 'Charge1' cannot be found on this Row

# Algorithm Call Stack


1. The groovy statement causing the error
-----------------------
createChargeComponent(Charge1, ChargeComponent, 'LIST_PRICE', 'QP_LIST_PRICE')
at Step 'Get List Price' 2. Statement, Step and Algorithm where the error occurs
at Algorithm: 'Simple Pricing Process Custom-1'

# Algorithm Variable Stack


---------------------------
Algorithm: 'Simple Pricing Process Custom-1' payload:
VariableName:'PriceRequest' DateType:'commonj.sdo.DataObject' IOType:'InOut' value:'<?xml version="1.0" encoding="UTF-8"?>
<SimplePriceRequest:SimplePriceRequestType xmlns:SimplePriceRequest="http://xmlns.oracle.com/apps/scm/pricing/priceExecution/serviceMappings/publicMappings/SimplePriceRequestType"
xmlns:ns0="http://xmlns.oracle.com/adf/svc/types/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SimplePriceRequest:SimplePriceRequestType">
<SimplePriceRequest:PricingServiceParameter>
<SimplePriceRequest:PricingContext>SALES</SimplePriceRequest:PricingContext>
</SimplePriceRequest:PricingServiceParameter>
<SimplePriceRequest:Header>
<SimplePriceRequest:CalculatePricingChargesFlag>true</SimplePriceRequest:CalculatePricingChargesFlag>
3. The variable values at the time of error.
<SimplePriceRequest:CalculateShippingChargesFlag>false</SimplePriceRequest:CalculateShippingChargesFlag>
<SimplePriceRequest:CalculateTaxFlag>false</SimplePriceRequest:CalculateTaxFlag>
One of the variables is the PriceRequest DataObject.
<SimplePriceRequest:CustomerId>1000</SimplePriceRequest:CustomerId>
<SimplePriceRequest:HeaderId>1</SimplePriceRequest:HeaderId>
<SimplePriceRequest:SellingBusinessUnitId>204</SimplePriceRequest:SellingBusinessUnitId>
<SimplePriceRequest:SellingLegalEntityId>204</SimplePriceRequest:SellingLegalEntityId>
<SimplePriceRequest:TransactionTypeCode>ORA_SALES_ORDER</SimplePriceRequest:TransactionTypeCode>
</SimplePriceRequest:Header>
<SimplePriceRequest:Line>
<SimplePriceRequest:HeaderId>1</SimplePriceRequest:HeaderId>
<SimplePriceRequest:InventoryItemId>101</SimplePriceRequest:InventoryItemId>
<SimplePriceRequest:InventoryOrganizationId>204</SimplePriceRequest:InventoryOrganizationId>
<SimplePriceRequest:LineCategoryCode>ORDER</SimplePriceRequest:LineCategoryCode>
<SimplePriceRequest:LineId>1</SimplePriceRequest:LineId>
<SimplePriceRequest:LineQuantity unitCode="Ea" xmlns:tns="http://xmlns.oracle.com/adf/svc/errors/">2</SimplePriceRequest:LineQuantity>

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 32


Where to find additional information
• Groovy Reference
• Pricing Cloud Release Readiness Training
• Administering Pricing User Guide
• Pricing Cloud Documentation – Use Cases Section
• Pricing Overview
Introduction to Pricing Cloud
Pricing Segments and Strategies
Tips for Managing Your Algorithms Through An Update
Pricing Maintenance using ADFdi
Control Uptake of Algorithm
Price Execution Fundamentals
Matrixes Deep Dive
Service Mappings Deep Dive

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 33


Topics
• Algorithm Overview
• Demo
• Algorithm Components
• Variables
• Functions
• Steps
• Data Sets
• Step Actions
• Tests
• Demo
• Troubleshooting Tips
• Best Practices
• Q&A

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 34


Best Practices
1. Naming conventions - Use upper camel case
2. Description – Populate Descriptions on Custom Versions to indicate what is
the functionality behind the extensions
3. Comments – Use comments within the algorithm extensions
4. Save incrementally – Save the changes incrementally.
5. Create Test Cases
1. Note the test cases to be tested with each algorithm extension/version.
2. Please create backup of test cases. Test Cases on Version 0 and 1 may
get wiped out upon upgrades and Promote Actions.
6. When and error occurs, analyze the most recent changes that could have
cause the issue. Remember, the change could be in Service Mappings.

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 35


Topics
• Algorithm Overview
• Demo
• Algorithm Components
• Variables
• Functions
• Steps
• Data Sets
• Step Actions
• Test Cases
• Troubleshooting Tips
• Best Practices
• Q&A

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 36


Q&A

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 37


Confidential – Oracle Internal/Restricted/Highly Restricted
38

Safe Harbor Statement


The preceding is intended to outline our general product direction. It is intended
for information purposes only, and may not be incorporated into any contract. It is
not a commitment to deliver any material, code, or functionality, and should not be
relied upon in making purchasing decisions. The development, release, and timing
of any features or functionality described for Oracle’s products remains at the sole
discretion of Oracle.

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 - 38

You might also like