For billing purposes, you can lift along on the Customer Service infrastructure, which is similar to functionality offered by AWS or Apple for this purpose in their eco system. The "table" which stores the billing events like a Call Detail Record of a PBX is managed by Customer Service infrastructure.
There are two options:
- Your apps use the default audit and license event registrations like "User logged on", "First use of partition #xyz", etc. each with a specific message code like 'itgenlic125'.
- Your apps define their own event types like "Performed an upload of bank transactions", with a message code 'mybillingmessagecode123' and the number '8' as quantity in the natural key.
The first option is automatically and always done. These data is also used to manage resource consumption and detect runaways.
The second option is best done using Invantive SQL with the data dictionary table "auditevents". All records inserted into auditevents are automatically asynchronously forwarded to Customer Service. To see the current register audit events since start of application:
select *
from auditevents@datadictionary
where:
- occurrence_date: when it happened.
- logging_level: always "Audit".
- message_code: code identifying the type of event.
- data_container_d: ID of the data container, used with distributed SQL transactions.
- partition: partition within the data container for platforms such as Exact Online or Microsoft SQL Server which store multiple databases under one customer/instance.
- session_id: ID of the session.
- user_message: actual text.
- last_nk: last used natural key
- application_name: name of the appplication.
- application_user: user as known to the application.
- gui_action: action within the GUI.
- And some auditing and licensing information fields.
To register a custom event:
insert into auditevents@datadictionary select * from auditevents@datadictionary
Only some fields can be provided; the rest are automatically determined:
- message_code
- user_message
- last_natural_key
- application_name
- application_user
- gui_action
- gui_module
- partition
- provider_name
- reference_key
- reference_table_code
- session_id
To receive the billing events yourself from the infrastructure, you will need to access the Customer Service APIs or have them automatically forwarded to mail, Slack, RocketChat or Mattermost channel.
A sample SQL:
insert into auditevents@datadictionary
( message_code
, user_message
, last_natural_key
, application_name
, gui_action
, gui_module
, reference_key
, reference_table_code
, partition
)
select 'xxmycode001' message_code
, 'Processed PayPal payments in Exact Online for ' || divisionlabel user_message
, 'today' last_natural_key
, 'PayPalProcessor' application_name
, 'xx-my-paypal-processor-step-2' gui_action
, 'xx-my-payal-processor' gui_module
, clr_id reference_key
, 'clr' reference_table_code
, division partition
from settings@inmemorystorage