Key Concepts and Relationships

This topic sets out the Events and Notifications framework and introduces the main configuration objects and their role:

Relationship Diagram

The following diagram shows the key concepts and their relationships in the Events and Notifications framework:

You can exploit this framework to quickly set up Notifications based on system Events. The following sections explain the role of the essential configuration components and how they are designed to work together.

Events and Event Types - Key Points

Here are some key points to note regarding Events and Event Types:

  • Events are tokens of Event Types. Any Notifications you set up act on actual Events.

  • Events are system generated. For example, when a new Prepayment/Commitment is created for an Account.

  • Events Types are available for main configuration and billing entities. For each entity three Event Types are available - when the entity is created, updated, or deleted.

  • Each Event Type offers a number of fields. This gives you wide-ranging flexibility when you set up the conditions on which a Notification will be triggered by the Event.

  • Real-time processing. Events are evaluated in real-time.

  • Evolving schemas. The Events system doesn’t statically hold schemas, they are dynamically updated assuming forward compatibility is kept.

Types of Events

Events fall into several broad categories:

Configuration Entity Events

Event Types are available for each of the following m3ter configuration entities. Three events are associated with each entity - whenever one of them is created, deleted, or updated:

  • Commitment

  • Account

  • Aggregation

  • Compound Aggregation

  • Meter

  • Meter Group

  • Plan Template

  • Plan

  • Plan Group

  • Plan Group Link

  • Pricing

  • Pricing Band

  • Product

  • Account Plan

  • Organization

  • Organization Configuration

  • Custom Field

  • Contract

  • Credit Reason

  • Transaction Type

Billing Entity Events

Event Types are available for each of the following m3ter billing entities. Three events are associated with each entity - whenever one of them is created, deleted, or updated:

  • Bill

  • Bill Config

  • Bill Job

  • Balance

  • Balance Amount

  • Statement Job

Integration Error Events

Event Types are available for certain kinds of error that can occur for an integration:

  • validation

  • authentication

  • perform

  • missing account mapping

  • disabled

Tip: Reviewing Integration Error Events? When any of these types of integration error Events are generated, they are listed on the Integrations>Integration Events page. For more details, see Reviewing and Resolving Integration Events.

Ingest Failure Events

A usage data ingest failure Event Type is available for when a usage measurement you submit to the m3ter platform fails to ingest properly:

  • ingest validation

Tip: Reviewing Ingest Failure Events? When this type of ingest failure Event is generated, it is listed on the Usage>Ingest Events page. For more details, see Reviewing and Resolving Ingest Events.

Scheduled Events

Scheduled Events are custom Events that reference Date/Time fields belonging to configuration and billing entities. They are specific to an Organization. See Working with Scheduled Events for more details.

Notification Rule

A Notification Rule allows you to control when a Notification is triggered with reference to an Event. You can:

  • Include a calculation that references Event fields. This allows you to precisely define the conditions on which the Notification is triggered with respect to the Event. For example, send a Notification when a new Commitment is created for an Account and the commitment amount is equal to or greater than $5000. See the following Creating Calculations section for more details.

  • Select to always fire the Notification, and omit any calculation. This means the Notification will be triggered simply by the referenced Event occurring and with no further conditions having to be met.

When you have created a Notification Rule, you can link it to an integration Destination to complete the Notification setup. This creates a Notification Integration Configuration - see the following section.

Integration Destination and Credentials

To complete a Notification setup, you must link a Notification Rule to an integration Destination. This allows you to specify the endpoint the Notification will be sent to:

  • Currently, only webhooks can be designated as the Destination. Other Destination types are planned for the near future.

  • You can specify credentials to be used with the destination:

    • Currently, only the M3TER_SIGNED_REQUEST credential format is supported.

    • If the Destination does not require credentials, these can be set to some dummy value.

  • When you link a Destination to a Notification Rule, this creates a Notification Integration Configuration, which will be listed on the Integration Configurations page in the Console.

Tip: More Details on Integration Destinations? See Creating and Managing Destinations.

Creating Calculations

The calculations you use in your Notification Configuration can reference Event fields. This powerful capability sits at the heart of the Events and Notifications feature, giving you wide-ranging flexibility to define the precise conditions for sending Notifications:

  • A calculation is a formula that will be evaluated to a boolean.

  • If the calculation evaluates to true, a Notification instance for this Event is created and is sent to the configured destination.

  • You can reference numeric, string, and boolean Event fields in a calculation.

  • The fields you can use in a calculation are those returned in the response to the List Events API call:

  • The syntax and available operators for creating calculations are the same as those that apply to Meter Derived Field calculations in m3ter. The key difference is that Notification calculations evaluate to a boolean, not to a string or number. For more details see Derived Fields - Examples and Syntax.

  • Note that in addition to the operators, variables, and functions listed as available for Derived Field calculation, for Notification calculations you can also use:

    • Operators

      • Logical AND

      • Logical OR

      • Boolean comparisons

        • ==

        • >=

        • <=

    • Variables

      • null

    • Functions

      • isnull()

Example Calculations

  • Only trigger the Notification for a single Account:

    • new.accountId == "df41d216-XXXX-470f-YYYY-79b16059a96f"

  • Trigger a Notification when the Amount Spent field (on a commitment) has exceeded 90%:

    • (new.amountSpent >= ((new.amount*100)/90)) AND ((old.amountSpent <= ((old.amount*100)/90)) OR (old.amountSpent == null))

    • Note that this has a check against the “old” value to ensure there is only 1 notification when crossing the 90% threshold.

Events Permissions

You can use the m3ter Permissions framework to create Permission Policies to allow users in your Organization to create, retrieve, update, or delete Events. Permissions for Events work in the normal way:

  • If a user has a deny Event Permission Policy assigned to them, they will not be able to see Events.

  • If a user has a deny Permission Policy for another entity assigned to them, for example deny Product, they will not be able to see Events associated with Products.

See Understanding, Creating, and Managing Permission Policies for more details.

Next: Object Definitions and API Calls

Additional Support

Login to the Support portal for additional help and to send questions to our Support team.