Events of soluton domains stored in the streaming database

Location path

Path in the assembly catalog Description

/era_env/priv/metadata/<SOLUTION>/events/events.json

Descriptor of the composition of classes and event types (events.json)

/era_env/priv/metadata/<SOLUTION>/events/<EVENT_CLASS>/<EVENT_TYPE>.json

Descriptor of event fields of type

Overview

A set of assemblies filtering events and the composition of their fields between generation in the system and saving to the streaming domain database of the corresponding solenoid.

Based on metadata files:

  • the structure of the event stream domain database is automatically formed, schemes, tables, columns of the specified types are created;

  • filtering of generated events stored in the streaming database up to complete absence;

  • the composition of fields of generated events is filtered to save a limited number of them in the database.

A list and description of event classes, event types and their fields are available in section.

Not available for the master domain (predefined master solutioin), since there is own event set for it.

Descriptor of the composition of classes and event types (events.json)

A list of event classes and the event types contained in them to be stored in the event stream database of the domain of the corresponding solenoid.

Each of the listed event classes must have a separate directory in the events folder, within which for each type of event of this class there must be a file describing the composition of the event fields to be saved in the database.

Format:
[
  {
    "class": str,
    "events": array<str>
  },
  ...
]
  • class – event class name.

  • events – list of event type names included in the class.

Example events.json

Lists all work domain event classes and the event types included in them

Example:
[
  {
    "class": "alertcallevents",
    "events": [
      "prepared",
      "statechanged",
      "callinited",
      "callfailed",
      "callstarted",
      "callrejected",
      "callpreanswered",
      "callanswered",
      "callapproved",
      "callfinished"
    ]
  },
  {
    "class": "statesevents",
    "events": [
      "user_state_changed"
      "sipuser_state_changed",
      "sipuser_transtate_set"
    ]
  },
  {
    "class": "scriptevents",
    "events": [
      "script_start",
      "script_stop"
    ]
  },
  {
    "class": "providerevents",
    "events": [
      "provider_state_changed"
    ]
  },
  {
    "class": "ivrhuntqevents",
    "events": [
      "queue_greeting",
      "queue_dequeue",
      "queue_userban",
      "queue_enqueue",
      "queue_quit",
      "queue_preivr_start",
      "queue_start_call",
      "final"
    ]
  },
  {
    "class": "selectorevents",
    "events": [
      "sel_create",
      "sel_update",
      "sel_delete",
      "sel_state_changed",
      "sel_abon_state_changed",
      "sel_voting_state_changed"
    ]
  },
  {
    "class": "perfmonevents",
    "events": [
      "server_performance",
      "node_performance"
    ]
  }
]

Descriptor of event fields of type

The catalog of the event class. It is named by the name of the class. It contains inside descriptor files for all event types of the class, their fields and value types in the database. The file names correspond to the names of event types.

Format:
{
  "class": str,
  "type": str,
  "fields": [
    {
      "name": str,
      "type": "varchar" | "bigserial" | "timestamp" | "uuid" | "integer",
      "required": true | false
    },
    ...
  ]
}
  • class – event class name (duplicate of the catalog name).

  • type – event type name (duplicate file name).

  • fields – list of fields to be saved in the database (the table structure):

    • name – event field name and at the same time column name in the database table.

    • type – column value type in the database table.

    • required – field mandatory characteristic (by default false).

    • default – default value (for fields with required = false)

Example

Sample file for event type statesevents.sipuser_state_changed, location /statesevents/sipuser_state_changed.json.

Example
{
  "class": "statesevents",
  "type": "sipuser_state_changed",
  "fields": [
    {"name": "id", "type": "bigserial", "required": true},
    {"name": "login", "type": "varchar", "required": true},
    {"name": "state", "type": "varchar", "required": true},
    {"name": "eventts", "type": "timestamp", "required": true}
  ]
}