Complex calculations for any business scenario are always prone to errors and inaccuracy. For instance, consider the complexity of billing scenarios such as telecom and energy bills, hospital bills for patients, doctors' and specialists' payment structures, and last but not least, SaaS consumption. What do we need to ensure in the billing models in decision management?

There are many ways to implement the billing calculation as part of automated processes and applications; however, they will become a blackbox and not scalable solutions. Particularly if they face changes and regular updates, the complications escalate. The better solution is to use an advanced decision management suite (DMS), which gives you the benefits of transparency, accuracy, and scalability of complex calculations.

Let’s take a look at the SaaS consumption plan as an example of a complex calculation and see how we can improve the transparency, accuracy, and scalability of SaaS provider billing.

A SaaS Provider Consumption Plan

In this example scenario, a SaaS company charges consumers based on their usage (consumption of an online service), and the provider breaks down the consumer usage in multiple tiers. Let’s assume the SaaS provider has the following tiers definition in their business model:

If the SaaS company were to provide the hours on monthly bases, this means the bill of the consumer should be considering breaking down their usages based on:

  • Number of all used units (from the very first use until the last hour including)
  • Number of units used this month (the last hour including)
  • Number of units used in the last hour

Transparent and Accurate Calculation Engine

To build the model for the example SaaS provider based on a consumption plan, there are two steps to it conceptually:

billing calculation engine

So let’s see how a Decision Graph can model both steps.

To “Calculate the Usages Breakdown”, we simply create a decision graph that explains the decisions and sub-decisions of the breakdown:

billing model

In the above model, the rules of each tire are modeled in a Decision Table similar to the one below:

decision table

As for the second step, to “Apply Tiering Price” we will have another decision graph that references the “Calculate the Usages Breakdown” decision graph as a sub graph (light below rectangle):

billing model in decision management

As you can see in the above model, making and reusing sub graph as part of a larger decision graph makes the models far easier to maintain, understand and explain.

Transparency and Quality of Billing Models in Decision Management

One of the significant benefits of using an advanced decision management suite (DMS) to model such complex scenarios is to ensure transparency.


Transparency has two parts to it. (a) explainability, meaning the consumer will get full visibility on all the components calculation, and (b) auditability that ensures the provide can comply with any regulatory bodies and law.

As part of each execution, you can collect all the related execution log that explains what decisions and rules are executed at what steps exactly:

decision and business rules events

Quality Assurance

Lastly, the quality of decisions can be guaranteed by simply executing a set of data to create the actual outcome and compare the result against the expectation. You can define a sample test data in Excel, CSV, or any other sources and spreadsheets:

usage testing data

Then you can import the test data set to generate all the relevant test cases. Once the test cases are defined by loading them into the authoring platform, they execute automatically as part of your CI/CD pipeline or manually as you need:

test case usage

Book a Custom Demo

First or last name is too short

The Advanced Decision Management Suite Simplifies Complex Billing

As we discussed here, billing is a complex process; as innocent as they look, there are too many expectations from the process. Explainability, Accuracy, Auditability, and on top of these, ensuring everyone understands exactly how the bill is calculated in your product management, accounts department, or any other stakeholders. Surely not all of the stakeholders understand the how behind the calculation if you were to code or program the billing calculation into an application. But with a simple visual modeling technique using Decision Graph and a tabular form to model business rules, everyone understands, and will become easy to communicate how the bills are calculated to ensure everyone is on the same page.

To explore more about this project, visit FlexRule Resource Hub.

Last updated May 2nd, 2023 at 12:57 pm, Published July 29th, 2022 at 12:57 pm