My Oracle Support Banner

Inccorrect Range StepQuantity For Cascading Discount When No Impact On Currency Balance Is Defined (Doc ID 2130904.1)

Last updated on AUGUST 20, 2018

Applies to:

Oracle Communications BRM - Elastic Charging Engine - Version 11.2.0.6.0 to 11.2.0.7.0 [Release 11.2.0]
Information in this document applies to any platform.

Goal

Scenario :

When there is a second discount rule in cascading mode, with 2 or more ranges, it looks like the the StepQuantity in second range (also the next ones) is not being evaluated correctly to discount only the remaining balance.

Business requirement :

* For an usage, need to debit a bucket1 balance until the available quantity of this balance, and then impact a second counter with the remaining quantity.
* So there is a discount offer, in CASCADING mode (Remaining charge and quantity), with 2 rules:
-- Rule 1 : while balance[Bucket1] < 0 => from 0 to Balance[Bucket1] => debit the balance Bucket1 with 100% of StepQuantity
-- Rule 2 : while balance[Bucket1] = 0 => from 0 to Infinite => impact a noncurrency balance COUNTER with 100% of StepQuantity.

Steps to reproduce :

  1. Pricing Setup :

    charge offer 1 = TelcoGsmTelephony, MCF , 1000 Free Seconds (resource ID = YES) , CREDIT

    charge offer 2 = TelcoGsmTelephony, EventDelayedSessionTelcoGsm , 2 $ per second, DEBIT

    discount offer : EventDelayedSessionTelcoGsm

    rule 1:

    Trigger : Free Seconds Less Than Zero
    Apply this discount to Remaining Charge and Quantity
    To select quantity ranges, evaluate Quantity and Distribute value across applicable quantity ranges
    Quantity Range 0 - Balance[Free Seconds]
    Debit , Free seconds , 100% of StepQuantity.

    rule 2:

    Trigger : FreeSecondsEqualToZero
    Apply this discount to Remaining Charge and Quantity
    To select quantity ranges, evaluate Quantity and Distribute value across applicable quantity ranges
    Quantity Range 0 - No maximum
    Increase , Loyalty Points (this is a counter resource, id = PTS), 100% , StepQuantity

  2. Create account with above pricing elements
  3. Initial balance :

    CohQL> select value() from Balance where ownerId='538095';
    Results

    ####################### Balance Begin #######################
    [BalanceImpl
    BalanceId = 538655}
    externalRevision = 0}
    OwnerId = 538095}
    BillingUnitId = 539631}
    BillingUnit = null}
    balanceItemSpecs ={YES=BalanceItemSpecImpl{beCode='YES', unit=Occ,
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=0, id='2', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=2},
    USD=BalanceItemSpecImpl{beCode='USD', unit=Money{cur=USD},
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=9223372036854775807, id='0', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=0}}}
    ActiveReservationMap ={}}
    BalanceItems =
    ([BalanceItemImpl balanceItemId = 2} , currentBalance = -1000.0} ,
    balanceItemSpec = BalanceItemSpecImpl{beCode='YES', unit=Occ,
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=0, id='2', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=2} ,
    validity = [2015-12-13T00:00:00.000-08:00,2016-01-13T00:00:00.000-08:00]} ,
    validityRule = null} , firstUsageCreatedTime = null} , granter = null}]),]}
    ####################### Balance End #######################

     
  4. rate usage with just 100 seconds duration using below command:

    sh sample_generic_session.sh run 0049100086 TERMINATE 100 TelcoGsmTelephony
    EventDelayedSessionTelcoGsm 1.0 2015-12-13T00:00:00.000-08:01 1 14085553434
    CUMULATIVE

  5. check balance :
    CohQL> select value() from Balance where ownerId='538095';
    Results

    ####################### Balance Begin #######################
    [BalanceImpl
    BalanceId = 538655}
    externalRevision = 0}
    OwnerId = 538095}
    BillingUnitId = 539631}
    BillingUnit = null}
    balanceItemSpecs ={YES=BalanceItemSpecImpl{beCode='YES', unit=Occ,
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=0, id='2', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=2},
    USD=BalanceItemSpecImpl{beCode='USD', unit=Money{cur=USD},
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=9223372036854775807, id='0', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=1}}}
    ActiveReservationMap ={}}
    BalanceItems =
    ([BalanceItemImpl balanceItemId = 2} , currentBalance = -900.00} ,
    balanceItemSpec = BalanceItemSpecImpl{beCode='YES', unit=Occ,
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=0, id='2', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=2} ,
    validity = [2015-12-13T00:00:00.000-08:00,2016-01-13T00:00:00.000-08:00]} ,
    validityRule = null} , firstUsageCreatedTime = null} , granter = null}]),
    ([BalanceItemImpl balanceItemId = 1} , currentBalance = 200.00} ,
    balanceItemSpec = BalanceItemSpecImpl{beCode='USD', unit=Money{cur=USD},
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=9223372036854775807, id='0', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=1} ,
    validity =
    [2015-12-13T00:01:00.000-08:00,292278994-08-17T00:12:55.806-07:00]} ,
    validityRule = null} , firstUsageCreatedTime = null} , granter = null}]),]}
    ####################### Balance End #######################


    This is ok, wherein, USD is impacted by 200 $ , and Free Seconds is reduced by 100 Seconds and resulting balance is 900 seconds. 

  6. rate another usage with 1000 seconds duration:

    sh sample_generic_session.sh run 0049100086 TERMINATE 1000 TelcoGsmTelephony
    EventDelayedSessionTelcoGsm 1.0 2015-12-13T00:00:00.000-08:01 1 14085553434
    CUMULATIVE

  7. check balances :

    ####################### Balance Begin #######################
    [BalanceImpl
    BalanceId = 538655}
    externalRevision = 0}
    OwnerId = 538095}
    BillingUnitId = 539631}
    BillingUnit = null}
    balanceItemSpecs ={YES=BalanceItemSpecImpl{beCode='YES', unit=Occ,
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=0, id='2', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=2},
    USD=BalanceItemSpecImpl{beCode='USD', unit=Money{cur=USD},
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=9223372036854775807, id='0', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=1},
    PTS=BalanceItemSpecImpl{beCode='PTS', unit=Occ,
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=0, id='2', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=1}}}
    ActiveReservationMap ={}}
    BalanceItems =
    ([BalanceItemImpl balanceItemId = 2} , currentBalance = 0.00} ,
    balanceItemSpec = BalanceItemSpecImpl{beCode='YES', unit=Occ,
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=0, id='2', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=2} ,
    validity = [2015-12-13T00:00:00.000-08:00,2016-01-13T00:00:00.000-08:00]} ,
    validityRule = null} , firstUsageCreatedTime = null} , granter = null}]),
    ([BalanceItemImpl balanceItemId = 1} , currentBalance = 2200.00} ,
    balanceItemSpec = BalanceItemSpecImpl{beCode='USD', unit=Money{cur=USD},
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=9223372036854775807, id='0', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=1} ,
    validity =
    [2015-12-13T00:01:00.000-08:00,292278994-08-17T00:12:55.806-07:00]} ,
    validityRule = null} , firstUsageCreatedTime = null} , granter = null}]),
    ([BalanceItemImpl balanceItemId = 1} , currentBalance = 1000.00} ,
    balanceItemSpec = BalanceItemSpecImpl{beCode='PTS', unit=Occ,
    creditProfile=CreditProfile{creditFloor=-9223372036854775808,
    creditCeiling=0, id='2', percentageCreditThresholds=[],
    fixedCreditThresholds=[]}, consumptionRule=NONE, lastBalanceItemIndex=1} ,
    validity =
    [2015-12-13T00:01:00.000-08:00,292278994-08-17T00:12:55.806-07:00]} ,
    validityRule = null} , firstUsageCreatedTime = null} , granter = null}]),]}
    ####################### Balance End #######################
     
  8. the above balances seem wrong :

    Expected : when 1000 seconds are rated, 900 are evaluated under Rule 1 , and expected that remaining 100 seconds are evaluated under Rule 2, increasing counter to 100. As per cascading rule.

    Actual : when 1000 seconds are rated, 900 are evaluated under Rule 1 , and actually the whole 1000 seconds are again evaluated under Rule 2, increasing counter to 1000

 

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
References


This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.
My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.