17 Managing Rounding and Consumption Rules

You can configure how Oracle Communications Elastic Charging Engine (ECE) rounds balance impacts and the order in which it consumes sub-balances.

Topics in this document:

Configuring Rounding for a Resource

By default, ECE uses the rounding rules configured in Pricing Design Center (PDC) for a currency or noncurrency resource to round the balance impact amount for processing stages like charging, discounting, and taxation. These rules can be different for each processing stage. For information on configuring the rounding rules, see "Adding Rounding Rules for Specific Events" in PDC Online Help.

However, you can configure system-wide rounding in ECE for currency and noncurrency resources to apply the rule across all processing stages.

Example of Currency Rounding for a Charge

If you allow two digits to the right of the decimal point and you round down towards zero (DOWN rounding mode), ECE takes a calculated charge of 0.509 USD and rounds it to 0.50 USD.

Example of Noncurrency Rounding for a Charge

If you allow zero digits to the right of the decimal point and you round towards positive infinity (UP rounding mode), ECE takes a charge of 0.509 bonus point and rounds the value to 1 bonus point.

Examples of Currency Rounding for Discounts

If you allow zero digits to the right of the decimal point and you round down towards zero (DOWN rounding mode), ECE takes a discount of -2.5 USD and rounds the value to -2 USD.

If you allow zero digits to the right of the decimal point and you round towards negative infinity (FLOOR rounding mode), ECE takes a discount of -2.5 USD and rounds the value to -3 USD.

If you allow two digits to the right of the decimal point and you round down towards zero (DOWN rounding mode), ECE takes a discount of -0.075 USD and rounds the value to -0.07 USD.

To configure rounding for a resource:

  1. Access the ECE configuration MBeans in a JMX editor, such as JConsole. See "Accessing ECE Configuration MBeans".

  2. Expand the ECE Configuration node.

  3. Expand charging.server.

  4. Expand Attributes.

  5. Specify values for the following currency and noncurrency resource attributes as appropriate:

    • currencyScale or nonCurrencyScale: Enter the number of digits you allow to the right of the decimal point for a calculated impact amount.

      For example, enter 2 if you allow two digits to the right of the decimal point.

      The default is 2.

    • currencyRoundingMode or nonCurrencyRoundingMode: Enter the rounding mode that determines the rounding behavior by entering the string representation of the Java math rounding enum.

      For more information, see the Java SE technical documentation website:

      https://docs.oracle.com/javase/8/docs/api/java/math/RoundingMode.html

      For example, enter UP to round up away from zero or DOWN to round down towards zero.

      The default value is HALF_UP.

Configuring Rounding for Reverse Rating on Multiple RUMs

When ECE performs the reverse rating service in which events are rated by using multiple RUMs, fractional values may result for the authorized resource. You can configure a systemwide rounding rule to round up the fractional value of the authorized resource.

Rounding up the authorized resource quantity may result in customers exceeding their credit limits. Configure this only if your business requires that your customers must be able to use all of their balances.

To configure whether to round up the fractional value of the authorized resource quantity by authorizing an additional RUM unit:

  1. Access the ECE configuration MBeans in a JMX editor, such as JConsole. See "Accessing ECE Configuration MBeans".

  2. Expand the ECE Configuration node.

  3. Expand charging.server.

  4. Expand Attributes.

  5. Set the reverseRateUseAllBalances attribute to one of the following values:

    • To round up the fractional value of the authorized balance quantity, enter true.

      This option allows customers to use all balances even if they might exceed their credit limits by a small amount.

    • To disallow the fractional value of the authorized balance quantity to be rounded up, enter false.

      This option does not allow customers to exceed their credit limits.

    The default is false.

Configuring Systemwide Consumption Rules for Balances

When more than one validity-based sub-balance is available for a usage request, consumption rules determine from which balance bucket ECE is to consume first. For example, if a customer has several groups of free minutes that expire at different times, you use consumption rules to indicate which minutes to use first, based on the validity period start time and end time. Consumption rules are typically configured at the balance element level when you define pricing in the pricing application such as PDC. Consumption rules can also be configured at the customer balance level by the customer and subscription management components of the BRM system. For information about:

When ECE receives a usage request for which no consumption rules are configured, ECE applies its own systemwide consumption rules for processing the usage request.

To configure ECE systemwide consumption rules:

  1. Access the ECE configuration MBeans in a JMX editor, such as JConsole. See "Accessing ECE Configuration MBeans".

  2. Expand the ECE Configuration node.

  3. Expand charging.server.

  4. Expand Attributes.

  5. Set the systemConsumptionRule attribute to one of the following systemwide consumption rules:

    • EARLIEST_START

    • LATEST_START

    • EARLIEST_EXPIRATION

    • LATEST_EXPIRATION

    • EARLIEST_START_LATEST_EXPIRATION

    • EARLIEST_START_EARLIEST_EXPIRATION

    • LATEST_START_LATEST_EXPIRATION

    • LATEST_START_EARLIEST_EXPIRATION

    • EARLIEST_EXPIRATION_EARLIEST_START

    • EARLIEST_EXPIRATION_LATEST_START

    • LATEST_EXPIRATION_EARLIEST_START

    • LATEST_EXPIRATION_LATEST_START

    • NONE: When the attribute is set to NONE, the default consumption rule is not configured, and the order for consuming balances is undefined.

    By default, this attribute is set to EARLIEST_START_EARLIEST_EXPIRATION.

Configuring the Consumption Order for Offers with the Same Priority (Release 15.0.1 or later)

ECE consumes allowances from offers based on their configured priority, from the highest priority to the lowest priority. If multiple offers have the same priority, ECE determines which offer to consume allowances from first based on the value of the offerSelectionModeOnEquiPriorityOffers entry in your charging-settings.xml file or your oc-cn-ece-helm-chart/values.yaml file:

  • START_TIME: ECE consumes the allowance from the offer with the earliest validity start date. This is the default.

  • END_TIME: ECE consumes the allowance from the offer with the earliest validity end date.

For example, assume a customer has purchased the following offers, which have the same priority:

  • Offer A grants 1 GB of data with a validity period from Jan 1 through Jan 30.

  • Offer B grants 200 MB of data with a validity period from Jan 10 through Jan 20.

On Jan 15, the customer downloads 100 MB of data. If the entry is set to START_TIME, ECE first consumes the data allowance from Offer A. If the entry is set to END_TIME, ECE first consumes the data allowance from Offer B.

During ECE runtime, you configure the consumption order as follows:

  1. Access the ECE configuration MBeans in a JMX editor, such as JConsole. See "Accessing ECE Configuration MBeans".

  2. Expand the ECE Configuration node.

  3. Expand charging.server.

  4. Expand Attributes.

  5. Select the offerSelectionModeOnEquiPriorityOffers attribute and set it to START_TIME or END_TIME.

Configuring Balance Impact Rounding in ECE

You can configure rounding for a currency and noncurrency balance impact by specifying rules for how Oracle Communications Elastic Charging Engine (ECE) rounds the rating impact amounts it calculates. The rules you specify are applied at the system level so the rounding of the rating impact amounts apply across all charges, discounts, and chargeshares. The rounding is also applied to reverse rating calculations and taxation calculations.

The rules you can specify for rounding are as follows:

  • Scale

    You can specify a rule for how many digits to the right of the decimal point to allow. The default scale is 2.

  • Rounding mode

    You can specify a rule for the rounding behavior according to the Java math rounding enum. The default is HALF_UP.

    See the Java SE API Reference documentation for information about using the Java math rounding enum.

For information about configuring rounding for currency and noncurrency balance impacts, see "Configuring Rounding for a Currency Balance Impact" and "Configuring Rounding for a Noncurrency Balance Impact".

Example of Currency Rounding for a Charge

If you allow two digits to the right of the decimal point and you round down towards zero (DOWN rounding mode), ECE takes a calculated charge of 0.509 USD and rounds it to 0.50 USD.

Example of Noncurrency Rounding for a Charge

If you allow zero digits to the right of the decimal point and you round towards positive infinity (UP rounding mode), ECE takes a charge of 0.509 bonus point and rounds the value to 1 bonus point.

Examples of Currency Rounding for Discounts

If you allow zero digits to the right of the decimal point and you round down towards zero (DOWN rounding mode), ECE takes a discount of -2.5 USD and rounds the value to -2 USD.

If you allow zero digits to the right of the decimal point and you round towards negative infinity (FLOOR rounding mode), ECE takes a discount of -2.5 USD and rounds the value to -3 USD.

If you allow two digits to the right of the decimal point and you round down towards zero (DOWN rounding mode), ECE takes a discount of -0.075 USD and rounds the value to -0.07 USD.

Configuring Rounding for a Currency Balance Impact

You can configure rounding for a currency balance impact by specifying rules for how ECE rounds the rating impact amounts it calculates.

The rules you specify are applied as a systemwide configuration for rounding the rating impact amounts of all charges, discounts and chargeshares. The rounding is also applied to all reverse rating calculations and taxation calculations.

See "Configuring Rounding for a Noncurrency Balance Impact" for information about configuring rounding for noncurrency balance impacts.

To configure rounding for a currency balance impact:

  1. Access the ECE configuration MBeans in a JMX editor, such as JConsole. See "Accessing ECE Configuration MBeans".

  2. Expand the ECE Configuration node.

  3. Expand charging.server.

  4. Expand Attributes.

  5. Specify values for the following attributes:

    • currencyScale: Enter the number of digits you allow to the right of the decimal point for a calculated impact amount.

      For example, enter 2 if you allow two digits to the right of the decimal point.

      The default is 2.

    • currencyRoundingMode: Enter the rounding mode that determines the rounding behavior by entering the string representation of the Java math rounding enum.

      See the Java SE API Reference documentation for information about using the Java math rounding enum.

      For example, enter UP to round up away from zero or DOWN to round down towards zero.

      The default is HALF_UP.

  6. Save your changes.

Configuring Rounding for a Noncurrency Balance Impact

You can configure rounding for a noncurrency balance impact. The rules you specify are applied as a systemwide setting and apply for rounding the rating impact amounts of all charges, discounts, and chargeshares. The rounding is also applied to all reverse rating calculations and taxation calculations.

To configure rounding for a noncurrency balance impact:

  1. Access the ECE configuration MBeans in a JMX editor, such as JConsole. See "Accessing ECE Configuration MBeans".

  2. Expand the ECE Configuration node.

  3. Expand charging.server.

  4. Expand Attributes.

  5. Specify values for the following attributes:

    • nonCurrencyScale: Enter the number of digits you allow to the right of the decimal point for a calculated impact amount.

      For example, enter 2 if you allow two digits to the right of the decimal point.

      The default is 2.

    • nonCurrencyRoundingMode: Enter the rounding mode that determines the rounding behavior by entering the string representation of the Java math rounding enum.

      See the Java SE API Reference documentation for information about using the Java math rounding enum.

      For example, enter UP to round up away from zero or DOWN to round down towards zero.

      The default is HALF_UP.

  6. Save your changes.

For information about configuring rounding for currency balance impacts, see "Configuring Rounding for a Currency Balance Impact".

Configuring Rounding When Authorizing Multiple RUMs

When ECE receives an online charging request for a specified amount of usage, ECE uses the customers product offerings to determine if the customer's balance amount is sufficient for the requested amount. If the request applies to multiple RUMs; for example, occurrence and duration, fractional values of the authorized balance quantity might result. You can enable ECE to round up the authorized balance quantities to the nearest whole number.

If your business requires that your customers must be able to use all of their balances, configure ECE to round up the authorized balance quantity. However, rounding up the authorized balance quantity may result in customers exceeding their credit limits.

You configure whether to round up the fractional value of the impacted balance quantity as a systemwide setting. ECE authorizes an additional RUM unit when the quantity is a fraction.

To configure rounding when authorizing multiple RUMs:

  1. Access the ECE configuration MBeans in a JMX editor, such as JConsole.

  2. Expand the ECE Configuration node.

  3. Expand charging.server.

  4. Expand Attributes.

  5. Set the reverseRateUseAllBalances attribute to one of the following values:

    • To round up the fractional value of the authorized balance quantity, enter true.

      This option allows customers to use all balances even if they might exceed their credit limits by a small amount.

    • To disallow the fractional value of the authorized balance quantity to be rounded up, enter false.

      This option does not allow customers to exceed their credit limits.

    The default is false.

  6. Save your changes.

Note:

When discounting custom events, you may encounter the following ECE exception:
RatingMessageBundle-6000: The rate plan failed to evaluate. The cause is probably due to a misconfiguration in the rate plan graph.

This may occur because the discount offer contains two rating periods of different RUMs and RUM units, and the total quantity cannot be calculated across them. In this scenario, ensure that you have a configuration to filter out the RUM and pass in the rating periods of the same RUM into the trigger. To discount both RUMs, use the filter to create separate configurations for each RUM.