価格設定アルゴリズムのソース・コードの検証
ソースの表示をクリックして、価格設定アルゴリズムのソース・コードを確認できます。
-
価格設定管理作業領域に移動し、「タスク」>「アルゴリズムの管理」をクリックします。
-
「アルゴリズムの管理」ページで、変更する必要があるアルゴリズムを特定します。
-
「処理」>「バージョンの作成」をクリックします。
-
要件を満たすように価格設定アルゴリズムを変更します。
-
「アルゴリズムの編集」ページの上部にある「ソースを表示」をクリックし、表示されるダイアログにこのメッセージが含まれていることを確認します。
The following script has passed syntax check
たとえば:
ノート
-
ソースの表示では、構文を検査および検証します。 次に、ダイアログにアルゴリズムを定義するGroovyコードが表示されます。
-
価格設定アルゴリズムを公開する前に使用します。
-
また、このアルゴリズムを使用して、アルゴリズムの設定方法を全体的に把握したり、アルゴリズムのバージョン間のトラブルシューティングを行うこともできます。
-
たとえば、作業中バージョンのソース・コードと非稼働バージョンのソース・コードをコピーし、それをコード比較アプリケーションに貼り付けてから、問題の原因となっている可能性のあるコードの識別に役立つ差異を調べます。
ソースの表示をクリックすると表示される詳細の種類を含むコードを次に示します。
//=====================================================================
// Price Sales Transactions
// Version: 2
// Start: 2016-12-07 22:47:02.528
// End:
// Description: Calculates prices for Sales documents (Quotes, Sales Agreements, Orders).
// Version 2 Comments: Calculates prices for Sales documents (Quotes, Sales Agreements, Orders).
//=====================================================================
variables {
PriceRequest(ioType:'InOut', type:'DataObject', required:true, context:'PricingInternal.PriceRequestInternal')
PerformCurrencyConversion(ioType:'None', type:'Boolean', required:false, defaultValue:false)
IsNonGsaCustomer(ioType:'None', type:'Boolean', required:false, defaultValue:true)
CalculateGSAPrice(ioType:'None', type:'Boolean', required:false, defaultValue:false)
PassedInEntities(ioType:'None', type:'DataObject', required:false, context:'PricingInternal.PriceRequestInternal')
}
// Step "Set Initial Values" - block
step('Set Initial Values'){
// Step "Initialize" - SubAlgorithm
step('Initialize'){
subAlgorithm(name:'Set Initial Values')
.input ('EnableCache':false,'PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
}
// Step "Process and Split Passed In Charges" - if
step('Process and Split Passed In Charges', if:{PriceRequest.Charge.size() > 0}){
// Step "Process Passed In Charges and Charge Components" - SubAlgorithm
step('Process Passed In Charges and Charge Components'){
subAlgorithm(name:'Process Passed In Charges')
.input ('PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
// Step "Split Passed In Charge Components" - Split
// Moves all the passed-in charge components that have been retained after processing to a separate SDO.
step('Split Passed In Charge Components'){
splitDocument().from(PriceRequest.ChargeComponent).as('Comp').to(PassedInEntities.ChargeComponent).where{true}
}
// Step "Split Passed In Charges" - Split
// Moves all the passed-in charges that have been retained after processing to a separate SDO.
step('Split Passed In Charges'){
splitDocument().from(PriceRequest.Charge).as('Charge').to(PassedInEntities.Charge).where{true}
}
}
// Step "Derive and Validate Strategy" - block
step('Derive and Validate Strategy'){
// Step "Derive Pricing Strategy" - SubAlgorithm
step('Derive Pricing Strategy'){
subAlgorithm(name:'Get Sales Pricing Strategy')
.input ('InvokeFromPriceSalesTransactions':true,'PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
// Step "Validate Pricing Strategy" - SubAlgorithm
step('Validate Pricing Strategy'){
subAlgorithm(name:'Validate Pricing Strategy')
.input ('PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
}
// Step "Validate Passed Pricing Terms" - block
step('Validate Passed Pricing Terms'){
// Step "Validate Pricing Terms" - SubAlgorithm
step('Validate Pricing Terms'){
subAlgorithm(name:'Validate Pricing Terms')
.input ('PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
}
// Step "Validate Override Currencies" - block
step('Validate Override Currencies'){
// Step "Validate Override Currency" - SubAlgorithm
// Invoke the sub-algorithm 'Validate Override Currencies'
step('Validate Override Currency'){
subAlgorithm(name:'Validate Override Currencies')
.input ('PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
}
// Step "Get Charge Candidates For Coverages Goods and Services" - block
step('Get Charge Candidates For Coverages Goods and Services'){
// Step "Get Price List and Charge Candidates" - SubAlgorithm
step('Get Price List and Charge Candidates'){
subAlgorithm(name:'Get Base List Price for Goods and Services')
.input ('CreateChargesFlag':false,'DerivePriceListFlag':true,'ElementParam':'QP_BASE_LIST_PRICE','GetChargeCandidatesFlag':true,'PriceRequest':PriceRequest)
.output ('PerformCurrencyConversion':'PerformCurrencyConversion','PriceRequest':'PriceRequest')
.run()
}
}
// Step "Calculate Pricing Charges For Covered Items" - block
// This step invokes the algorithm to calculate pricing charges for covered items to derive the percentage-based coverage prices.
step('Calculate Pricing Charges For Covered Items'){
// Step "If CoverageAssociations Exist" - if
// Calculate Covered Item Prices if there are CoverageAssociations
step('If CoverageAssociations Exist', if:{PriceRequest.CoverageAssociation.size() > 0}){
// Step "Calculate Covered Item Charges" - SubAlgorithm
step('Calculate Covered Item Charges'){
subAlgorithm(name:'Calculate Covered Item Charges')
.input ('PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
}
}
// Step "Calculate Pricing Charges For Coverages Goods and Services" - block
// Call Calculate Pricing Charges where in Get Base
// skip Derive PL and Get Charge Candidates, only Create Charges, but process rest of the ListPrice thru Margin Calculations
step('Calculate Pricing Charges For Coverages Goods and Services'){
// Step "Calculate Pricing Charges" - SubAlgorithm
// This step invokes the algorithm to calculate pricing charges.
step('Calculate Pricing Charges'){
subAlgorithm(name:'Calculate Pricing Charges')
.input ('CreateChargesFlag':true,'DerivePriceListFlag':false,'GetChargeCandidatesFlag':false,'PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
}
// Step "Merge If Charges Passed In" - if
step('Merge If Charges Passed In', if:{PassedInEntities.Charge.size() > 0 && finer('Merging back passed-in charges and charge components') == null}){
// Step "Merge Back Passed In Charges" - Merge
// Merges back the passed in Charge Components into Price Request SDO
step('Merge Back Passed In Charges'){
mergeDocument().from(PassedInEntities.Charge).to(PriceRequest.Charge)
}
// Step "Merge Back Passed In Charge Components" - Merge
// Merges back the passed in Charge Components into Price Request SDO
step('Merge Back Passed In Charge Components'){
mergeDocument().from(PassedInEntities.ChargeComponent).to(PriceRequest.ChargeComponent)
}
}
// Step "Calculate Shipping Charges For Goods and Services" - block
step('Calculate Shipping Charges For Goods and Services'){
// Step "Calculate Shipping Charges" - SubAlgorithm
// Call 'Calculate Shipping Charges' Algorithm
step('Calculate Shipping Charges'){
subAlgorithm(name:'Calculate Shipping Charges')
.input ('PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
}
// Step "Populate Charge Component Explanation Messages" - block
// This step populates explanation messages on charge components.
step('Populate Charge Component Explanation Messages'){
// Step "Populate Explanation Messages" - SubAlgorithm
// This step invokes the algorithm to populate explanation messages for charge components.
step('Populate Explanation Messages'){
subAlgorithm(name:'Populate Charge Component Explanation Message')
.input ('BaseListPriceElementCode':'QP_BASE_LIST_PRICE','PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
}
// Step "Process Returns" - block
step('Process Returns'){
// Step "Process Returns With Reference" - SubAlgorithm
// This step creates the refund charges for return lines.
step('Process Returns With Reference'){
subAlgorithm(name:'Process Returns with Reference')
.input ('PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
}
// Step "Set Final Values" - block
step('Set Final Values'){
// Step "Finalize" - SubAlgorithm
step('Finalize'){
subAlgorithm(name:'Set Final Values')
.input ('PriceRequest':PriceRequest)
.output ('PriceRequest':'PriceRequest')
.run()
}
}