Scenario Interaction component

Table of Contents

Description

Performs interaction between different instances of script handlers. It can work in one of the following modes: sending a message, receiving a message. In the message receiving mode it is possible to organize a long waiting time for messages to arrive.

The address of the current script handler can be obtained through the expression function getscriptref().
When an asynchronous service script is run by component Script Run, the address (identifier) of the new handler is returned to a variable.
Having the address of a nested script, it can be passed its own address for two-way communication by sending it in a message.
Addresses can also be transferred through the database, through variables of wide scope, through files on disk in network directories, through special storages. Due to the potential for many script instances to run simultaneously, the key in the repository should be the unique identifier of the subject area entity through which the processes communicate with each other.

Table 1. System Characteristics

Index

141

Short title

interactions

Types of scenarios

All of them

Starter module

r_script_component_interactions

Mode

Asynchronous

Icon

141

Branching pattern

Branching, interrupting

Properties

Table 2. Properties
Specification Description

Title: Mode
Code: mode
Visibility: no
Default: `Send message'

Operation mode
Possible options:

  • Send Message (send, 0) - Sends a message to another script handler.

  • Receive message (receive, 1) - Retrieves the next message from the message queue. Places the sender’s identifier and the message into variables. In case the queue is empty, it goes into waiting with a set timeout.

  • Receive with filter (receive_filter, 3) - Retrieves from the message queue the next message 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, the message queue is pending with a set timeout.

  • Check Availability (check, 2) - Checks the availability of the script handler with the specified identifier.

Title: Script ID
Code: sender
Visibility: yes
Default: — 

Argument containing the message recipient ID (active script handler).
The script’s own identifier is returned by the expressions function 'getscriptref()'.
Applies in sending and checking modes.

Title: Message
Code: message
Visibility: yes
Default: — 

Argument containing the message text.
Applies in send mode.

Title: Sender Filter
Code: filterSender
Visibility: yes
Default: — 

An 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 expressions function 'getscriptref()'.
Applies in sending and checking modes.

Title: Message to variable
Code: messageVar
Visibility: yes
Default: — 

Variable to save the text of the received message.
It is applied in the receiving mode.

Title: Sender id to variable
Code: senderVar
Visibility: yes
Default: — 

Variable to store the sender process ID.
Can be applied to send a message back.
The script’s own identifier is returned by the expressions function 'getscriptref()'.
It is applied in the receiving mode.

Title: Sender Category to variable
Code: senderCategoryvar
Visibility: yes
Default: — 

Variable to store the sender category of the message.
It is applied in the receiving mode.

Title: Sender Category
Code: senderCategory
Visibility: yes
Default: script

An argument containing the category of the message sender.
Applies in send mode.
Possible options:

  • script (0)

  • b2b (1)

Title: Timeout, s
Code: timeoutSec
Visibility: yes
Default: 0

Timeout for waiting for new messages to arrive, in seconds.
It is applied in the receiving mode.

Title: Transition
Code: transfer
Visibility: no
Default: — 

The component to which control is passed when the operation is successful.

Title: Transition, Error
Code: transferError
Visibility: no
Default: — 

The component to which control is passed if an error occurs.

Title: Transition, scenario not found
Code: transferNotFound
Visibility: yes
Default: — 

The component to which control is passed if there is no active script handler with the specified identifier.
Applies in sending and checking modes

Title: Transition, Time
Code: transferTimeout
Visibility: yes
Default: — 

The component to which control is passed when the timeout period for waiting for messages to arrive has expired.
It is applied in the receiving mode.

See also