16 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 USDs.

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.