When an asynchronous service script is launched by the Script Run component, the address (identifier) of the new handler is returned to a variable. +\ Given the address of the nested script, it can be given its own address for two-way communication by sending it in a message. +\ Also, the transfer of addresses can be carried out through a database, through wide-scope variables, through files on disk in network directories, through special storage. \ Due to the potential for the simultaneous operation of many instances of scripts, the key in the repository should be a unique identifier of the subject area entity through which the processes communicate with each other.

Script Interaction Component

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

Description

Interacts between different script engine instances. Can operate in one of the modes: sending a message, receiving a message. In the message receiving mode, it is possible to organize a long wait for messages to arrive.

The address of the current script engine can be obtained through the getscriptref() expression function. +\

Table 1. System characteristics

Index

141

Short name

interactions

Script types

All

Start module

r_script_component_interactions

Mode

Asynchronous

Icon

141

Branching type

Branching, interrupting

Properties

Table 2. Properties
Specification Description

Name: Mode

Code: mode

Visibility condition: no

Default: Sending message

Operating mode

Possible options:

  • Send message (send, 0) – Sends a message to another script engine.

  • Receive message (receive, 1) – Receives the next message from the message queue. The sender ID and message are placed in variables. If the queue is empty, it waits with a set timeout.

  • Receive with filter (receive_filter, 3) – Receives the next message from the message queue from the sender whose identifier is specified in the 'Filter' field. If the queue is empty or no messages from the specified sender are detected, it waits with a set timeout.

  • Availability check (check, 2) – Checks the availability of the script engine with the specified identifier.

Name: Scenario ID

Code: sender

Visibility condition: yes Default: — 

An argument containing the ID of the message recipient (the active scripting engine).

The script’s own identifier is returned by the 'getscriptref()' expression function.

Applicable in sending and checking modes.

Name: Message

Code: message

Visibility condition: yes Default: — 

Argument containing the text of the message.

Applies in sending mode.

Name: Filter by sender

Code: filterSender

Visibility condition: yes

Default: — 

Argument containing the identifier of the sender from whom the message is expected to be received. The script’s own identifier is returned by the 'getscriptref()' expression function.

Applicable in sending and checking modes.

Name: Message to variable

Code: messageVar

Visibility condition: yes

Default: — 

Variable for storing the text of the received message. Used in receive mode.

Name: Sender ID to variable

Code: senderVar

Visibility condition: yes

Default: — 

Variable for storing the identifier of the sending process.

Can be used to send a message back. The script’s own identifier is returned by the 'getscriptref()' expression function.

Used in receive mode.

Name: Sender category to variable

Code: senderCategoryvar

Visibility condition: yes

Default: — 

Variable for storing the category of the message sender. Used in receive mode.

Name: Sender Category

Code: senderCategory

Visibility condition: yes

Default: script

An argument containing the category of the message sender.

Applies in sending mode. Possible options:

  • script (0)

  • b2b (1)

Name: Timeout, s

Code: timeoutSec

Visibility condition: yes

Default: 0

Timeout for waiting for new messages to arrive, in seconds.

Used in receive mode.

Name: Transition

Code: transfer

Visibility condition: no

Default: — 

The component to which control is transferred upon successful completion of the operation.

Name: Transition, error

Code: transferError

Visibility condition: no Default: — 

Component to which control is transferred in case of an error.

Name: Transition, script not found

Code: transferNotFound

Visibility condition: yes

Default: — 

The component to which control is transferred if there is no active script processor with the specified identifiers.

Applicable in sending and checking modes

Name: Transition, time

Code: transferTimeout

Visibility condition: yes

Default: — 

The component to which control is transferred if the timeout for receiving messages expires.

Used in receive mode.

See also