If there are corresponding assets event descriptions, they also end up in the database.

Component Generating a custom event

:icons:font :hardbreaks: :imagesdir: ../../../assets/images :toc-title: Contents :toc:

Description

Sends an arbitrary event to subscribers to system events (role wssubscr). +\

Table 1. System characteristics

Index

115

Short name

raise_event

Script types

All

Start module

r_script_component_raise_event

Mode

Asynchronous

Icon

115

Branching type

Branching, closing

Properties

Table 2. Properties
Specification Description

Name: Direction

Code: destinationType

Visibility condition: no

Default:

Select the direction for sending the event.

Possible options:

  • Subscribers (wssubscr, 0) – The event is generated in the subscription channel to web server clients (websocket). To enable filtering during subscription, the “user” parameter can be specified.

  • KAFKA mustache (kafka_mustache, 1) – The event is generated in the KAFKA storage, specified in the 'kafka_mustache', 'kafka_params' domain settings. The event is generated in an object wrapper, {class, type, ts, data}, where the specified event content is placed in the 'data' field.

  • KAFKA storage (kafka_storage, 2) – The event as an entity is sent to storage of type KAFKA. Connection parameters are specified in the storage entity. Optionally, the name of the topic is also specified there, which must already exist in the broker. Additionally, a storage code is specified to select from the set of storages defined in the domain, as well as a key used to define the partition (for example, the identifier of the entity associated with the event). The event is generated without an object wrapper.

Name: User

Code: user

Visibility condition: yes

Default: — 

User name by which to filter when subscribing. For the role wssubscr, the value is represented as the structure {sipuser, User}.

If not specified, then an empty value is substituted, which can also be a filter.

Used only when selecting the 'Subscribers' direction.

Name: Storage code

Code: storageInstance

Visibility condition: yes Default: — 

Argument specifying the storage code (the 'instance' field of the 'storage' entity with the 'kafka' type).

Used only when selecting the 'KAFKA-domain storage' direction. Required parameter when using this direction.

Name: Partition key

Code: partitionKey

Visibility condition: yes

Default: — 

Optional parameter used to determine the partition number of the corresponding topic in KAFKA. Can be the identifier of the entity associated with the generated event.

Used only when selecting the 'KAFKA-domain storage' direction.

Name: Event name

Code: eventname

Visibility condition: no

Default: — 

Event name containing class and type separated by a dot in the format CLASS_NAME.TYPE_NAME

Name: Event body

Code: body

Visibility condition: no

Default: — 

The body of the sent message as a JSON structure

Name: Transition

Code: transfer

Visibility condition: no Default: — 

Component to which control is transferred upon successful completion.

Name: Transition, error

Code: transferError

Visibility condition: no

Default: — 

The component to which control is transferred when an error occurs.

Name: Cause of error in variable Code: errorReason Visibility condition: no

Default: — 

Variable for storing the error.

See also